mirror of https://github.com/apache/iotdb
delete generated codes by Thrift (#517)
* delete generated codes by Thrfit * Update pom.xml
This commit is contained in:
parent
2ddfa9171f
commit
65dce4f54a
10
pom.xml
10
pom.xml
|
@ -1,14 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Copyright (c) 2012 - 2016 YCSB contributors. All rights reserved. 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. -->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
|
|
@ -1,526 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class ServerProperties implements org.apache.thrift.TBase<ServerProperties, ServerProperties._Fields>, java.io.Serializable, Cloneable, Comparable<ServerProperties> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ServerProperties");
|
||||
|
||||
private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)1);
|
||||
private static final org.apache.thrift.protocol.TField SUPPORTED_TIME_AGGREGATION_OPERATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("supportedTimeAggregationOperations", org.apache.thrift.protocol.TType.LIST, (short)2);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new ServerPropertiesStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new ServerPropertiesTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public String version; // required
|
||||
public List<String> supportedTimeAggregationOperations; // required
|
||||
|
||||
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
|
||||
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
|
||||
VERSION((short)1, "version"),
|
||||
SUPPORTED_TIME_AGGREGATION_OPERATIONS((short)2, "supportedTimeAggregationOperations");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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: // VERSION
|
||||
return VERSION;
|
||||
case 2: // SUPPORTED_TIME_AGGREGATION_OPERATIONS
|
||||
return SUPPORTED_TIME_AGGREGATION_OPERATIONS;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches 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.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.REQUIRED,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
|
||||
tmpMap.put(_Fields.SUPPORTED_TIME_AGGREGATION_OPERATIONS, new org.apache.thrift.meta_data.FieldMetaData("supportedTimeAggregationOperations", 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))));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ServerProperties.class, metaDataMap);
|
||||
}
|
||||
|
||||
public ServerProperties() {
|
||||
}
|
||||
|
||||
public ServerProperties(
|
||||
String version,
|
||||
List<String> supportedTimeAggregationOperations)
|
||||
{
|
||||
this();
|
||||
this.version = version;
|
||||
this.supportedTimeAggregationOperations = supportedTimeAggregationOperations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public ServerProperties(ServerProperties other) {
|
||||
if (other.isSetVersion()) {
|
||||
this.version = other.version;
|
||||
}
|
||||
if (other.isSetSupportedTimeAggregationOperations()) {
|
||||
List<String> __this__supportedTimeAggregationOperations = new ArrayList<String>(other.supportedTimeAggregationOperations);
|
||||
this.supportedTimeAggregationOperations = __this__supportedTimeAggregationOperations;
|
||||
}
|
||||
}
|
||||
|
||||
public ServerProperties deepCopy() {
|
||||
return new ServerProperties(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.version = null;
|
||||
this.supportedTimeAggregationOperations = null;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return this.version;
|
||||
}
|
||||
|
||||
public ServerProperties setVersion(String version) {
|
||||
this.version = version;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetVersion() {
|
||||
this.version = null;
|
||||
}
|
||||
|
||||
/** Returns true if field version is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetVersion() {
|
||||
return this.version != null;
|
||||
}
|
||||
|
||||
public void setVersionIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.version = null;
|
||||
}
|
||||
}
|
||||
|
||||
public int getSupportedTimeAggregationOperationsSize() {
|
||||
return (this.supportedTimeAggregationOperations == null) ? 0 : this.supportedTimeAggregationOperations.size();
|
||||
}
|
||||
|
||||
public java.util.Iterator<String> getSupportedTimeAggregationOperationsIterator() {
|
||||
return (this.supportedTimeAggregationOperations == null) ? null : this.supportedTimeAggregationOperations.iterator();
|
||||
}
|
||||
|
||||
public void addToSupportedTimeAggregationOperations(String elem) {
|
||||
if (this.supportedTimeAggregationOperations == null) {
|
||||
this.supportedTimeAggregationOperations = new ArrayList<String>();
|
||||
}
|
||||
this.supportedTimeAggregationOperations.add(elem);
|
||||
}
|
||||
|
||||
public List<String> getSupportedTimeAggregationOperations() {
|
||||
return this.supportedTimeAggregationOperations;
|
||||
}
|
||||
|
||||
public ServerProperties setSupportedTimeAggregationOperations(List<String> supportedTimeAggregationOperations) {
|
||||
this.supportedTimeAggregationOperations = supportedTimeAggregationOperations;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetSupportedTimeAggregationOperations() {
|
||||
this.supportedTimeAggregationOperations = null;
|
||||
}
|
||||
|
||||
/** Returns true if field supportedTimeAggregationOperations is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetSupportedTimeAggregationOperations() {
|
||||
return this.supportedTimeAggregationOperations != null;
|
||||
}
|
||||
|
||||
public void setSupportedTimeAggregationOperationsIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.supportedTimeAggregationOperations = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case VERSION:
|
||||
if (value == null) {
|
||||
unsetVersion();
|
||||
} else {
|
||||
setVersion((String)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case SUPPORTED_TIME_AGGREGATION_OPERATIONS:
|
||||
if (value == null) {
|
||||
unsetSupportedTimeAggregationOperations();
|
||||
} else {
|
||||
setSupportedTimeAggregationOperations((List<String>)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case VERSION:
|
||||
return getVersion();
|
||||
|
||||
case SUPPORTED_TIME_AGGREGATION_OPERATIONS:
|
||||
return getSupportedTimeAggregationOperations();
|
||||
|
||||
}
|
||||
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 VERSION:
|
||||
return isSetVersion();
|
||||
case SUPPORTED_TIME_AGGREGATION_OPERATIONS:
|
||||
return isSetSupportedTimeAggregationOperations();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof ServerProperties)
|
||||
return this.equals((ServerProperties)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(ServerProperties that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
|
||||
boolean this_present_version = true && this.isSetVersion();
|
||||
boolean that_present_version = true && that.isSetVersion();
|
||||
if (this_present_version || that_present_version) {
|
||||
if (!(this_present_version && that_present_version))
|
||||
return false;
|
||||
if (!this.version.equals(that.version))
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_supportedTimeAggregationOperations = true && this.isSetSupportedTimeAggregationOperations();
|
||||
boolean that_present_supportedTimeAggregationOperations = true && that.isSetSupportedTimeAggregationOperations();
|
||||
if (this_present_supportedTimeAggregationOperations || that_present_supportedTimeAggregationOperations) {
|
||||
if (!(this_present_supportedTimeAggregationOperations && that_present_supportedTimeAggregationOperations))
|
||||
return false;
|
||||
if (!this.supportedTimeAggregationOperations.equals(that.supportedTimeAggregationOperations))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(ServerProperties other) {
|
||||
if (!getClass().equals(other.getClass())) {
|
||||
return getClass().getName().compareTo(other.getClass().getName());
|
||||
}
|
||||
|
||||
int lastComparison = 0;
|
||||
|
||||
lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetVersion()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version);
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
}
|
||||
lastComparison = Boolean.valueOf(isSetSupportedTimeAggregationOperations()).compareTo(other.isSetSupportedTimeAggregationOperations());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetSupportedTimeAggregationOperations()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.supportedTimeAggregationOperations, other.supportedTimeAggregationOperations);
|
||||
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("ServerProperties(");
|
||||
boolean first = true;
|
||||
|
||||
sb.append("version:");
|
||||
if (this.version == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.version);
|
||||
}
|
||||
first = false;
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("supportedTimeAggregationOperations:");
|
||||
if (this.supportedTimeAggregationOperations == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.supportedTimeAggregationOperations);
|
||||
}
|
||||
first = false;
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
if (version == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'version' was not present! Struct: " + toString());
|
||||
}
|
||||
if (supportedTimeAggregationOperations == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'supportedTimeAggregationOperations' was not present! 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 ServerPropertiesStandardSchemeFactory implements SchemeFactory {
|
||||
public ServerPropertiesStandardScheme getScheme() {
|
||||
return new ServerPropertiesStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class ServerPropertiesStandardScheme extends StandardScheme<ServerProperties> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, ServerProperties struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.TField schemeField;
|
||||
iprot.readStructBegin();
|
||||
while (true)
|
||||
{
|
||||
schemeField = iprot.readFieldBegin();
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
|
||||
break;
|
||||
}
|
||||
switch (schemeField.id) {
|
||||
case 1: // VERSION
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
struct.version = iprot.readString();
|
||||
struct.setVersionIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 2: // SUPPORTED_TIME_AGGREGATION_OPERATIONS
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list118 = iprot.readListBegin();
|
||||
struct.supportedTimeAggregationOperations = new ArrayList<String>(_list118.size);
|
||||
for (int _i119 = 0; _i119 < _list118.size; ++_i119)
|
||||
{
|
||||
String _elem120;
|
||||
_elem120 = iprot.readString();
|
||||
struct.supportedTimeAggregationOperations.add(_elem120);
|
||||
}
|
||||
iprot.readListEnd();
|
||||
}
|
||||
struct.setSupportedTimeAggregationOperationsIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, ServerProperties struct) throws org.apache.thrift.TException {
|
||||
struct.validate();
|
||||
|
||||
oprot.writeStructBegin(STRUCT_DESC);
|
||||
if (struct.version != null) {
|
||||
oprot.writeFieldBegin(VERSION_FIELD_DESC);
|
||||
oprot.writeString(struct.version);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
if (struct.supportedTimeAggregationOperations != null) {
|
||||
oprot.writeFieldBegin(SUPPORTED_TIME_AGGREGATION_OPERATIONS_FIELD_DESC);
|
||||
{
|
||||
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.supportedTimeAggregationOperations.size()));
|
||||
for (String _iter121 : struct.supportedTimeAggregationOperations)
|
||||
{
|
||||
oprot.writeString(_iter121);
|
||||
}
|
||||
oprot.writeListEnd();
|
||||
}
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class ServerPropertiesTupleSchemeFactory implements SchemeFactory {
|
||||
public ServerPropertiesTupleScheme getScheme() {
|
||||
return new ServerPropertiesTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class ServerPropertiesTupleScheme extends TupleScheme<ServerProperties> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, ServerProperties struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
oprot.writeString(struct.version);
|
||||
{
|
||||
oprot.writeI32(struct.supportedTimeAggregationOperations.size());
|
||||
for (String _iter122 : struct.supportedTimeAggregationOperations)
|
||||
{
|
||||
oprot.writeString(_iter122);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, ServerProperties struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.version = iprot.readString();
|
||||
struct.setVersionIsSet(true);
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list123 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
|
||||
struct.supportedTimeAggregationOperations = new ArrayList<String>(_list123.size);
|
||||
for (int _i124 = 0; _i124 < _list123.size; ++_i124)
|
||||
{
|
||||
String _elem125;
|
||||
_elem125 = iprot.readString();
|
||||
struct.supportedTimeAggregationOperations.add(_elem125);
|
||||
}
|
||||
}
|
||||
struct.setSupportedTimeAggregationOperationsIsSet(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,386 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSCancelOperationReq implements org.apache.thrift.TBase<TSCancelOperationReq, TSCancelOperationReq._Fields>, java.io.Serializable, Cloneable, Comparable<TSCancelOperationReq> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSCancelOperationReq");
|
||||
|
||||
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSCancelOperationReqStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSCancelOperationReqTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public TSOperationHandle 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<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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, TSOperationHandle.class)));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSCancelOperationReq.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSCancelOperationReq() {
|
||||
}
|
||||
|
||||
public TSCancelOperationReq(
|
||||
TSOperationHandle operationHandle)
|
||||
{
|
||||
this();
|
||||
this.operationHandle = operationHandle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSCancelOperationReq(TSCancelOperationReq other) {
|
||||
if (other.isSetOperationHandle()) {
|
||||
this.operationHandle = new TSOperationHandle(other.operationHandle);
|
||||
}
|
||||
}
|
||||
|
||||
public TSCancelOperationReq deepCopy() {
|
||||
return new TSCancelOperationReq(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.operationHandle = null;
|
||||
}
|
||||
|
||||
public TSOperationHandle getOperationHandle() {
|
||||
return this.operationHandle;
|
||||
}
|
||||
|
||||
public TSCancelOperationReq setOperationHandle(TSOperationHandle operationHandle) {
|
||||
this.operationHandle = operationHandle;
|
||||
return this;
|
||||
}
|
||||
|
||||
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((TSOperationHandle)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 TSCancelOperationReq)
|
||||
return this.equals((TSCancelOperationReq)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSCancelOperationReq 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() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSCancelOperationReq 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("TSCancelOperationReq(");
|
||||
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 (operationHandle == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' was not present! 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 TSCancelOperationReqStandardSchemeFactory implements SchemeFactory {
|
||||
public TSCancelOperationReqStandardScheme getScheme() {
|
||||
return new TSCancelOperationReqStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSCancelOperationReqStandardScheme extends StandardScheme<TSCancelOperationReq> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSCancelOperationReq struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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 TSOperationHandle();
|
||||
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();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSCancelOperationReq 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 TSCancelOperationReqTupleSchemeFactory implements SchemeFactory {
|
||||
public TSCancelOperationReqTupleScheme getScheme() {
|
||||
return new TSCancelOperationReqTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSCancelOperationReqTupleScheme extends TupleScheme<TSCancelOperationReq> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSCancelOperationReq struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
struct.operationHandle.write(oprot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSCancelOperationReq struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.operationHandle = new TSOperationHandle();
|
||||
struct.operationHandle.read(iprot);
|
||||
struct.setOperationHandleIsSet(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,386 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSCancelOperationResp implements org.apache.thrift.TBase<TSCancelOperationResp, TSCancelOperationResp._Fields>, java.io.Serializable, Cloneable, Comparable<TSCancelOperationResp> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSCancelOperationResp");
|
||||
|
||||
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSCancelOperationRespStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSCancelOperationRespTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public TS_Status 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<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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, TS_Status.class)));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSCancelOperationResp.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSCancelOperationResp() {
|
||||
}
|
||||
|
||||
public TSCancelOperationResp(
|
||||
TS_Status status)
|
||||
{
|
||||
this();
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSCancelOperationResp(TSCancelOperationResp other) {
|
||||
if (other.isSetStatus()) {
|
||||
this.status = new TS_Status(other.status);
|
||||
}
|
||||
}
|
||||
|
||||
public TSCancelOperationResp deepCopy() {
|
||||
return new TSCancelOperationResp(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.status = null;
|
||||
}
|
||||
|
||||
public TS_Status getStatus() {
|
||||
return this.status;
|
||||
}
|
||||
|
||||
public TSCancelOperationResp setStatus(TS_Status status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
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((TS_Status)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 TSCancelOperationResp)
|
||||
return this.equals((TSCancelOperationResp)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSCancelOperationResp 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() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSCancelOperationResp 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("TSCancelOperationResp(");
|
||||
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 (status == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' was not present! 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 TSCancelOperationRespStandardSchemeFactory implements SchemeFactory {
|
||||
public TSCancelOperationRespStandardScheme getScheme() {
|
||||
return new TSCancelOperationRespStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSCancelOperationRespStandardScheme extends StandardScheme<TSCancelOperationResp> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSCancelOperationResp struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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 TS_Status();
|
||||
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();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSCancelOperationResp 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 TSCancelOperationRespTupleSchemeFactory implements SchemeFactory {
|
||||
public TSCancelOperationRespTupleScheme getScheme() {
|
||||
return new TSCancelOperationRespTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSCancelOperationRespTupleScheme extends TupleScheme<TSCancelOperationResp> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSCancelOperationResp struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
struct.status.write(oprot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSCancelOperationResp struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.status = new TS_Status();
|
||||
struct.status.read(iprot);
|
||||
struct.setStatusIsSet(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,386 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSCloseOperationReq implements org.apache.thrift.TBase<TSCloseOperationReq, TSCloseOperationReq._Fields>, java.io.Serializable, Cloneable, Comparable<TSCloseOperationReq> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSCloseOperationReq");
|
||||
|
||||
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSCloseOperationReqStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSCloseOperationReqTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public TSOperationHandle 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<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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, TSOperationHandle.class)));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSCloseOperationReq.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSCloseOperationReq() {
|
||||
}
|
||||
|
||||
public TSCloseOperationReq(
|
||||
TSOperationHandle operationHandle)
|
||||
{
|
||||
this();
|
||||
this.operationHandle = operationHandle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSCloseOperationReq(TSCloseOperationReq other) {
|
||||
if (other.isSetOperationHandle()) {
|
||||
this.operationHandle = new TSOperationHandle(other.operationHandle);
|
||||
}
|
||||
}
|
||||
|
||||
public TSCloseOperationReq deepCopy() {
|
||||
return new TSCloseOperationReq(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.operationHandle = null;
|
||||
}
|
||||
|
||||
public TSOperationHandle getOperationHandle() {
|
||||
return this.operationHandle;
|
||||
}
|
||||
|
||||
public TSCloseOperationReq setOperationHandle(TSOperationHandle operationHandle) {
|
||||
this.operationHandle = operationHandle;
|
||||
return this;
|
||||
}
|
||||
|
||||
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((TSOperationHandle)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 TSCloseOperationReq)
|
||||
return this.equals((TSCloseOperationReq)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSCloseOperationReq 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() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSCloseOperationReq 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("TSCloseOperationReq(");
|
||||
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 (operationHandle == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' was not present! 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 TSCloseOperationReqStandardSchemeFactory implements SchemeFactory {
|
||||
public TSCloseOperationReqStandardScheme getScheme() {
|
||||
return new TSCloseOperationReqStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSCloseOperationReqStandardScheme extends StandardScheme<TSCloseOperationReq> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSCloseOperationReq struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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 TSOperationHandle();
|
||||
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();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSCloseOperationReq 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 TSCloseOperationReqTupleSchemeFactory implements SchemeFactory {
|
||||
public TSCloseOperationReqTupleScheme getScheme() {
|
||||
return new TSCloseOperationReqTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSCloseOperationReqTupleScheme extends TupleScheme<TSCloseOperationReq> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSCloseOperationReq struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
struct.operationHandle.write(oprot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSCloseOperationReq struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.operationHandle = new TSOperationHandle();
|
||||
struct.operationHandle.read(iprot);
|
||||
struct.setOperationHandleIsSet(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,386 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSCloseOperationResp implements org.apache.thrift.TBase<TSCloseOperationResp, TSCloseOperationResp._Fields>, java.io.Serializable, Cloneable, Comparable<TSCloseOperationResp> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSCloseOperationResp");
|
||||
|
||||
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSCloseOperationRespStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSCloseOperationRespTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public TS_Status 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<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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, TS_Status.class)));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSCloseOperationResp.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSCloseOperationResp() {
|
||||
}
|
||||
|
||||
public TSCloseOperationResp(
|
||||
TS_Status status)
|
||||
{
|
||||
this();
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSCloseOperationResp(TSCloseOperationResp other) {
|
||||
if (other.isSetStatus()) {
|
||||
this.status = new TS_Status(other.status);
|
||||
}
|
||||
}
|
||||
|
||||
public TSCloseOperationResp deepCopy() {
|
||||
return new TSCloseOperationResp(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.status = null;
|
||||
}
|
||||
|
||||
public TS_Status getStatus() {
|
||||
return this.status;
|
||||
}
|
||||
|
||||
public TSCloseOperationResp setStatus(TS_Status status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
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((TS_Status)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 TSCloseOperationResp)
|
||||
return this.equals((TSCloseOperationResp)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSCloseOperationResp 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() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSCloseOperationResp 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("TSCloseOperationResp(");
|
||||
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 (status == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' was not present! 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 TSCloseOperationRespStandardSchemeFactory implements SchemeFactory {
|
||||
public TSCloseOperationRespStandardScheme getScheme() {
|
||||
return new TSCloseOperationRespStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSCloseOperationRespStandardScheme extends StandardScheme<TSCloseOperationResp> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSCloseOperationResp struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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 TS_Status();
|
||||
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();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSCloseOperationResp 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 TSCloseOperationRespTupleSchemeFactory implements SchemeFactory {
|
||||
public TSCloseOperationRespTupleScheme getScheme() {
|
||||
return new TSCloseOperationRespTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSCloseOperationRespTupleScheme extends TupleScheme<TSCloseOperationResp> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSCloseOperationResp struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
struct.status.write(oprot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSCloseOperationResp struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.status = new TS_Status();
|
||||
struct.status.read(iprot);
|
||||
struct.setStatusIsSet(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,386 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSCloseSessionReq implements org.apache.thrift.TBase<TSCloseSessionReq, TSCloseSessionReq._Fields>, java.io.Serializable, Cloneable, Comparable<TSCloseSessionReq> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSCloseSessionReq");
|
||||
|
||||
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSCloseSessionReqStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSCloseSessionReqTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public TS_SessionHandle 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<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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, TS_SessionHandle.class)));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSCloseSessionReq.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSCloseSessionReq() {
|
||||
}
|
||||
|
||||
public TSCloseSessionReq(
|
||||
TS_SessionHandle sessionHandle)
|
||||
{
|
||||
this();
|
||||
this.sessionHandle = sessionHandle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSCloseSessionReq(TSCloseSessionReq other) {
|
||||
if (other.isSetSessionHandle()) {
|
||||
this.sessionHandle = new TS_SessionHandle(other.sessionHandle);
|
||||
}
|
||||
}
|
||||
|
||||
public TSCloseSessionReq deepCopy() {
|
||||
return new TSCloseSessionReq(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.sessionHandle = null;
|
||||
}
|
||||
|
||||
public TS_SessionHandle getSessionHandle() {
|
||||
return this.sessionHandle;
|
||||
}
|
||||
|
||||
public TSCloseSessionReq setSessionHandle(TS_SessionHandle sessionHandle) {
|
||||
this.sessionHandle = sessionHandle;
|
||||
return this;
|
||||
}
|
||||
|
||||
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((TS_SessionHandle)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 TSCloseSessionReq)
|
||||
return this.equals((TSCloseSessionReq)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSCloseSessionReq 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() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSCloseSessionReq 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("TSCloseSessionReq(");
|
||||
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 (sessionHandle == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' was not present! 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 TSCloseSessionReqStandardSchemeFactory implements SchemeFactory {
|
||||
public TSCloseSessionReqStandardScheme getScheme() {
|
||||
return new TSCloseSessionReqStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSCloseSessionReqStandardScheme extends StandardScheme<TSCloseSessionReq> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSCloseSessionReq struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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 TS_SessionHandle();
|
||||
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();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSCloseSessionReq 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 TSCloseSessionReqTupleSchemeFactory implements SchemeFactory {
|
||||
public TSCloseSessionReqTupleScheme getScheme() {
|
||||
return new TSCloseSessionReqTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSCloseSessionReqTupleScheme extends TupleScheme<TSCloseSessionReq> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSCloseSessionReq struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
struct.sessionHandle.write(oprot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSCloseSessionReq struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.sessionHandle = new TS_SessionHandle();
|
||||
struct.sessionHandle.read(iprot);
|
||||
struct.setSessionHandleIsSet(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,386 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSCloseSessionResp implements org.apache.thrift.TBase<TSCloseSessionResp, TSCloseSessionResp._Fields>, java.io.Serializable, Cloneable, Comparable<TSCloseSessionResp> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSCloseSessionResp");
|
||||
|
||||
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSCloseSessionRespStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSCloseSessionRespTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public TS_Status 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<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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, TS_Status.class)));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSCloseSessionResp.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSCloseSessionResp() {
|
||||
}
|
||||
|
||||
public TSCloseSessionResp(
|
||||
TS_Status status)
|
||||
{
|
||||
this();
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSCloseSessionResp(TSCloseSessionResp other) {
|
||||
if (other.isSetStatus()) {
|
||||
this.status = new TS_Status(other.status);
|
||||
}
|
||||
}
|
||||
|
||||
public TSCloseSessionResp deepCopy() {
|
||||
return new TSCloseSessionResp(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.status = null;
|
||||
}
|
||||
|
||||
public TS_Status getStatus() {
|
||||
return this.status;
|
||||
}
|
||||
|
||||
public TSCloseSessionResp setStatus(TS_Status status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
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((TS_Status)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 TSCloseSessionResp)
|
||||
return this.equals((TSCloseSessionResp)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSCloseSessionResp 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() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSCloseSessionResp 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("TSCloseSessionResp(");
|
||||
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 (status == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' was not present! 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 TSCloseSessionRespStandardSchemeFactory implements SchemeFactory {
|
||||
public TSCloseSessionRespStandardScheme getScheme() {
|
||||
return new TSCloseSessionRespStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSCloseSessionRespStandardScheme extends StandardScheme<TSCloseSessionResp> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSCloseSessionResp struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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 TS_Status();
|
||||
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();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSCloseSessionResp 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 TSCloseSessionRespTupleSchemeFactory implements SchemeFactory {
|
||||
public TSCloseSessionRespTupleScheme getScheme() {
|
||||
return new TSCloseSessionRespTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSCloseSessionRespTupleScheme extends TupleScheme<TSCloseSessionResp> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSCloseSessionResp struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
struct.status.write(oprot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSCloseSessionResp struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.status = new TS_Status();
|
||||
struct.status.read(iprot);
|
||||
struct.setStatusIsSet(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,744 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSColumnSchema implements org.apache.thrift.TBase<TSColumnSchema, TSColumnSchema._Fields>, java.io.Serializable, Cloneable, Comparable<TSColumnSchema> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSColumnSchema");
|
||||
|
||||
private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
|
||||
private static final org.apache.thrift.protocol.TField DATA_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("dataType", org.apache.thrift.protocol.TType.STRING, (short)2);
|
||||
private static final org.apache.thrift.protocol.TField ENCODING_FIELD_DESC = new org.apache.thrift.protocol.TField("encoding", org.apache.thrift.protocol.TType.STRING, (short)3);
|
||||
private static final org.apache.thrift.protocol.TField OTHER_ARGS_FIELD_DESC = new org.apache.thrift.protocol.TField("otherArgs", org.apache.thrift.protocol.TType.MAP, (short)4);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSColumnSchemaStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSColumnSchemaTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public String name; // optional
|
||||
public String dataType; // optional
|
||||
public String encoding; // optional
|
||||
public Map<String,String> otherArgs; // 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 {
|
||||
NAME((short)1, "name"),
|
||||
DATA_TYPE((short)2, "dataType"),
|
||||
ENCODING((short)3, "encoding"),
|
||||
OTHER_ARGS((short)4, "otherArgs");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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
|
||||
return NAME;
|
||||
case 2: // DATA_TYPE
|
||||
return DATA_TYPE;
|
||||
case 3: // ENCODING
|
||||
return ENCODING;
|
||||
case 4: // OTHER_ARGS
|
||||
return OTHER_ARGS;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches fieldId, throwing an exception
|
||||
* if it is not found.
|
||||
*/
|
||||
public static _Fields findByThriftIdOrThrow(int fieldId) {
|
||||
_Fields fields = findByThriftId(fieldId);
|
||||
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
|
||||
return fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches name, or null if its not found.
|
||||
*/
|
||||
public static _Fields findByName(String name) {
|
||||
return byName.get(name);
|
||||
}
|
||||
|
||||
private final short _thriftId;
|
||||
private final String _fieldName;
|
||||
|
||||
_Fields(short thriftId, String fieldName) {
|
||||
_thriftId = thriftId;
|
||||
_fieldName = fieldName;
|
||||
}
|
||||
|
||||
public short getThriftFieldId() {
|
||||
return _thriftId;
|
||||
}
|
||||
|
||||
public String getFieldName() {
|
||||
return _fieldName;
|
||||
}
|
||||
}
|
||||
|
||||
// isset id assignments
|
||||
private _Fields optionals[] = {_Fields.NAME,_Fields.DATA_TYPE,_Fields.ENCODING,_Fields.OTHER_ARGS};
|
||||
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, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.OPTIONAL,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
|
||||
tmpMap.put(_Fields.DATA_TYPE, new org.apache.thrift.meta_data.FieldMetaData("dataType", org.apache.thrift.TFieldRequirementType.OPTIONAL,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
|
||||
tmpMap.put(_Fields.ENCODING, new org.apache.thrift.meta_data.FieldMetaData("encoding", org.apache.thrift.TFieldRequirementType.OPTIONAL,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
|
||||
tmpMap.put(_Fields.OTHER_ARGS, new org.apache.thrift.meta_data.FieldMetaData("otherArgs", 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(TSColumnSchema.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSColumnSchema() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSColumnSchema(TSColumnSchema other) {
|
||||
if (other.isSetName()) {
|
||||
this.name = other.name;
|
||||
}
|
||||
if (other.isSetDataType()) {
|
||||
this.dataType = other.dataType;
|
||||
}
|
||||
if (other.isSetEncoding()) {
|
||||
this.encoding = other.encoding;
|
||||
}
|
||||
if (other.isSetOtherArgs()) {
|
||||
Map<String,String> __this__otherArgs = new HashMap<String,String>(other.otherArgs);
|
||||
this.otherArgs = __this__otherArgs;
|
||||
}
|
||||
}
|
||||
|
||||
public TSColumnSchema deepCopy() {
|
||||
return new TSColumnSchema(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.name = null;
|
||||
this.dataType = null;
|
||||
this.encoding = null;
|
||||
this.otherArgs = null;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public TSColumnSchema setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetName() {
|
||||
this.name = null;
|
||||
}
|
||||
|
||||
/** Returns true if field name is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetName() {
|
||||
return this.name != null;
|
||||
}
|
||||
|
||||
public void setNameIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.name = null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getDataType() {
|
||||
return this.dataType;
|
||||
}
|
||||
|
||||
public TSColumnSchema setDataType(String dataType) {
|
||||
this.dataType = dataType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetDataType() {
|
||||
this.dataType = null;
|
||||
}
|
||||
|
||||
/** Returns true if field dataType is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetDataType() {
|
||||
return this.dataType != null;
|
||||
}
|
||||
|
||||
public void setDataTypeIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.dataType = null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getEncoding() {
|
||||
return this.encoding;
|
||||
}
|
||||
|
||||
public TSColumnSchema setEncoding(String encoding) {
|
||||
this.encoding = encoding;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetEncoding() {
|
||||
this.encoding = null;
|
||||
}
|
||||
|
||||
/** Returns true if field encoding is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetEncoding() {
|
||||
return this.encoding != null;
|
||||
}
|
||||
|
||||
public void setEncodingIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.encoding = null;
|
||||
}
|
||||
}
|
||||
|
||||
public int getOtherArgsSize() {
|
||||
return (this.otherArgs == null) ? 0 : this.otherArgs.size();
|
||||
}
|
||||
|
||||
public void putToOtherArgs(String key, String val) {
|
||||
if (this.otherArgs == null) {
|
||||
this.otherArgs = new HashMap<String,String>();
|
||||
}
|
||||
this.otherArgs.put(key, val);
|
||||
}
|
||||
|
||||
public Map<String,String> getOtherArgs() {
|
||||
return this.otherArgs;
|
||||
}
|
||||
|
||||
public TSColumnSchema setOtherArgs(Map<String,String> otherArgs) {
|
||||
this.otherArgs = otherArgs;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetOtherArgs() {
|
||||
this.otherArgs = null;
|
||||
}
|
||||
|
||||
/** Returns true if field otherArgs is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetOtherArgs() {
|
||||
return this.otherArgs != null;
|
||||
}
|
||||
|
||||
public void setOtherArgsIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.otherArgs = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case NAME:
|
||||
if (value == null) {
|
||||
unsetName();
|
||||
} else {
|
||||
setName((String)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case DATA_TYPE:
|
||||
if (value == null) {
|
||||
unsetDataType();
|
||||
} else {
|
||||
setDataType((String)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case ENCODING:
|
||||
if (value == null) {
|
||||
unsetEncoding();
|
||||
} else {
|
||||
setEncoding((String)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case OTHER_ARGS:
|
||||
if (value == null) {
|
||||
unsetOtherArgs();
|
||||
} else {
|
||||
setOtherArgs((Map<String,String>)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case NAME:
|
||||
return getName();
|
||||
|
||||
case DATA_TYPE:
|
||||
return getDataType();
|
||||
|
||||
case ENCODING:
|
||||
return getEncoding();
|
||||
|
||||
case OTHER_ARGS:
|
||||
return getOtherArgs();
|
||||
|
||||
}
|
||||
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:
|
||||
return isSetName();
|
||||
case DATA_TYPE:
|
||||
return isSetDataType();
|
||||
case ENCODING:
|
||||
return isSetEncoding();
|
||||
case OTHER_ARGS:
|
||||
return isSetOtherArgs();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof TSColumnSchema)
|
||||
return this.equals((TSColumnSchema)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSColumnSchema that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
|
||||
boolean this_present_name = true && this.isSetName();
|
||||
boolean that_present_name = true && that.isSetName();
|
||||
if (this_present_name || that_present_name) {
|
||||
if (!(this_present_name && that_present_name))
|
||||
return false;
|
||||
if (!this.name.equals(that.name))
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_dataType = true && this.isSetDataType();
|
||||
boolean that_present_dataType = true && that.isSetDataType();
|
||||
if (this_present_dataType || that_present_dataType) {
|
||||
if (!(this_present_dataType && that_present_dataType))
|
||||
return false;
|
||||
if (!this.dataType.equals(that.dataType))
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_encoding = true && this.isSetEncoding();
|
||||
boolean that_present_encoding = true && that.isSetEncoding();
|
||||
if (this_present_encoding || that_present_encoding) {
|
||||
if (!(this_present_encoding && that_present_encoding))
|
||||
return false;
|
||||
if (!this.encoding.equals(that.encoding))
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_otherArgs = true && this.isSetOtherArgs();
|
||||
boolean that_present_otherArgs = true && that.isSetOtherArgs();
|
||||
if (this_present_otherArgs || that_present_otherArgs) {
|
||||
if (!(this_present_otherArgs && that_present_otherArgs))
|
||||
return false;
|
||||
if (!this.otherArgs.equals(that.otherArgs))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSColumnSchema other) {
|
||||
if (!getClass().equals(other.getClass())) {
|
||||
return getClass().getName().compareTo(other.getClass().getName());
|
||||
}
|
||||
|
||||
int lastComparison = 0;
|
||||
|
||||
lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetName()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
}
|
||||
lastComparison = Boolean.valueOf(isSetDataType()).compareTo(other.isSetDataType());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetDataType()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataType, other.dataType);
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
}
|
||||
lastComparison = Boolean.valueOf(isSetEncoding()).compareTo(other.isSetEncoding());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetEncoding()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.encoding, other.encoding);
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
}
|
||||
lastComparison = Boolean.valueOf(isSetOtherArgs()).compareTo(other.isSetOtherArgs());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetOtherArgs()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.otherArgs, other.otherArgs);
|
||||
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("TSColumnSchema(");
|
||||
boolean first = true;
|
||||
|
||||
if (isSetName()) {
|
||||
sb.append("name:");
|
||||
if (this.name == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.name);
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
if (isSetDataType()) {
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("dataType:");
|
||||
if (this.dataType == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.dataType);
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
if (isSetEncoding()) {
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("encoding:");
|
||||
if (this.encoding == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.encoding);
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
if (isSetOtherArgs()) {
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("otherArgs:");
|
||||
if (this.otherArgs == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.otherArgs);
|
||||
}
|
||||
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 TSColumnSchemaStandardSchemeFactory implements SchemeFactory {
|
||||
public TSColumnSchemaStandardScheme getScheme() {
|
||||
return new TSColumnSchemaStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSColumnSchemaStandardScheme extends StandardScheme<TSColumnSchema> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSColumnSchema struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
struct.name = iprot.readString();
|
||||
struct.setNameIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 2: // DATA_TYPE
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
struct.dataType = iprot.readString();
|
||||
struct.setDataTypeIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 3: // ENCODING
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
struct.encoding = iprot.readString();
|
||||
struct.setEncodingIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 4: // OTHER_ARGS
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
|
||||
{
|
||||
org.apache.thrift.protocol.TMap _map164 = iprot.readMapBegin();
|
||||
struct.otherArgs = new HashMap<String,String>(2*_map164.size);
|
||||
for (int _i165 = 0; _i165 < _map164.size; ++_i165)
|
||||
{
|
||||
String _key166;
|
||||
String _val167;
|
||||
_key166 = iprot.readString();
|
||||
_val167 = iprot.readString();
|
||||
struct.otherArgs.put(_key166, _val167);
|
||||
}
|
||||
iprot.readMapEnd();
|
||||
}
|
||||
struct.setOtherArgsIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSColumnSchema struct) throws org.apache.thrift.TException {
|
||||
struct.validate();
|
||||
|
||||
oprot.writeStructBegin(STRUCT_DESC);
|
||||
if (struct.name != null) {
|
||||
if (struct.isSetName()) {
|
||||
oprot.writeFieldBegin(NAME_FIELD_DESC);
|
||||
oprot.writeString(struct.name);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
if (struct.dataType != null) {
|
||||
if (struct.isSetDataType()) {
|
||||
oprot.writeFieldBegin(DATA_TYPE_FIELD_DESC);
|
||||
oprot.writeString(struct.dataType);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
if (struct.encoding != null) {
|
||||
if (struct.isSetEncoding()) {
|
||||
oprot.writeFieldBegin(ENCODING_FIELD_DESC);
|
||||
oprot.writeString(struct.encoding);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
if (struct.otherArgs != null) {
|
||||
if (struct.isSetOtherArgs()) {
|
||||
oprot.writeFieldBegin(OTHER_ARGS_FIELD_DESC);
|
||||
{
|
||||
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.otherArgs.size()));
|
||||
for (Map.Entry<String, String> _iter168 : struct.otherArgs.entrySet())
|
||||
{
|
||||
oprot.writeString(_iter168.getKey());
|
||||
oprot.writeString(_iter168.getValue());
|
||||
}
|
||||
oprot.writeMapEnd();
|
||||
}
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class TSColumnSchemaTupleSchemeFactory implements SchemeFactory {
|
||||
public TSColumnSchemaTupleScheme getScheme() {
|
||||
return new TSColumnSchemaTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSColumnSchemaTupleScheme extends TupleScheme<TSColumnSchema> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSColumnSchema struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
BitSet optionals = new BitSet();
|
||||
if (struct.isSetName()) {
|
||||
optionals.set(0);
|
||||
}
|
||||
if (struct.isSetDataType()) {
|
||||
optionals.set(1);
|
||||
}
|
||||
if (struct.isSetEncoding()) {
|
||||
optionals.set(2);
|
||||
}
|
||||
if (struct.isSetOtherArgs()) {
|
||||
optionals.set(3);
|
||||
}
|
||||
oprot.writeBitSet(optionals, 4);
|
||||
if (struct.isSetName()) {
|
||||
oprot.writeString(struct.name);
|
||||
}
|
||||
if (struct.isSetDataType()) {
|
||||
oprot.writeString(struct.dataType);
|
||||
}
|
||||
if (struct.isSetEncoding()) {
|
||||
oprot.writeString(struct.encoding);
|
||||
}
|
||||
if (struct.isSetOtherArgs()) {
|
||||
{
|
||||
oprot.writeI32(struct.otherArgs.size());
|
||||
for (Map.Entry<String, String> _iter169 : struct.otherArgs.entrySet())
|
||||
{
|
||||
oprot.writeString(_iter169.getKey());
|
||||
oprot.writeString(_iter169.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSColumnSchema struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
BitSet incoming = iprot.readBitSet(4);
|
||||
if (incoming.get(0)) {
|
||||
struct.name = iprot.readString();
|
||||
struct.setNameIsSet(true);
|
||||
}
|
||||
if (incoming.get(1)) {
|
||||
struct.dataType = iprot.readString();
|
||||
struct.setDataTypeIsSet(true);
|
||||
}
|
||||
if (incoming.get(2)) {
|
||||
struct.encoding = iprot.readString();
|
||||
struct.setEncodingIsSet(true);
|
||||
}
|
||||
if (incoming.get(3)) {
|
||||
{
|
||||
org.apache.thrift.protocol.TMap _map170 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
|
||||
struct.otherArgs = new HashMap<String,String>(2*_map170.size);
|
||||
for (int _i171 = 0; _i171 < _map170.size; ++_i171)
|
||||
{
|
||||
String _key172;
|
||||
String _val173;
|
||||
_key172 = iprot.readString();
|
||||
_val173 = iprot.readString();
|
||||
struct.otherArgs.put(_key172, _val173);
|
||||
}
|
||||
}
|
||||
struct.setOtherArgsIsSet(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1,531 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSExecuteBatchStatementReq implements org.apache.thrift.TBase<TSExecuteBatchStatementReq, TSExecuteBatchStatementReq._Fields>, java.io.Serializable, Cloneable, Comparable<TSExecuteBatchStatementReq> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSExecuteBatchStatementReq");
|
||||
|
||||
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 STATEMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("statements", org.apache.thrift.protocol.TType.LIST, (short)2);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSExecuteBatchStatementReqStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSExecuteBatchStatementReqTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public TS_SessionHandle sessionHandle; // required
|
||||
public List<String> statements; // required
|
||||
|
||||
/** 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"),
|
||||
STATEMENTS((short)2, "statements");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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: // STATEMENTS
|
||||
return STATEMENTS;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches 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, TS_SessionHandle.class)));
|
||||
tmpMap.put(_Fields.STATEMENTS, new org.apache.thrift.meta_data.FieldMetaData("statements", 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))));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSExecuteBatchStatementReq.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSExecuteBatchStatementReq() {
|
||||
}
|
||||
|
||||
public TSExecuteBatchStatementReq(
|
||||
TS_SessionHandle sessionHandle,
|
||||
List<String> statements)
|
||||
{
|
||||
this();
|
||||
this.sessionHandle = sessionHandle;
|
||||
this.statements = statements;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSExecuteBatchStatementReq(TSExecuteBatchStatementReq other) {
|
||||
if (other.isSetSessionHandle()) {
|
||||
this.sessionHandle = new TS_SessionHandle(other.sessionHandle);
|
||||
}
|
||||
if (other.isSetStatements()) {
|
||||
List<String> __this__statements = new ArrayList<String>(other.statements);
|
||||
this.statements = __this__statements;
|
||||
}
|
||||
}
|
||||
|
||||
public TSExecuteBatchStatementReq deepCopy() {
|
||||
return new TSExecuteBatchStatementReq(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.sessionHandle = null;
|
||||
this.statements = null;
|
||||
}
|
||||
|
||||
public TS_SessionHandle getSessionHandle() {
|
||||
return this.sessionHandle;
|
||||
}
|
||||
|
||||
public TSExecuteBatchStatementReq setSessionHandle(TS_SessionHandle sessionHandle) {
|
||||
this.sessionHandle = sessionHandle;
|
||||
return this;
|
||||
}
|
||||
|
||||
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 getStatementsSize() {
|
||||
return (this.statements == null) ? 0 : this.statements.size();
|
||||
}
|
||||
|
||||
public java.util.Iterator<String> getStatementsIterator() {
|
||||
return (this.statements == null) ? null : this.statements.iterator();
|
||||
}
|
||||
|
||||
public void addToStatements(String elem) {
|
||||
if (this.statements == null) {
|
||||
this.statements = new ArrayList<String>();
|
||||
}
|
||||
this.statements.add(elem);
|
||||
}
|
||||
|
||||
public List<String> getStatements() {
|
||||
return this.statements;
|
||||
}
|
||||
|
||||
public TSExecuteBatchStatementReq setStatements(List<String> statements) {
|
||||
this.statements = statements;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetStatements() {
|
||||
this.statements = null;
|
||||
}
|
||||
|
||||
/** Returns true if field statements is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetStatements() {
|
||||
return this.statements != null;
|
||||
}
|
||||
|
||||
public void setStatementsIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.statements = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case SESSION_HANDLE:
|
||||
if (value == null) {
|
||||
unsetSessionHandle();
|
||||
} else {
|
||||
setSessionHandle((TS_SessionHandle)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case STATEMENTS:
|
||||
if (value == null) {
|
||||
unsetStatements();
|
||||
} else {
|
||||
setStatements((List<String>)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case SESSION_HANDLE:
|
||||
return getSessionHandle();
|
||||
|
||||
case STATEMENTS:
|
||||
return getStatements();
|
||||
|
||||
}
|
||||
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 STATEMENTS:
|
||||
return isSetStatements();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof TSExecuteBatchStatementReq)
|
||||
return this.equals((TSExecuteBatchStatementReq)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSExecuteBatchStatementReq 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_statements = true && this.isSetStatements();
|
||||
boolean that_present_statements = true && that.isSetStatements();
|
||||
if (this_present_statements || that_present_statements) {
|
||||
if (!(this_present_statements && that_present_statements))
|
||||
return false;
|
||||
if (!this.statements.equals(that.statements))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSExecuteBatchStatementReq 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(isSetStatements()).compareTo(other.isSetStatements());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetStatements()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.statements, other.statements);
|
||||
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("TSExecuteBatchStatementReq(");
|
||||
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("statements:");
|
||||
if (this.statements == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.statements);
|
||||
}
|
||||
first = false;
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
if (sessionHandle == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' was not present! Struct: " + toString());
|
||||
}
|
||||
if (statements == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'statements' was not present! 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 TSExecuteBatchStatementReqStandardSchemeFactory implements SchemeFactory {
|
||||
public TSExecuteBatchStatementReqStandardScheme getScheme() {
|
||||
return new TSExecuteBatchStatementReqStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSExecuteBatchStatementReqStandardScheme extends StandardScheme<TSExecuteBatchStatementReq> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSExecuteBatchStatementReq struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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 TS_SessionHandle();
|
||||
struct.sessionHandle.read(iprot);
|
||||
struct.setSessionHandleIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 2: // STATEMENTS
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list44 = iprot.readListBegin();
|
||||
struct.statements = new ArrayList<String>(_list44.size);
|
||||
for (int _i45 = 0; _i45 < _list44.size; ++_i45)
|
||||
{
|
||||
String _elem46;
|
||||
_elem46 = iprot.readString();
|
||||
struct.statements.add(_elem46);
|
||||
}
|
||||
iprot.readListEnd();
|
||||
}
|
||||
struct.setStatementsIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSExecuteBatchStatementReq 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.statements != null) {
|
||||
oprot.writeFieldBegin(STATEMENTS_FIELD_DESC);
|
||||
{
|
||||
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.statements.size()));
|
||||
for (String _iter47 : struct.statements)
|
||||
{
|
||||
oprot.writeString(_iter47);
|
||||
}
|
||||
oprot.writeListEnd();
|
||||
}
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class TSExecuteBatchStatementReqTupleSchemeFactory implements SchemeFactory {
|
||||
public TSExecuteBatchStatementReqTupleScheme getScheme() {
|
||||
return new TSExecuteBatchStatementReqTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSExecuteBatchStatementReqTupleScheme extends TupleScheme<TSExecuteBatchStatementReq> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSExecuteBatchStatementReq struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
struct.sessionHandle.write(oprot);
|
||||
{
|
||||
oprot.writeI32(struct.statements.size());
|
||||
for (String _iter48 : struct.statements)
|
||||
{
|
||||
oprot.writeString(_iter48);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSExecuteBatchStatementReq struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.sessionHandle = new TS_SessionHandle();
|
||||
struct.sessionHandle.read(iprot);
|
||||
struct.setSessionHandleIsSet(true);
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list49 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
|
||||
struct.statements = new ArrayList<String>(_list49.size);
|
||||
for (int _i50 = 0; _i50 < _list49.size; ++_i50)
|
||||
{
|
||||
String _elem51;
|
||||
_elem51 = iprot.readString();
|
||||
struct.statements.add(_elem51);
|
||||
}
|
||||
}
|
||||
struct.setStatementsIsSet(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,541 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSExecuteBatchStatementResp implements org.apache.thrift.TBase<TSExecuteBatchStatementResp, TSExecuteBatchStatementResp._Fields>, java.io.Serializable, Cloneable, Comparable<TSExecuteBatchStatementResp> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSExecuteBatchStatementResp");
|
||||
|
||||
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 RESULT_FIELD_DESC = new org.apache.thrift.protocol.TField("result", org.apache.thrift.protocol.TType.LIST, (short)2);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSExecuteBatchStatementRespStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSExecuteBatchStatementRespTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public TS_Status status; // required
|
||||
public List<Integer> result; // 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"),
|
||||
RESULT((short)2, "result");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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: // RESULT
|
||||
return RESULT;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches fieldId, throwing an exception
|
||||
* if it is not found.
|
||||
*/
|
||||
public static _Fields findByThriftIdOrThrow(int fieldId) {
|
||||
_Fields fields = findByThriftId(fieldId);
|
||||
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
|
||||
return fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches name, or null if its not found.
|
||||
*/
|
||||
public static _Fields findByName(String name) {
|
||||
return byName.get(name);
|
||||
}
|
||||
|
||||
private final short _thriftId;
|
||||
private final String _fieldName;
|
||||
|
||||
_Fields(short thriftId, String fieldName) {
|
||||
_thriftId = thriftId;
|
||||
_fieldName = fieldName;
|
||||
}
|
||||
|
||||
public short getThriftFieldId() {
|
||||
return _thriftId;
|
||||
}
|
||||
|
||||
public String getFieldName() {
|
||||
return _fieldName;
|
||||
}
|
||||
}
|
||||
|
||||
// isset id assignments
|
||||
private _Fields optionals[] = {_Fields.RESULT};
|
||||
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, TS_Status.class)));
|
||||
tmpMap.put(_Fields.RESULT, new org.apache.thrift.meta_data.FieldMetaData("result", 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.I32))));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSExecuteBatchStatementResp.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSExecuteBatchStatementResp() {
|
||||
}
|
||||
|
||||
public TSExecuteBatchStatementResp(
|
||||
TS_Status status)
|
||||
{
|
||||
this();
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSExecuteBatchStatementResp(TSExecuteBatchStatementResp other) {
|
||||
if (other.isSetStatus()) {
|
||||
this.status = new TS_Status(other.status);
|
||||
}
|
||||
if (other.isSetResult()) {
|
||||
List<Integer> __this__result = new ArrayList<Integer>(other.result);
|
||||
this.result = __this__result;
|
||||
}
|
||||
}
|
||||
|
||||
public TSExecuteBatchStatementResp deepCopy() {
|
||||
return new TSExecuteBatchStatementResp(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.status = null;
|
||||
this.result = null;
|
||||
}
|
||||
|
||||
public TS_Status getStatus() {
|
||||
return this.status;
|
||||
}
|
||||
|
||||
public TSExecuteBatchStatementResp setStatus(TS_Status status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
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 int getResultSize() {
|
||||
return (this.result == null) ? 0 : this.result.size();
|
||||
}
|
||||
|
||||
public java.util.Iterator<Integer> getResultIterator() {
|
||||
return (this.result == null) ? null : this.result.iterator();
|
||||
}
|
||||
|
||||
public void addToResult(int elem) {
|
||||
if (this.result == null) {
|
||||
this.result = new ArrayList<Integer>();
|
||||
}
|
||||
this.result.add(elem);
|
||||
}
|
||||
|
||||
public List<Integer> getResult() {
|
||||
return this.result;
|
||||
}
|
||||
|
||||
public TSExecuteBatchStatementResp setResult(List<Integer> result) {
|
||||
this.result = result;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetResult() {
|
||||
this.result = null;
|
||||
}
|
||||
|
||||
/** Returns true if field result is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetResult() {
|
||||
return this.result != null;
|
||||
}
|
||||
|
||||
public void setResultIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.result = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case STATUS:
|
||||
if (value == null) {
|
||||
unsetStatus();
|
||||
} else {
|
||||
setStatus((TS_Status)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case RESULT:
|
||||
if (value == null) {
|
||||
unsetResult();
|
||||
} else {
|
||||
setResult((List<Integer>)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case STATUS:
|
||||
return getStatus();
|
||||
|
||||
case RESULT:
|
||||
return getResult();
|
||||
|
||||
}
|
||||
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 RESULT:
|
||||
return isSetResult();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof TSExecuteBatchStatementResp)
|
||||
return this.equals((TSExecuteBatchStatementResp)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSExecuteBatchStatementResp 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_result = true && this.isSetResult();
|
||||
boolean that_present_result = true && that.isSetResult();
|
||||
if (this_present_result || that_present_result) {
|
||||
if (!(this_present_result && that_present_result))
|
||||
return false;
|
||||
if (!this.result.equals(that.result))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSExecuteBatchStatementResp 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(isSetResult()).compareTo(other.isSetResult());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetResult()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.result, other.result);
|
||||
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("TSExecuteBatchStatementResp(");
|
||||
boolean first = true;
|
||||
|
||||
sb.append("status:");
|
||||
if (this.status == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.status);
|
||||
}
|
||||
first = false;
|
||||
if (isSetResult()) {
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("result:");
|
||||
if (this.result == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.result);
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
if (status == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' was not present! 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 TSExecuteBatchStatementRespStandardSchemeFactory implements SchemeFactory {
|
||||
public TSExecuteBatchStatementRespStandardScheme getScheme() {
|
||||
return new TSExecuteBatchStatementRespStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSExecuteBatchStatementRespStandardScheme extends StandardScheme<TSExecuteBatchStatementResp> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSExecuteBatchStatementResp struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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 TS_Status();
|
||||
struct.status.read(iprot);
|
||||
struct.setStatusIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 2: // RESULT
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list36 = iprot.readListBegin();
|
||||
struct.result = new ArrayList<Integer>(_list36.size);
|
||||
for (int _i37 = 0; _i37 < _list36.size; ++_i37)
|
||||
{
|
||||
int _elem38;
|
||||
_elem38 = iprot.readI32();
|
||||
struct.result.add(_elem38);
|
||||
}
|
||||
iprot.readListEnd();
|
||||
}
|
||||
struct.setResultIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSExecuteBatchStatementResp 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.result != null) {
|
||||
if (struct.isSetResult()) {
|
||||
oprot.writeFieldBegin(RESULT_FIELD_DESC);
|
||||
{
|
||||
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.result.size()));
|
||||
for (int _iter39 : struct.result)
|
||||
{
|
||||
oprot.writeI32(_iter39);
|
||||
}
|
||||
oprot.writeListEnd();
|
||||
}
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class TSExecuteBatchStatementRespTupleSchemeFactory implements SchemeFactory {
|
||||
public TSExecuteBatchStatementRespTupleScheme getScheme() {
|
||||
return new TSExecuteBatchStatementRespTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSExecuteBatchStatementRespTupleScheme extends TupleScheme<TSExecuteBatchStatementResp> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSExecuteBatchStatementResp struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
struct.status.write(oprot);
|
||||
BitSet optionals = new BitSet();
|
||||
if (struct.isSetResult()) {
|
||||
optionals.set(0);
|
||||
}
|
||||
oprot.writeBitSet(optionals, 1);
|
||||
if (struct.isSetResult()) {
|
||||
{
|
||||
oprot.writeI32(struct.result.size());
|
||||
for (int _iter40 : struct.result)
|
||||
{
|
||||
oprot.writeI32(_iter40);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSExecuteBatchStatementResp struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.status = new TS_Status();
|
||||
struct.status.read(iprot);
|
||||
struct.setStatusIsSet(true);
|
||||
BitSet incoming = iprot.readBitSet(1);
|
||||
if (incoming.get(0)) {
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list41 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32());
|
||||
struct.result = new ArrayList<Integer>(_list41.size);
|
||||
for (int _i42 = 0; _i42 < _list41.size; ++_i42)
|
||||
{
|
||||
int _elem43;
|
||||
_elem43 = iprot.readI32();
|
||||
struct.result.add(_elem43);
|
||||
}
|
||||
}
|
||||
struct.setResultIsSet(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,482 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSExecuteStatementReq implements org.apache.thrift.TBase<TSExecuteStatementReq, TSExecuteStatementReq._Fields>, java.io.Serializable, Cloneable, Comparable<TSExecuteStatementReq> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSExecuteStatementReq");
|
||||
|
||||
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 Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSExecuteStatementReqStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSExecuteStatementReqTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public TS_SessionHandle sessionHandle; // required
|
||||
public String statement; // required
|
||||
|
||||
/** 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");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches 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, TS_SessionHandle.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)));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSExecuteStatementReq.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSExecuteStatementReq() {
|
||||
}
|
||||
|
||||
public TSExecuteStatementReq(
|
||||
TS_SessionHandle sessionHandle,
|
||||
String statement)
|
||||
{
|
||||
this();
|
||||
this.sessionHandle = sessionHandle;
|
||||
this.statement = statement;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSExecuteStatementReq(TSExecuteStatementReq other) {
|
||||
if (other.isSetSessionHandle()) {
|
||||
this.sessionHandle = new TS_SessionHandle(other.sessionHandle);
|
||||
}
|
||||
if (other.isSetStatement()) {
|
||||
this.statement = other.statement;
|
||||
}
|
||||
}
|
||||
|
||||
public TSExecuteStatementReq deepCopy() {
|
||||
return new TSExecuteStatementReq(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.sessionHandle = null;
|
||||
this.statement = null;
|
||||
}
|
||||
|
||||
public TS_SessionHandle getSessionHandle() {
|
||||
return this.sessionHandle;
|
||||
}
|
||||
|
||||
public TSExecuteStatementReq setSessionHandle(TS_SessionHandle sessionHandle) {
|
||||
this.sessionHandle = sessionHandle;
|
||||
return this;
|
||||
}
|
||||
|
||||
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 TSExecuteStatementReq setStatement(String statement) {
|
||||
this.statement = statement;
|
||||
return this;
|
||||
}
|
||||
|
||||
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 void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case SESSION_HANDLE:
|
||||
if (value == null) {
|
||||
unsetSessionHandle();
|
||||
} else {
|
||||
setSessionHandle((TS_SessionHandle)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case STATEMENT:
|
||||
if (value == null) {
|
||||
unsetStatement();
|
||||
} else {
|
||||
setStatement((String)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case SESSION_HANDLE:
|
||||
return getSessionHandle();
|
||||
|
||||
case STATEMENT:
|
||||
return getStatement();
|
||||
|
||||
}
|
||||
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();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof TSExecuteStatementReq)
|
||||
return this.equals((TSExecuteStatementReq)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSExecuteStatementReq 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;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSExecuteStatementReq 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;
|
||||
}
|
||||
}
|
||||
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("TSExecuteStatementReq(");
|
||||
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;
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
if (sessionHandle == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' was not present! Struct: " + toString());
|
||||
}
|
||||
if (statement == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'statement' was not present! 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 TSExecuteStatementReqStandardSchemeFactory implements SchemeFactory {
|
||||
public TSExecuteStatementReqStandardScheme getScheme() {
|
||||
return new TSExecuteStatementReqStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSExecuteStatementReqStandardScheme extends StandardScheme<TSExecuteStatementReq> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSExecuteStatementReq struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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 TS_SessionHandle();
|
||||
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;
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSExecuteStatementReq 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();
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class TSExecuteStatementReqTupleSchemeFactory implements SchemeFactory {
|
||||
public TSExecuteStatementReqTupleScheme getScheme() {
|
||||
return new TSExecuteStatementReqTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSExecuteStatementReqTupleScheme extends TupleScheme<TSExecuteStatementReq> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSExecuteStatementReq struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
struct.sessionHandle.write(oprot);
|
||||
oprot.writeString(struct.statement);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSExecuteStatementReq struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.sessionHandle = new TS_SessionHandle();
|
||||
struct.sessionHandle.read(iprot);
|
||||
struct.setSessionHandleIsSet(true);
|
||||
struct.statement = iprot.readString();
|
||||
struct.setStatementIsSet(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,750 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSExecuteStatementResp implements org.apache.thrift.TBase<TSExecuteStatementResp, TSExecuteStatementResp._Fields>, java.io.Serializable, Cloneable, Comparable<TSExecuteStatementResp> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSExecuteStatementResp");
|
||||
|
||||
private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1);
|
||||
private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2);
|
||||
private static final org.apache.thrift.protocol.TField 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 OPERATION_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationType", org.apache.thrift.protocol.TType.STRING, (short)4);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSExecuteStatementRespStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSExecuteStatementRespTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public TS_Status status; // required
|
||||
public TSOperationHandle operationHandle; // optional
|
||||
public List<String> columns; // optional
|
||||
public String operationType; // 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"),
|
||||
COLUMNS((short)3, "columns"),
|
||||
OPERATION_TYPE((short)4, "operationType");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
static {
|
||||
for (_Fields field : EnumSet.allOf(_Fields.class)) {
|
||||
byName.put(field.getFieldName(), field);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches fieldId, or null if its not found.
|
||||
*/
|
||||
public static _Fields findByThriftId(int fieldId) {
|
||||
switch(fieldId) {
|
||||
case 1: // STATUS
|
||||
return STATUS;
|
||||
case 2: // OPERATION_HANDLE
|
||||
return OPERATION_HANDLE;
|
||||
case 3: // COLUMNS
|
||||
return COLUMNS;
|
||||
case 4: // OPERATION_TYPE
|
||||
return OPERATION_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 _Fields optionals[] = {_Fields.OPERATION_HANDLE,_Fields.COLUMNS,_Fields.OPERATION_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.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, TS_Status.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, TSOperationHandle.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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
|
||||
tmpMap.put(_Fields.OPERATION_TYPE, new org.apache.thrift.meta_data.FieldMetaData("operationType", 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(TSExecuteStatementResp.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSExecuteStatementResp() {
|
||||
}
|
||||
|
||||
public TSExecuteStatementResp(
|
||||
TS_Status status)
|
||||
{
|
||||
this();
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSExecuteStatementResp(TSExecuteStatementResp other) {
|
||||
if (other.isSetStatus()) {
|
||||
this.status = new TS_Status(other.status);
|
||||
}
|
||||
if (other.isSetOperationHandle()) {
|
||||
this.operationHandle = new TSOperationHandle(other.operationHandle);
|
||||
}
|
||||
if (other.isSetColumns()) {
|
||||
List<String> __this__columns = new ArrayList<String>(other.columns);
|
||||
this.columns = __this__columns;
|
||||
}
|
||||
if (other.isSetOperationType()) {
|
||||
this.operationType = other.operationType;
|
||||
}
|
||||
}
|
||||
|
||||
public TSExecuteStatementResp deepCopy() {
|
||||
return new TSExecuteStatementResp(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.status = null;
|
||||
this.operationHandle = null;
|
||||
this.columns = null;
|
||||
this.operationType = null;
|
||||
}
|
||||
|
||||
public TS_Status getStatus() {
|
||||
return this.status;
|
||||
}
|
||||
|
||||
public TSExecuteStatementResp setStatus(TS_Status status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
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 TSOperationHandle getOperationHandle() {
|
||||
return this.operationHandle;
|
||||
}
|
||||
|
||||
public TSExecuteStatementResp setOperationHandle(TSOperationHandle operationHandle) {
|
||||
this.operationHandle = operationHandle;
|
||||
return this;
|
||||
}
|
||||
|
||||
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 int getColumnsSize() {
|
||||
return (this.columns == null) ? 0 : this.columns.size();
|
||||
}
|
||||
|
||||
public java.util.Iterator<String> getColumnsIterator() {
|
||||
return (this.columns == null) ? null : this.columns.iterator();
|
||||
}
|
||||
|
||||
public void addToColumns(String elem) {
|
||||
if (this.columns == null) {
|
||||
this.columns = new ArrayList<String>();
|
||||
}
|
||||
this.columns.add(elem);
|
||||
}
|
||||
|
||||
public List<String> getColumns() {
|
||||
return this.columns;
|
||||
}
|
||||
|
||||
public TSExecuteStatementResp setColumns(List<String> columns) {
|
||||
this.columns = columns;
|
||||
return this;
|
||||
}
|
||||
|
||||
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 String getOperationType() {
|
||||
return this.operationType;
|
||||
}
|
||||
|
||||
public TSExecuteStatementResp setOperationType(String operationType) {
|
||||
this.operationType = operationType;
|
||||
return this;
|
||||
}
|
||||
|
||||
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 void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case STATUS:
|
||||
if (value == null) {
|
||||
unsetStatus();
|
||||
} else {
|
||||
setStatus((TS_Status)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case OPERATION_HANDLE:
|
||||
if (value == null) {
|
||||
unsetOperationHandle();
|
||||
} else {
|
||||
setOperationHandle((TSOperationHandle)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case COLUMNS:
|
||||
if (value == null) {
|
||||
unsetColumns();
|
||||
} else {
|
||||
setColumns((List<String>)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case OPERATION_TYPE:
|
||||
if (value == null) {
|
||||
unsetOperationType();
|
||||
} else {
|
||||
setOperationType((String)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case STATUS:
|
||||
return getStatus();
|
||||
|
||||
case OPERATION_HANDLE:
|
||||
return getOperationHandle();
|
||||
|
||||
case COLUMNS:
|
||||
return getColumns();
|
||||
|
||||
case OPERATION_TYPE:
|
||||
return getOperationType();
|
||||
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSet(_Fields field) {
|
||||
if (field == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
switch (field) {
|
||||
case STATUS:
|
||||
return isSetStatus();
|
||||
case OPERATION_HANDLE:
|
||||
return isSetOperationHandle();
|
||||
case COLUMNS:
|
||||
return isSetColumns();
|
||||
case OPERATION_TYPE:
|
||||
return isSetOperationType();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof TSExecuteStatementResp)
|
||||
return this.equals((TSExecuteStatementResp)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSExecuteStatementResp that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
|
||||
boolean this_present_status = true && this.isSetStatus();
|
||||
boolean that_present_status = true && that.isSetStatus();
|
||||
if (this_present_status || that_present_status) {
|
||||
if (!(this_present_status && that_present_status))
|
||||
return false;
|
||||
if (!this.status.equals(that.status))
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_operationHandle = true && this.isSetOperationHandle();
|
||||
boolean that_present_operationHandle = true && that.isSetOperationHandle();
|
||||
if (this_present_operationHandle || that_present_operationHandle) {
|
||||
if (!(this_present_operationHandle && that_present_operationHandle))
|
||||
return false;
|
||||
if (!this.operationHandle.equals(that.operationHandle))
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_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_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;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSExecuteStatementResp 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;
|
||||
}
|
||||
}
|
||||
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(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;
|
||||
}
|
||||
}
|
||||
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("TSExecuteStatementResp(");
|
||||
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;
|
||||
}
|
||||
if (isSetColumns()) {
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("columns:");
|
||||
if (this.columns == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.columns);
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
if (isSetOperationType()) {
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("operationType:");
|
||||
if (this.operationType == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.operationType);
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
if (status == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' was not present! 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 TSExecuteStatementRespStandardSchemeFactory implements SchemeFactory {
|
||||
public TSExecuteStatementRespStandardScheme getScheme() {
|
||||
return new TSExecuteStatementRespStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSExecuteStatementRespStandardScheme extends StandardScheme<TSExecuteStatementResp> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSExecuteStatementResp struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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 TS_Status();
|
||||
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 TSOperationHandle();
|
||||
struct.operationHandle.read(iprot);
|
||||
struct.setOperationHandleIsSet(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 _list8 = iprot.readListBegin();
|
||||
struct.columns = new ArrayList<String>(_list8.size);
|
||||
for (int _i9 = 0; _i9 < _list8.size; ++_i9)
|
||||
{
|
||||
String _elem10;
|
||||
_elem10 = iprot.readString();
|
||||
struct.columns.add(_elem10);
|
||||
}
|
||||
iprot.readListEnd();
|
||||
}
|
||||
struct.setColumnsIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 4: // OPERATION_TYPE
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
struct.operationType = iprot.readString();
|
||||
struct.setOperationTypeIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSExecuteStatementResp 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();
|
||||
}
|
||||
}
|
||||
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.STRING, struct.columns.size()));
|
||||
for (String _iter11 : struct.columns)
|
||||
{
|
||||
oprot.writeString(_iter11);
|
||||
}
|
||||
oprot.writeListEnd();
|
||||
}
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
if (struct.operationType != null) {
|
||||
if (struct.isSetOperationType()) {
|
||||
oprot.writeFieldBegin(OPERATION_TYPE_FIELD_DESC);
|
||||
oprot.writeString(struct.operationType);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class TSExecuteStatementRespTupleSchemeFactory implements SchemeFactory {
|
||||
public TSExecuteStatementRespTupleScheme getScheme() {
|
||||
return new TSExecuteStatementRespTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSExecuteStatementRespTupleScheme extends TupleScheme<TSExecuteStatementResp> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSExecuteStatementResp struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
struct.status.write(oprot);
|
||||
BitSet optionals = new BitSet();
|
||||
if (struct.isSetOperationHandle()) {
|
||||
optionals.set(0);
|
||||
}
|
||||
if (struct.isSetColumns()) {
|
||||
optionals.set(1);
|
||||
}
|
||||
if (struct.isSetOperationType()) {
|
||||
optionals.set(2);
|
||||
}
|
||||
oprot.writeBitSet(optionals, 3);
|
||||
if (struct.isSetOperationHandle()) {
|
||||
struct.operationHandle.write(oprot);
|
||||
}
|
||||
if (struct.isSetColumns()) {
|
||||
{
|
||||
oprot.writeI32(struct.columns.size());
|
||||
for (String _iter12 : struct.columns)
|
||||
{
|
||||
oprot.writeString(_iter12);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (struct.isSetOperationType()) {
|
||||
oprot.writeString(struct.operationType);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSExecuteStatementResp struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.status = new TS_Status();
|
||||
struct.status.read(iprot);
|
||||
struct.setStatusIsSet(true);
|
||||
BitSet incoming = iprot.readBitSet(3);
|
||||
if (incoming.get(0)) {
|
||||
struct.operationHandle = new TSOperationHandle();
|
||||
struct.operationHandle.read(iprot);
|
||||
struct.setOperationHandleIsSet(true);
|
||||
}
|
||||
if (incoming.get(1)) {
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
|
||||
struct.columns = new ArrayList<String>(_list13.size);
|
||||
for (int _i14 = 0; _i14 < _list13.size; ++_i14)
|
||||
{
|
||||
String _elem15;
|
||||
_elem15 = iprot.readString();
|
||||
struct.columns.add(_elem15);
|
||||
}
|
||||
}
|
||||
struct.setColumnsIsSet(true);
|
||||
}
|
||||
if (incoming.get(2)) {
|
||||
struct.operationType = iprot.readString();
|
||||
struct.setOperationTypeIsSet(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,487 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSFetchMetadataReq implements org.apache.thrift.TBase<TSFetchMetadataReq, TSFetchMetadataReq._Fields>, java.io.Serializable, Cloneable, Comparable<TSFetchMetadataReq> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSFetchMetadataReq");
|
||||
|
||||
private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.STRING, (short)1);
|
||||
private static final org.apache.thrift.protocol.TField COLUMN_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("columnPath", org.apache.thrift.protocol.TType.STRING, (short)2);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSFetchMetadataReqStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSFetchMetadataReqTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public String type; // required
|
||||
public String columnPath; // 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 {
|
||||
TYPE((short)1, "type"),
|
||||
COLUMN_PATH((short)2, "columnPath");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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: // COLUMN_PATH
|
||||
return COLUMN_PATH;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches fieldId, throwing an exception
|
||||
* if it is not found.
|
||||
*/
|
||||
public static _Fields findByThriftIdOrThrow(int fieldId) {
|
||||
_Fields fields = findByThriftId(fieldId);
|
||||
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
|
||||
return fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches name, or null if its not found.
|
||||
*/
|
||||
public static _Fields findByName(String name) {
|
||||
return byName.get(name);
|
||||
}
|
||||
|
||||
private final short _thriftId;
|
||||
private final String _fieldName;
|
||||
|
||||
_Fields(short thriftId, String fieldName) {
|
||||
_thriftId = thriftId;
|
||||
_fieldName = fieldName;
|
||||
}
|
||||
|
||||
public short getThriftFieldId() {
|
||||
return _thriftId;
|
||||
}
|
||||
|
||||
public String getFieldName() {
|
||||
return _fieldName;
|
||||
}
|
||||
}
|
||||
|
||||
// isset id assignments
|
||||
private _Fields optionals[] = {_Fields.COLUMN_PATH};
|
||||
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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
|
||||
tmpMap.put(_Fields.COLUMN_PATH, new org.apache.thrift.meta_data.FieldMetaData("columnPath", 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(TSFetchMetadataReq.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSFetchMetadataReq() {
|
||||
}
|
||||
|
||||
public TSFetchMetadataReq(
|
||||
String type)
|
||||
{
|
||||
this();
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSFetchMetadataReq(TSFetchMetadataReq other) {
|
||||
if (other.isSetType()) {
|
||||
this.type = other.type;
|
||||
}
|
||||
if (other.isSetColumnPath()) {
|
||||
this.columnPath = other.columnPath;
|
||||
}
|
||||
}
|
||||
|
||||
public TSFetchMetadataReq deepCopy() {
|
||||
return new TSFetchMetadataReq(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.type = null;
|
||||
this.columnPath = null;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public TSFetchMetadataReq setType(String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
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 String getColumnPath() {
|
||||
return this.columnPath;
|
||||
}
|
||||
|
||||
public TSFetchMetadataReq setColumnPath(String columnPath) {
|
||||
this.columnPath = columnPath;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetColumnPath() {
|
||||
this.columnPath = null;
|
||||
}
|
||||
|
||||
/** Returns true if field columnPath is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetColumnPath() {
|
||||
return this.columnPath != null;
|
||||
}
|
||||
|
||||
public void setColumnPathIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.columnPath = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case TYPE:
|
||||
if (value == null) {
|
||||
unsetType();
|
||||
} else {
|
||||
setType((String)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case COLUMN_PATH:
|
||||
if (value == null) {
|
||||
unsetColumnPath();
|
||||
} else {
|
||||
setColumnPath((String)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case TYPE:
|
||||
return getType();
|
||||
|
||||
case COLUMN_PATH:
|
||||
return getColumnPath();
|
||||
|
||||
}
|
||||
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 COLUMN_PATH:
|
||||
return isSetColumnPath();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof TSFetchMetadataReq)
|
||||
return this.equals((TSFetchMetadataReq)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSFetchMetadataReq 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_columnPath = true && this.isSetColumnPath();
|
||||
boolean that_present_columnPath = true && that.isSetColumnPath();
|
||||
if (this_present_columnPath || that_present_columnPath) {
|
||||
if (!(this_present_columnPath && that_present_columnPath))
|
||||
return false;
|
||||
if (!this.columnPath.equals(that.columnPath))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSFetchMetadataReq 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(isSetColumnPath()).compareTo(other.isSetColumnPath());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetColumnPath()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnPath, other.columnPath);
|
||||
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("TSFetchMetadataReq(");
|
||||
boolean first = true;
|
||||
|
||||
sb.append("type:");
|
||||
if (this.type == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.type);
|
||||
}
|
||||
first = false;
|
||||
if (isSetColumnPath()) {
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("columnPath:");
|
||||
if (this.columnPath == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.columnPath);
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
if (type == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'type' was not present! 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 TSFetchMetadataReqStandardSchemeFactory implements SchemeFactory {
|
||||
public TSFetchMetadataReqStandardScheme getScheme() {
|
||||
return new TSFetchMetadataReqStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSFetchMetadataReqStandardScheme extends StandardScheme<TSFetchMetadataReq> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSFetchMetadataReq struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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.STRING) {
|
||||
struct.type = iprot.readString();
|
||||
struct.setTypeIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 2: // COLUMN_PATH
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
struct.columnPath = iprot.readString();
|
||||
struct.setColumnPathIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSFetchMetadataReq struct) throws org.apache.thrift.TException {
|
||||
struct.validate();
|
||||
|
||||
oprot.writeStructBegin(STRUCT_DESC);
|
||||
if (struct.type != null) {
|
||||
oprot.writeFieldBegin(TYPE_FIELD_DESC);
|
||||
oprot.writeString(struct.type);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
if (struct.columnPath != null) {
|
||||
if (struct.isSetColumnPath()) {
|
||||
oprot.writeFieldBegin(COLUMN_PATH_FIELD_DESC);
|
||||
oprot.writeString(struct.columnPath);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class TSFetchMetadataReqTupleSchemeFactory implements SchemeFactory {
|
||||
public TSFetchMetadataReqTupleScheme getScheme() {
|
||||
return new TSFetchMetadataReqTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSFetchMetadataReqTupleScheme extends TupleScheme<TSFetchMetadataReq> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSFetchMetadataReq struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
oprot.writeString(struct.type);
|
||||
BitSet optionals = new BitSet();
|
||||
if (struct.isSetColumnPath()) {
|
||||
optionals.set(0);
|
||||
}
|
||||
oprot.writeBitSet(optionals, 1);
|
||||
if (struct.isSetColumnPath()) {
|
||||
oprot.writeString(struct.columnPath);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSFetchMetadataReq struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.type = iprot.readString();
|
||||
struct.setTypeIsSet(true);
|
||||
BitSet incoming = iprot.readBitSet(1);
|
||||
if (incoming.get(0)) {
|
||||
struct.columnPath = iprot.readString();
|
||||
struct.setColumnPathIsSet(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1,476 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSFetchResultsReq implements org.apache.thrift.TBase<TSFetchResultsReq, TSFetchResultsReq._Fields>, java.io.Serializable, Cloneable, Comparable<TSFetchResultsReq> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSFetchResultsReq");
|
||||
|
||||
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)1);
|
||||
private static final org.apache.thrift.protocol.TField FETCH_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("fetch_size", org.apache.thrift.protocol.TType.I32, (short)2);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSFetchResultsReqStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSFetchResultsReqTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public String statement; // required
|
||||
public int fetch_size; // required
|
||||
|
||||
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
|
||||
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
|
||||
STATEMENT((short)1, "statement"),
|
||||
FETCH_SIZE((short)2, "fetch_size");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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: // STATEMENT
|
||||
return STATEMENT;
|
||||
case 2: // FETCH_SIZE
|
||||
return FETCH_SIZE;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches 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 __FETCH_SIZE_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.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.FETCH_SIZE, new org.apache.thrift.meta_data.FieldMetaData("fetch_size", org.apache.thrift.TFieldRequirementType.REQUIRED,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSFetchResultsReq.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSFetchResultsReq() {
|
||||
}
|
||||
|
||||
public TSFetchResultsReq(
|
||||
String statement,
|
||||
int fetch_size)
|
||||
{
|
||||
this();
|
||||
this.statement = statement;
|
||||
this.fetch_size = fetch_size;
|
||||
setFetch_sizeIsSet(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSFetchResultsReq(TSFetchResultsReq other) {
|
||||
__isset_bitfield = other.__isset_bitfield;
|
||||
if (other.isSetStatement()) {
|
||||
this.statement = other.statement;
|
||||
}
|
||||
this.fetch_size = other.fetch_size;
|
||||
}
|
||||
|
||||
public TSFetchResultsReq deepCopy() {
|
||||
return new TSFetchResultsReq(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.statement = null;
|
||||
setFetch_sizeIsSet(false);
|
||||
this.fetch_size = 0;
|
||||
}
|
||||
|
||||
public String getStatement() {
|
||||
return this.statement;
|
||||
}
|
||||
|
||||
public TSFetchResultsReq setStatement(String statement) {
|
||||
this.statement = statement;
|
||||
return this;
|
||||
}
|
||||
|
||||
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 getFetch_size() {
|
||||
return this.fetch_size;
|
||||
}
|
||||
|
||||
public TSFetchResultsReq setFetch_size(int fetch_size) {
|
||||
this.fetch_size = fetch_size;
|
||||
setFetch_sizeIsSet(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetFetch_size() {
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FETCH_SIZE_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field fetch_size is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetFetch_size() {
|
||||
return EncodingUtils.testBit(__isset_bitfield, __FETCH_SIZE_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setFetch_sizeIsSet(boolean value) {
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FETCH_SIZE_ISSET_ID, value);
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case STATEMENT:
|
||||
if (value == null) {
|
||||
unsetStatement();
|
||||
} else {
|
||||
setStatement((String)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case FETCH_SIZE:
|
||||
if (value == null) {
|
||||
unsetFetch_size();
|
||||
} else {
|
||||
setFetch_size((Integer)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case STATEMENT:
|
||||
return getStatement();
|
||||
|
||||
case FETCH_SIZE:
|
||||
return Integer.valueOf(getFetch_size());
|
||||
|
||||
}
|
||||
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 STATEMENT:
|
||||
return isSetStatement();
|
||||
case FETCH_SIZE:
|
||||
return isSetFetch_size();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof TSFetchResultsReq)
|
||||
return this.equals((TSFetchResultsReq)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSFetchResultsReq that) {
|
||||
if (that == null)
|
||||
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_fetch_size = true;
|
||||
boolean that_present_fetch_size = true;
|
||||
if (this_present_fetch_size || that_present_fetch_size) {
|
||||
if (!(this_present_fetch_size && that_present_fetch_size))
|
||||
return false;
|
||||
if (this.fetch_size != that.fetch_size)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSFetchResultsReq other) {
|
||||
if (!getClass().equals(other.getClass())) {
|
||||
return getClass().getName().compareTo(other.getClass().getName());
|
||||
}
|
||||
|
||||
int lastComparison = 0;
|
||||
|
||||
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(isSetFetch_size()).compareTo(other.isSetFetch_size());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetFetch_size()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fetch_size, other.fetch_size);
|
||||
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("TSFetchResultsReq(");
|
||||
boolean first = true;
|
||||
|
||||
sb.append("statement:");
|
||||
if (this.statement == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.statement);
|
||||
}
|
||||
first = false;
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("fetch_size:");
|
||||
sb.append(this.fetch_size);
|
||||
first = false;
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
if (statement == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'statement' was not present! Struct: " + toString());
|
||||
}
|
||||
// alas, we cannot check 'fetch_size' because it's a primitive and you chose the non-beans generator.
|
||||
// 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 TSFetchResultsReqStandardSchemeFactory implements SchemeFactory {
|
||||
public TSFetchResultsReqStandardScheme getScheme() {
|
||||
return new TSFetchResultsReqStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSFetchResultsReqStandardScheme extends StandardScheme<TSFetchResultsReq> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSFetchResultsReq struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.TField schemeField;
|
||||
iprot.readStructBegin();
|
||||
while (true)
|
||||
{
|
||||
schemeField = iprot.readFieldBegin();
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
|
||||
break;
|
||||
}
|
||||
switch (schemeField.id) {
|
||||
case 1: // 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 2: // FETCH_SIZE
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
|
||||
struct.fetch_size = iprot.readI32();
|
||||
struct.setFetch_sizeIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
if (!struct.isSetFetch_size()) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'fetch_size' was not found in serialized data! Struct: " + toString());
|
||||
}
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSFetchResultsReq struct) throws org.apache.thrift.TException {
|
||||
struct.validate();
|
||||
|
||||
oprot.writeStructBegin(STRUCT_DESC);
|
||||
if (struct.statement != null) {
|
||||
oprot.writeFieldBegin(STATEMENT_FIELD_DESC);
|
||||
oprot.writeString(struct.statement);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldBegin(FETCH_SIZE_FIELD_DESC);
|
||||
oprot.writeI32(struct.fetch_size);
|
||||
oprot.writeFieldEnd();
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class TSFetchResultsReqTupleSchemeFactory implements SchemeFactory {
|
||||
public TSFetchResultsReqTupleScheme getScheme() {
|
||||
return new TSFetchResultsReqTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSFetchResultsReqTupleScheme extends TupleScheme<TSFetchResultsReq> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSFetchResultsReq struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
oprot.writeString(struct.statement);
|
||||
oprot.writeI32(struct.fetch_size);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSFetchResultsReq struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.statement = iprot.readString();
|
||||
struct.setStatementIsSet(true);
|
||||
struct.fetch_size = iprot.readI32();
|
||||
struct.setFetch_sizeIsSet(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,592 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSFetchResultsResp implements org.apache.thrift.TBase<TSFetchResultsResp, TSFetchResultsResp._Fields>, java.io.Serializable, Cloneable, Comparable<TSFetchResultsResp> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSFetchResultsResp");
|
||||
|
||||
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_RESULT_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("hasResultSet", org.apache.thrift.protocol.TType.BOOL, (short)2);
|
||||
private static final org.apache.thrift.protocol.TField QUERY_DATA_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("queryDataSet", org.apache.thrift.protocol.TType.STRUCT, (short)3);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSFetchResultsRespStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSFetchResultsRespTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public TS_Status status; // required
|
||||
public boolean hasResultSet; // required
|
||||
public TSQueryDataSet queryDataSet; // 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_RESULT_SET((short)2, "hasResultSet"),
|
||||
QUERY_DATA_SET((short)3, "queryDataSet");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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_RESULT_SET
|
||||
return HAS_RESULT_SET;
|
||||
case 3: // QUERY_DATA_SET
|
||||
return QUERY_DATA_SET;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches 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 byte __isset_bitfield = 0;
|
||||
private _Fields optionals[] = {_Fields.QUERY_DATA_SET};
|
||||
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, TS_Status.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.QUERY_DATA_SET, new org.apache.thrift.meta_data.FieldMetaData("queryDataSet", org.apache.thrift.TFieldRequirementType.OPTIONAL,
|
||||
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSQueryDataSet.class)));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSFetchResultsResp.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSFetchResultsResp() {
|
||||
}
|
||||
|
||||
public TSFetchResultsResp(
|
||||
TS_Status status,
|
||||
boolean hasResultSet)
|
||||
{
|
||||
this();
|
||||
this.status = status;
|
||||
this.hasResultSet = hasResultSet;
|
||||
setHasResultSetIsSet(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSFetchResultsResp(TSFetchResultsResp other) {
|
||||
__isset_bitfield = other.__isset_bitfield;
|
||||
if (other.isSetStatus()) {
|
||||
this.status = new TS_Status(other.status);
|
||||
}
|
||||
this.hasResultSet = other.hasResultSet;
|
||||
if (other.isSetQueryDataSet()) {
|
||||
this.queryDataSet = new TSQueryDataSet(other.queryDataSet);
|
||||
}
|
||||
}
|
||||
|
||||
public TSFetchResultsResp deepCopy() {
|
||||
return new TSFetchResultsResp(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.status = null;
|
||||
setHasResultSetIsSet(false);
|
||||
this.hasResultSet = false;
|
||||
this.queryDataSet = null;
|
||||
}
|
||||
|
||||
public TS_Status getStatus() {
|
||||
return this.status;
|
||||
}
|
||||
|
||||
public TSFetchResultsResp setStatus(TS_Status status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
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 isHasResultSet() {
|
||||
return this.hasResultSet;
|
||||
}
|
||||
|
||||
public TSFetchResultsResp setHasResultSet(boolean hasResultSet) {
|
||||
this.hasResultSet = hasResultSet;
|
||||
setHasResultSetIsSet(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
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 TSQueryDataSet getQueryDataSet() {
|
||||
return this.queryDataSet;
|
||||
}
|
||||
|
||||
public TSFetchResultsResp setQueryDataSet(TSQueryDataSet queryDataSet) {
|
||||
this.queryDataSet = queryDataSet;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetQueryDataSet() {
|
||||
this.queryDataSet = null;
|
||||
}
|
||||
|
||||
/** Returns true if field queryDataSet is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetQueryDataSet() {
|
||||
return this.queryDataSet != null;
|
||||
}
|
||||
|
||||
public void setQueryDataSetIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.queryDataSet = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case STATUS:
|
||||
if (value == null) {
|
||||
unsetStatus();
|
||||
} else {
|
||||
setStatus((TS_Status)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case HAS_RESULT_SET:
|
||||
if (value == null) {
|
||||
unsetHasResultSet();
|
||||
} else {
|
||||
setHasResultSet((Boolean)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case QUERY_DATA_SET:
|
||||
if (value == null) {
|
||||
unsetQueryDataSet();
|
||||
} else {
|
||||
setQueryDataSet((TSQueryDataSet)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case STATUS:
|
||||
return getStatus();
|
||||
|
||||
case HAS_RESULT_SET:
|
||||
return Boolean.valueOf(isHasResultSet());
|
||||
|
||||
case QUERY_DATA_SET:
|
||||
return getQueryDataSet();
|
||||
|
||||
}
|
||||
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_RESULT_SET:
|
||||
return isSetHasResultSet();
|
||||
case QUERY_DATA_SET:
|
||||
return isSetQueryDataSet();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof TSFetchResultsResp)
|
||||
return this.equals((TSFetchResultsResp)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSFetchResultsResp 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_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_queryDataSet = true && this.isSetQueryDataSet();
|
||||
boolean that_present_queryDataSet = true && that.isSetQueryDataSet();
|
||||
if (this_present_queryDataSet || that_present_queryDataSet) {
|
||||
if (!(this_present_queryDataSet && that_present_queryDataSet))
|
||||
return false;
|
||||
if (!this.queryDataSet.equals(that.queryDataSet))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSFetchResultsResp 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(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(isSetQueryDataSet()).compareTo(other.isSetQueryDataSet());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetQueryDataSet()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryDataSet, other.queryDataSet);
|
||||
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("TSFetchResultsResp(");
|
||||
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("hasResultSet:");
|
||||
sb.append(this.hasResultSet);
|
||||
first = false;
|
||||
if (isSetQueryDataSet()) {
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("queryDataSet:");
|
||||
if (this.queryDataSet == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.queryDataSet);
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
if (status == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' was not present! Struct: " + toString());
|
||||
}
|
||||
// alas, we cannot check 'hasResultSet' because it's a primitive and you chose the non-beans generator.
|
||||
// check for sub-struct validity
|
||||
if (status != null) {
|
||||
status.validate();
|
||||
}
|
||||
if (queryDataSet != null) {
|
||||
queryDataSet.validate();
|
||||
}
|
||||
}
|
||||
|
||||
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
|
||||
try {
|
||||
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 TSFetchResultsRespStandardSchemeFactory implements SchemeFactory {
|
||||
public TSFetchResultsRespStandardScheme getScheme() {
|
||||
return new TSFetchResultsRespStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSFetchResultsRespStandardScheme extends StandardScheme<TSFetchResultsResp> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSFetchResultsResp struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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 TS_Status();
|
||||
struct.status.read(iprot);
|
||||
struct.setStatusIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 2: // 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 3: // QUERY_DATA_SET
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
|
||||
struct.queryDataSet = new TSQueryDataSet();
|
||||
struct.queryDataSet.read(iprot);
|
||||
struct.setQueryDataSetIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
if (!struct.isSetHasResultSet()) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'hasResultSet' was not found in serialized data! Struct: " + toString());
|
||||
}
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSFetchResultsResp 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.writeFieldBegin(HAS_RESULT_SET_FIELD_DESC);
|
||||
oprot.writeBool(struct.hasResultSet);
|
||||
oprot.writeFieldEnd();
|
||||
if (struct.queryDataSet != null) {
|
||||
if (struct.isSetQueryDataSet()) {
|
||||
oprot.writeFieldBegin(QUERY_DATA_SET_FIELD_DESC);
|
||||
struct.queryDataSet.write(oprot);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class TSFetchResultsRespTupleSchemeFactory implements SchemeFactory {
|
||||
public TSFetchResultsRespTupleScheme getScheme() {
|
||||
return new TSFetchResultsRespTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSFetchResultsRespTupleScheme extends TupleScheme<TSFetchResultsResp> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSFetchResultsResp struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
struct.status.write(oprot);
|
||||
oprot.writeBool(struct.hasResultSet);
|
||||
BitSet optionals = new BitSet();
|
||||
if (struct.isSetQueryDataSet()) {
|
||||
optionals.set(0);
|
||||
}
|
||||
oprot.writeBitSet(optionals, 1);
|
||||
if (struct.isSetQueryDataSet()) {
|
||||
struct.queryDataSet.write(oprot);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSFetchResultsResp struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.status = new TS_Status();
|
||||
struct.status.read(iprot);
|
||||
struct.setStatusIsSet(true);
|
||||
struct.hasResultSet = iprot.readBool();
|
||||
struct.setHasResultSetIsSet(true);
|
||||
BitSet incoming = iprot.readBitSet(1);
|
||||
if (incoming.get(0)) {
|
||||
struct.queryDataSet = new TSQueryDataSet();
|
||||
struct.queryDataSet.read(iprot);
|
||||
struct.setQueryDataSetIsSet(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,386 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSGetOperationStatusReq implements org.apache.thrift.TBase<TSGetOperationStatusReq, TSGetOperationStatusReq._Fields>, java.io.Serializable, Cloneable, Comparable<TSGetOperationStatusReq> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSGetOperationStatusReq");
|
||||
|
||||
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSGetOperationStatusReqStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSGetOperationStatusReqTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public TSOperationHandle 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<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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, TSOperationHandle.class)));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSGetOperationStatusReq.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSGetOperationStatusReq() {
|
||||
}
|
||||
|
||||
public TSGetOperationStatusReq(
|
||||
TSOperationHandle operationHandle)
|
||||
{
|
||||
this();
|
||||
this.operationHandle = operationHandle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSGetOperationStatusReq(TSGetOperationStatusReq other) {
|
||||
if (other.isSetOperationHandle()) {
|
||||
this.operationHandle = new TSOperationHandle(other.operationHandle);
|
||||
}
|
||||
}
|
||||
|
||||
public TSGetOperationStatusReq deepCopy() {
|
||||
return new TSGetOperationStatusReq(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.operationHandle = null;
|
||||
}
|
||||
|
||||
public TSOperationHandle getOperationHandle() {
|
||||
return this.operationHandle;
|
||||
}
|
||||
|
||||
public TSGetOperationStatusReq setOperationHandle(TSOperationHandle operationHandle) {
|
||||
this.operationHandle = operationHandle;
|
||||
return this;
|
||||
}
|
||||
|
||||
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((TSOperationHandle)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 TSGetOperationStatusReq)
|
||||
return this.equals((TSGetOperationStatusReq)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSGetOperationStatusReq 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() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSGetOperationStatusReq 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("TSGetOperationStatusReq(");
|
||||
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 (operationHandle == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' was not present! 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 TSGetOperationStatusReqStandardSchemeFactory implements SchemeFactory {
|
||||
public TSGetOperationStatusReqStandardScheme getScheme() {
|
||||
return new TSGetOperationStatusReqStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSGetOperationStatusReqStandardScheme extends StandardScheme<TSGetOperationStatusReq> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSGetOperationStatusReq struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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 TSOperationHandle();
|
||||
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();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSGetOperationStatusReq 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 TSGetOperationStatusReqTupleSchemeFactory implements SchemeFactory {
|
||||
public TSGetOperationStatusReqTupleScheme getScheme() {
|
||||
return new TSGetOperationStatusReqTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSGetOperationStatusReqTupleScheme extends TupleScheme<TSGetOperationStatusReq> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSGetOperationStatusReq struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
struct.operationHandle.write(oprot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSGetOperationStatusReq struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.operationHandle = new TSOperationHandle();
|
||||
struct.operationHandle.read(iprot);
|
||||
struct.setOperationHandleIsSet(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,386 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSGetOperationStatusResp implements org.apache.thrift.TBase<TSGetOperationStatusResp, TSGetOperationStatusResp._Fields>, java.io.Serializable, Cloneable, Comparable<TSGetOperationStatusResp> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSGetOperationStatusResp");
|
||||
|
||||
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSGetOperationStatusRespStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSGetOperationStatusRespTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public TS_Status 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<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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, TS_Status.class)));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSGetOperationStatusResp.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSGetOperationStatusResp() {
|
||||
}
|
||||
|
||||
public TSGetOperationStatusResp(
|
||||
TS_Status status)
|
||||
{
|
||||
this();
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSGetOperationStatusResp(TSGetOperationStatusResp other) {
|
||||
if (other.isSetStatus()) {
|
||||
this.status = new TS_Status(other.status);
|
||||
}
|
||||
}
|
||||
|
||||
public TSGetOperationStatusResp deepCopy() {
|
||||
return new TSGetOperationStatusResp(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.status = null;
|
||||
}
|
||||
|
||||
public TS_Status getStatus() {
|
||||
return this.status;
|
||||
}
|
||||
|
||||
public TSGetOperationStatusResp setStatus(TS_Status status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
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((TS_Status)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 TSGetOperationStatusResp)
|
||||
return this.equals((TSGetOperationStatusResp)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSGetOperationStatusResp 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() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSGetOperationStatusResp 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("TSGetOperationStatusResp(");
|
||||
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 (status == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' was not present! 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 TSGetOperationStatusRespStandardSchemeFactory implements SchemeFactory {
|
||||
public TSGetOperationStatusRespStandardScheme getScheme() {
|
||||
return new TSGetOperationStatusRespStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSGetOperationStatusRespStandardScheme extends StandardScheme<TSGetOperationStatusResp> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSGetOperationStatusResp struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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 TS_Status();
|
||||
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();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSGetOperationStatusResp 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 TSGetOperationStatusRespTupleSchemeFactory implements SchemeFactory {
|
||||
public TSGetOperationStatusRespTupleScheme getScheme() {
|
||||
return new TSGetOperationStatusRespTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSGetOperationStatusRespTupleScheme extends TupleScheme<TSGetOperationStatusResp> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSGetOperationStatusResp struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
struct.status.write(oprot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSGetOperationStatusResp struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.status = new TS_Status();
|
||||
struct.status.read(iprot);
|
||||
struct.setStatusIsSet(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,482 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSGetTimeZoneResp implements org.apache.thrift.TBase<TSGetTimeZoneResp, TSGetTimeZoneResp._Fields>, java.io.Serializable, Cloneable, Comparable<TSGetTimeZoneResp> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSGetTimeZoneResp");
|
||||
|
||||
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 TIME_ZONE_FIELD_DESC = new org.apache.thrift.protocol.TField("timeZone", org.apache.thrift.protocol.TType.STRING, (short)2);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSGetTimeZoneRespStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSGetTimeZoneRespTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public TS_Status status; // required
|
||||
public String timeZone; // required
|
||||
|
||||
/** 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"),
|
||||
TIME_ZONE((short)2, "timeZone");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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: // TIME_ZONE
|
||||
return TIME_ZONE;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches 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, TS_Status.class)));
|
||||
tmpMap.put(_Fields.TIME_ZONE, new org.apache.thrift.meta_data.FieldMetaData("timeZone", 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(TSGetTimeZoneResp.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSGetTimeZoneResp() {
|
||||
}
|
||||
|
||||
public TSGetTimeZoneResp(
|
||||
TS_Status status,
|
||||
String timeZone)
|
||||
{
|
||||
this();
|
||||
this.status = status;
|
||||
this.timeZone = timeZone;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSGetTimeZoneResp(TSGetTimeZoneResp other) {
|
||||
if (other.isSetStatus()) {
|
||||
this.status = new TS_Status(other.status);
|
||||
}
|
||||
if (other.isSetTimeZone()) {
|
||||
this.timeZone = other.timeZone;
|
||||
}
|
||||
}
|
||||
|
||||
public TSGetTimeZoneResp deepCopy() {
|
||||
return new TSGetTimeZoneResp(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.status = null;
|
||||
this.timeZone = null;
|
||||
}
|
||||
|
||||
public TS_Status getStatus() {
|
||||
return this.status;
|
||||
}
|
||||
|
||||
public TSGetTimeZoneResp setStatus(TS_Status status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
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 getTimeZone() {
|
||||
return this.timeZone;
|
||||
}
|
||||
|
||||
public TSGetTimeZoneResp setTimeZone(String timeZone) {
|
||||
this.timeZone = timeZone;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetTimeZone() {
|
||||
this.timeZone = null;
|
||||
}
|
||||
|
||||
/** Returns true if field timeZone is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetTimeZone() {
|
||||
return this.timeZone != null;
|
||||
}
|
||||
|
||||
public void setTimeZoneIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.timeZone = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case STATUS:
|
||||
if (value == null) {
|
||||
unsetStatus();
|
||||
} else {
|
||||
setStatus((TS_Status)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case TIME_ZONE:
|
||||
if (value == null) {
|
||||
unsetTimeZone();
|
||||
} else {
|
||||
setTimeZone((String)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case STATUS:
|
||||
return getStatus();
|
||||
|
||||
case TIME_ZONE:
|
||||
return getTimeZone();
|
||||
|
||||
}
|
||||
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 TIME_ZONE:
|
||||
return isSetTimeZone();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof TSGetTimeZoneResp)
|
||||
return this.equals((TSGetTimeZoneResp)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSGetTimeZoneResp 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_timeZone = true && this.isSetTimeZone();
|
||||
boolean that_present_timeZone = true && that.isSetTimeZone();
|
||||
if (this_present_timeZone || that_present_timeZone) {
|
||||
if (!(this_present_timeZone && that_present_timeZone))
|
||||
return false;
|
||||
if (!this.timeZone.equals(that.timeZone))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSGetTimeZoneResp 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(isSetTimeZone()).compareTo(other.isSetTimeZone());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetTimeZone()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeZone, other.timeZone);
|
||||
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("TSGetTimeZoneResp(");
|
||||
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("timeZone:");
|
||||
if (this.timeZone == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.timeZone);
|
||||
}
|
||||
first = false;
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
if (status == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' was not present! Struct: " + toString());
|
||||
}
|
||||
if (timeZone == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'timeZone' was not present! 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 TSGetTimeZoneRespStandardSchemeFactory implements SchemeFactory {
|
||||
public TSGetTimeZoneRespStandardScheme getScheme() {
|
||||
return new TSGetTimeZoneRespStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSGetTimeZoneRespStandardScheme extends StandardScheme<TSGetTimeZoneResp> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSGetTimeZoneResp struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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 TS_Status();
|
||||
struct.status.read(iprot);
|
||||
struct.setStatusIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 2: // TIME_ZONE
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
struct.timeZone = iprot.readString();
|
||||
struct.setTimeZoneIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSGetTimeZoneResp 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.timeZone != null) {
|
||||
oprot.writeFieldBegin(TIME_ZONE_FIELD_DESC);
|
||||
oprot.writeString(struct.timeZone);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class TSGetTimeZoneRespTupleSchemeFactory implements SchemeFactory {
|
||||
public TSGetTimeZoneRespTupleScheme getScheme() {
|
||||
return new TSGetTimeZoneRespTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSGetTimeZoneRespTupleScheme extends TupleScheme<TSGetTimeZoneResp> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSGetTimeZoneResp struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
struct.status.write(oprot);
|
||||
oprot.writeString(struct.timeZone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSGetTimeZoneResp struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.status = new TS_Status();
|
||||
struct.status.read(iprot);
|
||||
struct.setStatusIsSet(true);
|
||||
struct.timeZone = iprot.readString();
|
||||
struct.setTimeZoneIsSet(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,499 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSHandleIdentifier implements org.apache.thrift.TBase<TSHandleIdentifier, TSHandleIdentifier._Fields>, java.io.Serializable, Cloneable, Comparable<TSHandleIdentifier> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSHandleIdentifier");
|
||||
|
||||
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSHandleIdentifierStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSHandleIdentifierTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public ByteBuffer guid; // required
|
||||
public 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<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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(TSHandleIdentifier.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSHandleIdentifier() {
|
||||
}
|
||||
|
||||
public TSHandleIdentifier(
|
||||
ByteBuffer guid,
|
||||
ByteBuffer secret)
|
||||
{
|
||||
this();
|
||||
this.guid = guid;
|
||||
this.secret = secret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSHandleIdentifier(TSHandleIdentifier 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 TSHandleIdentifier deepCopy() {
|
||||
return new TSHandleIdentifier(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 guid;
|
||||
}
|
||||
|
||||
public TSHandleIdentifier setGuid(byte[] guid) {
|
||||
setGuid(guid == null ? (ByteBuffer)null : ByteBuffer.wrap(guid));
|
||||
return this;
|
||||
}
|
||||
|
||||
public TSHandleIdentifier setGuid(ByteBuffer guid) {
|
||||
this.guid = guid;
|
||||
return this;
|
||||
}
|
||||
|
||||
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 secret;
|
||||
}
|
||||
|
||||
public TSHandleIdentifier setSecret(byte[] secret) {
|
||||
setSecret(secret == null ? (ByteBuffer)null : ByteBuffer.wrap(secret));
|
||||
return this;
|
||||
}
|
||||
|
||||
public TSHandleIdentifier setSecret(ByteBuffer secret) {
|
||||
this.secret = secret;
|
||||
return this;
|
||||
}
|
||||
|
||||
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 TSHandleIdentifier)
|
||||
return this.equals((TSHandleIdentifier)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSHandleIdentifier 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() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSHandleIdentifier 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("TSHandleIdentifier(");
|
||||
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 (guid == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'guid' was not present! Struct: " + toString());
|
||||
}
|
||||
if (secret == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'secret' was not present! 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 TSHandleIdentifierStandardSchemeFactory implements SchemeFactory {
|
||||
public TSHandleIdentifierStandardScheme getScheme() {
|
||||
return new TSHandleIdentifierStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSHandleIdentifierStandardScheme extends StandardScheme<TSHandleIdentifier> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSHandleIdentifier struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSHandleIdentifier 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 TSHandleIdentifierTupleSchemeFactory implements SchemeFactory {
|
||||
public TSHandleIdentifierTupleScheme getScheme() {
|
||||
return new TSHandleIdentifierTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSHandleIdentifierTupleScheme extends TupleScheme<TSHandleIdentifier> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSHandleIdentifier 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, TSHandleIdentifier struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.guid = iprot.readBinary();
|
||||
struct.setGuidIsSet(true);
|
||||
struct.secret = iprot.readBinary();
|
||||
struct.setSecretIsSet(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1,762 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSOpenSessionReq implements org.apache.thrift.TBase<TSOpenSessionReq, TSOpenSessionReq._Fields>, java.io.Serializable, Cloneable, Comparable<TSOpenSessionReq> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSOpenSessionReq");
|
||||
|
||||
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSOpenSessionReqStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSOpenSessionReqTupleSchemeFactory());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see TSProtocolVersion
|
||||
*/
|
||||
public TSProtocolVersion client_protocol; // required
|
||||
public String username; // optional
|
||||
public String password; // optional
|
||||
public Map<String,String> 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 TSProtocolVersion
|
||||
*/
|
||||
CLIENT_PROTOCOL((short)1, "client_protocol"),
|
||||
USERNAME((short)2, "username"),
|
||||
PASSWORD((short)3, "password"),
|
||||
CONFIGURATION((short)4, "configuration");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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 _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, TSProtocolVersion.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(TSOpenSessionReq.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSOpenSessionReq() {
|
||||
this.client_protocol = cn.edu.tsinghua.service.rpc.thrift.TSProtocolVersion.TSFILE_SERVICE_PROTOCOL_V1;
|
||||
|
||||
}
|
||||
|
||||
public TSOpenSessionReq(
|
||||
TSProtocolVersion client_protocol)
|
||||
{
|
||||
this();
|
||||
this.client_protocol = client_protocol;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSOpenSessionReq(TSOpenSessionReq 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<String,String> __this__configuration = new HashMap<String,String>(other.configuration);
|
||||
this.configuration = __this__configuration;
|
||||
}
|
||||
}
|
||||
|
||||
public TSOpenSessionReq deepCopy() {
|
||||
return new TSOpenSessionReq(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.client_protocol = cn.edu.tsinghua.service.rpc.thrift.TSProtocolVersion.TSFILE_SERVICE_PROTOCOL_V1;
|
||||
|
||||
this.username = null;
|
||||
this.password = null;
|
||||
this.configuration = null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see TSProtocolVersion
|
||||
*/
|
||||
public TSProtocolVersion getClient_protocol() {
|
||||
return this.client_protocol;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see TSProtocolVersion
|
||||
*/
|
||||
public TSOpenSessionReq setClient_protocol(TSProtocolVersion client_protocol) {
|
||||
this.client_protocol = client_protocol;
|
||||
return this;
|
||||
}
|
||||
|
||||
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 TSOpenSessionReq setUsername(String username) {
|
||||
this.username = username;
|
||||
return this;
|
||||
}
|
||||
|
||||
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 TSOpenSessionReq setPassword(String password) {
|
||||
this.password = password;
|
||||
return this;
|
||||
}
|
||||
|
||||
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<String,String>();
|
||||
}
|
||||
this.configuration.put(key, val);
|
||||
}
|
||||
|
||||
public Map<String,String> getConfiguration() {
|
||||
return this.configuration;
|
||||
}
|
||||
|
||||
public TSOpenSessionReq setConfiguration(Map<String,String> configuration) {
|
||||
this.configuration = configuration;
|
||||
return this;
|
||||
}
|
||||
|
||||
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((TSProtocolVersion)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<String,String>)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 TSOpenSessionReq)
|
||||
return this.equals((TSOpenSessionReq)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSOpenSessionReq 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() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSOpenSessionReq 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("TSOpenSessionReq(");
|
||||
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 (client_protocol == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'client_protocol' was not present! 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 TSOpenSessionReqStandardSchemeFactory implements SchemeFactory {
|
||||
public TSOpenSessionReqStandardScheme getScheme() {
|
||||
return new TSOpenSessionReqStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSOpenSessionReqStandardScheme extends StandardScheme<TSOpenSessionReq> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSOpenSessionReq struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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 = TSProtocolVersion.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 _map26 = iprot.readMapBegin();
|
||||
struct.configuration = new HashMap<String,String>(2*_map26.size);
|
||||
for (int _i27 = 0; _i27 < _map26.size; ++_i27)
|
||||
{
|
||||
String _key28;
|
||||
String _val29;
|
||||
_key28 = iprot.readString();
|
||||
_val29 = iprot.readString();
|
||||
struct.configuration.put(_key28, _val29);
|
||||
}
|
||||
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();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSOpenSessionReq 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<String, String> _iter30 : struct.configuration.entrySet())
|
||||
{
|
||||
oprot.writeString(_iter30.getKey());
|
||||
oprot.writeString(_iter30.getValue());
|
||||
}
|
||||
oprot.writeMapEnd();
|
||||
}
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class TSOpenSessionReqTupleSchemeFactory implements SchemeFactory {
|
||||
public TSOpenSessionReqTupleScheme getScheme() {
|
||||
return new TSOpenSessionReqTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSOpenSessionReqTupleScheme extends TupleScheme<TSOpenSessionReq> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSOpenSessionReq 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<String, String> _iter31 : struct.configuration.entrySet())
|
||||
{
|
||||
oprot.writeString(_iter31.getKey());
|
||||
oprot.writeString(_iter31.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSOpenSessionReq struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.client_protocol = TSProtocolVersion.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 _map32 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
|
||||
struct.configuration = new HashMap<String,String>(2*_map32.size);
|
||||
for (int _i33 = 0; _i33 < _map32.size; ++_i33)
|
||||
{
|
||||
String _key34;
|
||||
String _val35;
|
||||
_key34 = iprot.readString();
|
||||
_val35 = iprot.readString();
|
||||
struct.configuration.put(_key34, _val35);
|
||||
}
|
||||
}
|
||||
struct.setConfigurationIsSet(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,766 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSOpenSessionResp implements org.apache.thrift.TBase<TSOpenSessionResp, TSOpenSessionResp._Fields>, java.io.Serializable, Cloneable, Comparable<TSOpenSessionResp> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSOpenSessionResp");
|
||||
|
||||
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSOpenSessionRespStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSOpenSessionRespTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public TS_Status status; // required
|
||||
/**
|
||||
*
|
||||
* @see TSProtocolVersion
|
||||
*/
|
||||
public TSProtocolVersion serverProtocolVersion; // required
|
||||
public TS_SessionHandle sessionHandle; // optional
|
||||
public Map<String,String> 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 TSProtocolVersion
|
||||
*/
|
||||
SERVER_PROTOCOL_VERSION((short)2, "serverProtocolVersion"),
|
||||
SESSION_HANDLE((short)3, "sessionHandle"),
|
||||
CONFIGURATION((short)4, "configuration");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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 _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, TS_Status.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, TSProtocolVersion.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, TS_SessionHandle.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(TSOpenSessionResp.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSOpenSessionResp() {
|
||||
this.serverProtocolVersion = cn.edu.tsinghua.service.rpc.thrift.TSProtocolVersion.TSFILE_SERVICE_PROTOCOL_V1;
|
||||
|
||||
}
|
||||
|
||||
public TSOpenSessionResp(
|
||||
TS_Status status,
|
||||
TSProtocolVersion serverProtocolVersion)
|
||||
{
|
||||
this();
|
||||
this.status = status;
|
||||
this.serverProtocolVersion = serverProtocolVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSOpenSessionResp(TSOpenSessionResp other) {
|
||||
if (other.isSetStatus()) {
|
||||
this.status = new TS_Status(other.status);
|
||||
}
|
||||
if (other.isSetServerProtocolVersion()) {
|
||||
this.serverProtocolVersion = other.serverProtocolVersion;
|
||||
}
|
||||
if (other.isSetSessionHandle()) {
|
||||
this.sessionHandle = new TS_SessionHandle(other.sessionHandle);
|
||||
}
|
||||
if (other.isSetConfiguration()) {
|
||||
Map<String,String> __this__configuration = new HashMap<String,String>(other.configuration);
|
||||
this.configuration = __this__configuration;
|
||||
}
|
||||
}
|
||||
|
||||
public TSOpenSessionResp deepCopy() {
|
||||
return new TSOpenSessionResp(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.status = null;
|
||||
this.serverProtocolVersion = cn.edu.tsinghua.service.rpc.thrift.TSProtocolVersion.TSFILE_SERVICE_PROTOCOL_V1;
|
||||
|
||||
this.sessionHandle = null;
|
||||
this.configuration = null;
|
||||
}
|
||||
|
||||
public TS_Status getStatus() {
|
||||
return this.status;
|
||||
}
|
||||
|
||||
public TSOpenSessionResp setStatus(TS_Status status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
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 TSProtocolVersion
|
||||
*/
|
||||
public TSProtocolVersion getServerProtocolVersion() {
|
||||
return this.serverProtocolVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see TSProtocolVersion
|
||||
*/
|
||||
public TSOpenSessionResp setServerProtocolVersion(TSProtocolVersion serverProtocolVersion) {
|
||||
this.serverProtocolVersion = serverProtocolVersion;
|
||||
return this;
|
||||
}
|
||||
|
||||
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 TS_SessionHandle getSessionHandle() {
|
||||
return this.sessionHandle;
|
||||
}
|
||||
|
||||
public TSOpenSessionResp setSessionHandle(TS_SessionHandle sessionHandle) {
|
||||
this.sessionHandle = sessionHandle;
|
||||
return this;
|
||||
}
|
||||
|
||||
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<String,String>();
|
||||
}
|
||||
this.configuration.put(key, val);
|
||||
}
|
||||
|
||||
public Map<String,String> getConfiguration() {
|
||||
return this.configuration;
|
||||
}
|
||||
|
||||
public TSOpenSessionResp setConfiguration(Map<String,String> configuration) {
|
||||
this.configuration = configuration;
|
||||
return this;
|
||||
}
|
||||
|
||||
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((TS_Status)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case SERVER_PROTOCOL_VERSION:
|
||||
if (value == null) {
|
||||
unsetServerProtocolVersion();
|
||||
} else {
|
||||
setServerProtocolVersion((TSProtocolVersion)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case SESSION_HANDLE:
|
||||
if (value == null) {
|
||||
unsetSessionHandle();
|
||||
} else {
|
||||
setSessionHandle((TS_SessionHandle)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case CONFIGURATION:
|
||||
if (value == null) {
|
||||
unsetConfiguration();
|
||||
} else {
|
||||
setConfiguration((Map<String,String>)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 TSOpenSessionResp)
|
||||
return this.equals((TSOpenSessionResp)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSOpenSessionResp 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() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSOpenSessionResp 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("TSOpenSessionResp(");
|
||||
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 (status == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' was not present! Struct: " + toString());
|
||||
}
|
||||
if (serverProtocolVersion == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'serverProtocolVersion' was not present! 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 TSOpenSessionRespStandardSchemeFactory implements SchemeFactory {
|
||||
public TSOpenSessionRespStandardScheme getScheme() {
|
||||
return new TSOpenSessionRespStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSOpenSessionRespStandardScheme extends StandardScheme<TSOpenSessionResp> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSOpenSessionResp struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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 TS_Status();
|
||||
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 = TSProtocolVersion.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 TS_SessionHandle();
|
||||
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 _map16 = iprot.readMapBegin();
|
||||
struct.configuration = new HashMap<String,String>(2*_map16.size);
|
||||
for (int _i17 = 0; _i17 < _map16.size; ++_i17)
|
||||
{
|
||||
String _key18;
|
||||
String _val19;
|
||||
_key18 = iprot.readString();
|
||||
_val19 = iprot.readString();
|
||||
struct.configuration.put(_key18, _val19);
|
||||
}
|
||||
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();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSOpenSessionResp 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<String, String> _iter20 : struct.configuration.entrySet())
|
||||
{
|
||||
oprot.writeString(_iter20.getKey());
|
||||
oprot.writeString(_iter20.getValue());
|
||||
}
|
||||
oprot.writeMapEnd();
|
||||
}
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class TSOpenSessionRespTupleSchemeFactory implements SchemeFactory {
|
||||
public TSOpenSessionRespTupleScheme getScheme() {
|
||||
return new TSOpenSessionRespTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSOpenSessionRespTupleScheme extends TupleScheme<TSOpenSessionResp> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSOpenSessionResp 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<String, String> _iter21 : struct.configuration.entrySet())
|
||||
{
|
||||
oprot.writeString(_iter21.getKey());
|
||||
oprot.writeString(_iter21.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSOpenSessionResp struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.status = new TS_Status();
|
||||
struct.status.read(iprot);
|
||||
struct.setStatusIsSet(true);
|
||||
struct.serverProtocolVersion = TSProtocolVersion.findByValue(iprot.readI32());
|
||||
struct.setServerProtocolVersionIsSet(true);
|
||||
BitSet incoming = iprot.readBitSet(2);
|
||||
if (incoming.get(0)) {
|
||||
struct.sessionHandle = new TS_SessionHandle();
|
||||
struct.sessionHandle.read(iprot);
|
||||
struct.setSessionHandleIsSet(true);
|
||||
}
|
||||
if (incoming.get(1)) {
|
||||
{
|
||||
org.apache.thrift.protocol.TMap _map22 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
|
||||
struct.configuration = new HashMap<String,String>(2*_map22.size);
|
||||
for (int _i23 = 0; _i23 < _map22.size; ++_i23)
|
||||
{
|
||||
String _key24;
|
||||
String _val25;
|
||||
_key24 = iprot.readString();
|
||||
_val25 = iprot.readString();
|
||||
struct.configuration.put(_key24, _val25);
|
||||
}
|
||||
}
|
||||
struct.setConfigurationIsSet(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,481 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSOperationHandle implements org.apache.thrift.TBase<TSOperationHandle, TSOperationHandle._Fields>, java.io.Serializable, Cloneable, Comparable<TSOperationHandle> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSOperationHandle");
|
||||
|
||||
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 HAS_RESULT_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("hasResultSet", org.apache.thrift.protocol.TType.BOOL, (short)2);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSOperationHandleStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSOperationHandleTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public TSHandleIdentifier operationId; // required
|
||||
public boolean hasResultSet; // required
|
||||
|
||||
/** 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"),
|
||||
HAS_RESULT_SET((short)2, "hasResultSet");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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: // HAS_RESULT_SET
|
||||
return HAS_RESULT_SET;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches 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 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.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, TSHandleIdentifier.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)));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSOperationHandle.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSOperationHandle() {
|
||||
}
|
||||
|
||||
public TSOperationHandle(
|
||||
TSHandleIdentifier operationId,
|
||||
boolean hasResultSet)
|
||||
{
|
||||
this();
|
||||
this.operationId = operationId;
|
||||
this.hasResultSet = hasResultSet;
|
||||
setHasResultSetIsSet(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSOperationHandle(TSOperationHandle other) {
|
||||
__isset_bitfield = other.__isset_bitfield;
|
||||
if (other.isSetOperationId()) {
|
||||
this.operationId = new TSHandleIdentifier(other.operationId);
|
||||
}
|
||||
this.hasResultSet = other.hasResultSet;
|
||||
}
|
||||
|
||||
public TSOperationHandle deepCopy() {
|
||||
return new TSOperationHandle(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.operationId = null;
|
||||
setHasResultSetIsSet(false);
|
||||
this.hasResultSet = false;
|
||||
}
|
||||
|
||||
public TSHandleIdentifier getOperationId() {
|
||||
return this.operationId;
|
||||
}
|
||||
|
||||
public TSOperationHandle setOperationId(TSHandleIdentifier operationId) {
|
||||
this.operationId = operationId;
|
||||
return this;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isHasResultSet() {
|
||||
return this.hasResultSet;
|
||||
}
|
||||
|
||||
public TSOperationHandle setHasResultSet(boolean hasResultSet) {
|
||||
this.hasResultSet = hasResultSet;
|
||||
setHasResultSetIsSet(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
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 void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case OPERATION_ID:
|
||||
if (value == null) {
|
||||
unsetOperationId();
|
||||
} else {
|
||||
setOperationId((TSHandleIdentifier)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case HAS_RESULT_SET:
|
||||
if (value == null) {
|
||||
unsetHasResultSet();
|
||||
} else {
|
||||
setHasResultSet((Boolean)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case OPERATION_ID:
|
||||
return getOperationId();
|
||||
|
||||
case HAS_RESULT_SET:
|
||||
return Boolean.valueOf(isHasResultSet());
|
||||
|
||||
}
|
||||
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 HAS_RESULT_SET:
|
||||
return isSetHasResultSet();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof TSOperationHandle)
|
||||
return this.equals((TSOperationHandle)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSOperationHandle 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_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;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSOperationHandle 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(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;
|
||||
}
|
||||
}
|
||||
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("TSOperationHandle(");
|
||||
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("hasResultSet:");
|
||||
sb.append(this.hasResultSet);
|
||||
first = false;
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
if (operationId == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationId' was not present! Struct: " + toString());
|
||||
}
|
||||
// alas, we cannot check 'hasResultSet' because it's a primitive and you chose the non-beans generator.
|
||||
// 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 TSOperationHandleStandardSchemeFactory implements SchemeFactory {
|
||||
public TSOperationHandleStandardScheme getScheme() {
|
||||
return new TSOperationHandleStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSOperationHandleStandardScheme extends StandardScheme<TSOperationHandle> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSOperationHandle struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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 TSHandleIdentifier();
|
||||
struct.operationId.read(iprot);
|
||||
struct.setOperationIdIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 2: // 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;
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
if (!struct.isSetHasResultSet()) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'hasResultSet' was not found in serialized data! Struct: " + toString());
|
||||
}
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSOperationHandle 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();
|
||||
}
|
||||
oprot.writeFieldBegin(HAS_RESULT_SET_FIELD_DESC);
|
||||
oprot.writeBool(struct.hasResultSet);
|
||||
oprot.writeFieldEnd();
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class TSOperationHandleTupleSchemeFactory implements SchemeFactory {
|
||||
public TSOperationHandleTupleScheme getScheme() {
|
||||
return new TSOperationHandleTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSOperationHandleTupleScheme extends TupleScheme<TSOperationHandle> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSOperationHandle struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
struct.operationId.write(oprot);
|
||||
oprot.writeBool(struct.hasResultSet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSOperationHandle struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.operationId = new TSHandleIdentifier();
|
||||
struct.operationId.read(iprot);
|
||||
struct.setOperationIdIsSet(true);
|
||||
struct.hasResultSet = iprot.readBool();
|
||||
struct.setHasResultSetIsSet(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.service.rpc.thrift;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import org.apache.thrift.TEnum;
|
||||
|
||||
public enum TSProtocolVersion implements org.apache.thrift.TEnum {
|
||||
TSFILE_SERVICE_PROTOCOL_V1(0);
|
||||
|
||||
private final int value;
|
||||
|
||||
private TSProtocolVersion(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 TSProtocolVersion findByValue(int value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return TSFILE_SERVICE_PROTOCOL_V1;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,435 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSQueryDataSet implements org.apache.thrift.TBase<TSQueryDataSet, TSQueryDataSet._Fields>, java.io.Serializable, Cloneable, Comparable<TSQueryDataSet> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSQueryDataSet");
|
||||
|
||||
private static final org.apache.thrift.protocol.TField RECORDS_FIELD_DESC = new org.apache.thrift.protocol.TField("records", org.apache.thrift.protocol.TType.LIST, (short)1);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSQueryDataSetStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSQueryDataSetTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public List<TSRowRecord> records; // required
|
||||
|
||||
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
|
||||
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
|
||||
RECORDS((short)1, "records");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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: // RECORDS
|
||||
return RECORDS;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches 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.RECORDS, new org.apache.thrift.meta_data.FieldMetaData("records", 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, TSRowRecord.class))));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSQueryDataSet.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSQueryDataSet() {
|
||||
}
|
||||
|
||||
public TSQueryDataSet(
|
||||
List<TSRowRecord> records)
|
||||
{
|
||||
this();
|
||||
this.records = records;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSQueryDataSet(TSQueryDataSet other) {
|
||||
if (other.isSetRecords()) {
|
||||
List<TSRowRecord> __this__records = new ArrayList<TSRowRecord>(other.records.size());
|
||||
for (TSRowRecord other_element : other.records) {
|
||||
__this__records.add(new TSRowRecord(other_element));
|
||||
}
|
||||
this.records = __this__records;
|
||||
}
|
||||
}
|
||||
|
||||
public TSQueryDataSet deepCopy() {
|
||||
return new TSQueryDataSet(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.records = null;
|
||||
}
|
||||
|
||||
public int getRecordsSize() {
|
||||
return (this.records == null) ? 0 : this.records.size();
|
||||
}
|
||||
|
||||
public java.util.Iterator<TSRowRecord> getRecordsIterator() {
|
||||
return (this.records == null) ? null : this.records.iterator();
|
||||
}
|
||||
|
||||
public void addToRecords(TSRowRecord elem) {
|
||||
if (this.records == null) {
|
||||
this.records = new ArrayList<TSRowRecord>();
|
||||
}
|
||||
this.records.add(elem);
|
||||
}
|
||||
|
||||
public List<TSRowRecord> getRecords() {
|
||||
return this.records;
|
||||
}
|
||||
|
||||
public TSQueryDataSet setRecords(List<TSRowRecord> records) {
|
||||
this.records = records;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetRecords() {
|
||||
this.records = null;
|
||||
}
|
||||
|
||||
/** Returns true if field records is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetRecords() {
|
||||
return this.records != null;
|
||||
}
|
||||
|
||||
public void setRecordsIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.records = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case RECORDS:
|
||||
if (value == null) {
|
||||
unsetRecords();
|
||||
} else {
|
||||
setRecords((List<TSRowRecord>)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case RECORDS:
|
||||
return getRecords();
|
||||
|
||||
}
|
||||
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 RECORDS:
|
||||
return isSetRecords();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof TSQueryDataSet)
|
||||
return this.equals((TSQueryDataSet)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSQueryDataSet that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
|
||||
boolean this_present_records = true && this.isSetRecords();
|
||||
boolean that_present_records = true && that.isSetRecords();
|
||||
if (this_present_records || that_present_records) {
|
||||
if (!(this_present_records && that_present_records))
|
||||
return false;
|
||||
if (!this.records.equals(that.records))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSQueryDataSet other) {
|
||||
if (!getClass().equals(other.getClass())) {
|
||||
return getClass().getName().compareTo(other.getClass().getName());
|
||||
}
|
||||
|
||||
int lastComparison = 0;
|
||||
|
||||
lastComparison = Boolean.valueOf(isSetRecords()).compareTo(other.isSetRecords());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetRecords()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.records, other.records);
|
||||
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("TSQueryDataSet(");
|
||||
boolean first = true;
|
||||
|
||||
sb.append("records:");
|
||||
if (this.records == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.records);
|
||||
}
|
||||
first = false;
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
if (records == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'records' was not present! 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 TSQueryDataSetStandardSchemeFactory implements SchemeFactory {
|
||||
public TSQueryDataSetStandardScheme getScheme() {
|
||||
return new TSQueryDataSetStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSQueryDataSetStandardScheme extends StandardScheme<TSQueryDataSet> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSQueryDataSet struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.TField schemeField;
|
||||
iprot.readStructBegin();
|
||||
while (true)
|
||||
{
|
||||
schemeField = iprot.readFieldBegin();
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
|
||||
break;
|
||||
}
|
||||
switch (schemeField.id) {
|
||||
case 1: // RECORDS
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list62 = iprot.readListBegin();
|
||||
struct.records = new ArrayList<TSRowRecord>(_list62.size);
|
||||
for (int _i63 = 0; _i63 < _list62.size; ++_i63)
|
||||
{
|
||||
TSRowRecord _elem64;
|
||||
_elem64 = new TSRowRecord();
|
||||
_elem64.read(iprot);
|
||||
struct.records.add(_elem64);
|
||||
}
|
||||
iprot.readListEnd();
|
||||
}
|
||||
struct.setRecordsIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSQueryDataSet struct) throws org.apache.thrift.TException {
|
||||
struct.validate();
|
||||
|
||||
oprot.writeStructBegin(STRUCT_DESC);
|
||||
if (struct.records != null) {
|
||||
oprot.writeFieldBegin(RECORDS_FIELD_DESC);
|
||||
{
|
||||
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.records.size()));
|
||||
for (TSRowRecord _iter65 : struct.records)
|
||||
{
|
||||
_iter65.write(oprot);
|
||||
}
|
||||
oprot.writeListEnd();
|
||||
}
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class TSQueryDataSetTupleSchemeFactory implements SchemeFactory {
|
||||
public TSQueryDataSetTupleScheme getScheme() {
|
||||
return new TSQueryDataSetTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSQueryDataSetTupleScheme extends TupleScheme<TSQueryDataSet> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSQueryDataSet struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
{
|
||||
oprot.writeI32(struct.records.size());
|
||||
for (TSRowRecord _iter66 : struct.records)
|
||||
{
|
||||
_iter66.write(oprot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSQueryDataSet 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.STRUCT, iprot.readI32());
|
||||
struct.records = new ArrayList<TSRowRecord>(_list67.size);
|
||||
for (int _i68 = 0; _i68 < _list67.size; ++_i68)
|
||||
{
|
||||
TSRowRecord _elem69;
|
||||
_elem69 = new TSRowRecord();
|
||||
_elem69.read(iprot);
|
||||
struct.records.add(_elem69);
|
||||
}
|
||||
}
|
||||
struct.setRecordsIsSet(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,675 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSRowRecord implements org.apache.thrift.TBase<TSRowRecord, TSRowRecord._Fields>, java.io.Serializable, Cloneable, Comparable<TSRowRecord> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSRowRecord");
|
||||
|
||||
private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)1);
|
||||
private static final org.apache.thrift.protocol.TField KEYS_FIELD_DESC = new org.apache.thrift.protocol.TField("keys", org.apache.thrift.protocol.TType.LIST, (short)2);
|
||||
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)3);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSRowRecordStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSRowRecordTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public long timestamp; // required
|
||||
public List<String> keys; // required
|
||||
public List<TSDataValue> values; // required
|
||||
|
||||
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
|
||||
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
|
||||
TIMESTAMP((short)1, "timestamp"),
|
||||
KEYS((short)2, "keys"),
|
||||
VALUES((short)3, "values");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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: // TIMESTAMP
|
||||
return TIMESTAMP;
|
||||
case 2: // KEYS
|
||||
return KEYS;
|
||||
case 3: // VALUES
|
||||
return VALUES;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches 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 __TIMESTAMP_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.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.REQUIRED,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
|
||||
tmpMap.put(_Fields.KEYS, new org.apache.thrift.meta_data.FieldMetaData("keys", 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.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.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSDataValue.class))));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSRowRecord.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSRowRecord() {
|
||||
}
|
||||
|
||||
public TSRowRecord(
|
||||
long timestamp,
|
||||
List<String> keys,
|
||||
List<TSDataValue> values)
|
||||
{
|
||||
this();
|
||||
this.timestamp = timestamp;
|
||||
setTimestampIsSet(true);
|
||||
this.keys = keys;
|
||||
this.values = values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSRowRecord(TSRowRecord other) {
|
||||
__isset_bitfield = other.__isset_bitfield;
|
||||
this.timestamp = other.timestamp;
|
||||
if (other.isSetKeys()) {
|
||||
List<String> __this__keys = new ArrayList<String>(other.keys);
|
||||
this.keys = __this__keys;
|
||||
}
|
||||
if (other.isSetValues()) {
|
||||
List<TSDataValue> __this__values = new ArrayList<TSDataValue>(other.values.size());
|
||||
for (TSDataValue other_element : other.values) {
|
||||
__this__values.add(new TSDataValue(other_element));
|
||||
}
|
||||
this.values = __this__values;
|
||||
}
|
||||
}
|
||||
|
||||
public TSRowRecord deepCopy() {
|
||||
return new TSRowRecord(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
setTimestampIsSet(false);
|
||||
this.timestamp = 0;
|
||||
this.keys = null;
|
||||
this.values = null;
|
||||
}
|
||||
|
||||
public long getTimestamp() {
|
||||
return this.timestamp;
|
||||
}
|
||||
|
||||
public TSRowRecord setTimestamp(long timestamp) {
|
||||
this.timestamp = timestamp;
|
||||
setTimestampIsSet(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetTimestamp() {
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field timestamp is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetTimestamp() {
|
||||
return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setTimestampIsSet(boolean value) {
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value);
|
||||
}
|
||||
|
||||
public int getKeysSize() {
|
||||
return (this.keys == null) ? 0 : this.keys.size();
|
||||
}
|
||||
|
||||
public java.util.Iterator<String> getKeysIterator() {
|
||||
return (this.keys == null) ? null : this.keys.iterator();
|
||||
}
|
||||
|
||||
public void addToKeys(String elem) {
|
||||
if (this.keys == null) {
|
||||
this.keys = new ArrayList<String>();
|
||||
}
|
||||
this.keys.add(elem);
|
||||
}
|
||||
|
||||
public List<String> getKeys() {
|
||||
return this.keys;
|
||||
}
|
||||
|
||||
public TSRowRecord setKeys(List<String> keys) {
|
||||
this.keys = keys;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetKeys() {
|
||||
this.keys = null;
|
||||
}
|
||||
|
||||
/** Returns true if field keys is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetKeys() {
|
||||
return this.keys != null;
|
||||
}
|
||||
|
||||
public void setKeysIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.keys = null;
|
||||
}
|
||||
}
|
||||
|
||||
public int getValuesSize() {
|
||||
return (this.values == null) ? 0 : this.values.size();
|
||||
}
|
||||
|
||||
public java.util.Iterator<TSDataValue> getValuesIterator() {
|
||||
return (this.values == null) ? null : this.values.iterator();
|
||||
}
|
||||
|
||||
public void addToValues(TSDataValue elem) {
|
||||
if (this.values == null) {
|
||||
this.values = new ArrayList<TSDataValue>();
|
||||
}
|
||||
this.values.add(elem);
|
||||
}
|
||||
|
||||
public List<TSDataValue> getValues() {
|
||||
return this.values;
|
||||
}
|
||||
|
||||
public TSRowRecord setValues(List<TSDataValue> values) {
|
||||
this.values = values;
|
||||
return this;
|
||||
}
|
||||
|
||||
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 void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case TIMESTAMP:
|
||||
if (value == null) {
|
||||
unsetTimestamp();
|
||||
} else {
|
||||
setTimestamp((Long)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case KEYS:
|
||||
if (value == null) {
|
||||
unsetKeys();
|
||||
} else {
|
||||
setKeys((List<String>)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case VALUES:
|
||||
if (value == null) {
|
||||
unsetValues();
|
||||
} else {
|
||||
setValues((List<TSDataValue>)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case TIMESTAMP:
|
||||
return Long.valueOf(getTimestamp());
|
||||
|
||||
case KEYS:
|
||||
return getKeys();
|
||||
|
||||
case VALUES:
|
||||
return getValues();
|
||||
|
||||
}
|
||||
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 TIMESTAMP:
|
||||
return isSetTimestamp();
|
||||
case KEYS:
|
||||
return isSetKeys();
|
||||
case VALUES:
|
||||
return isSetValues();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof TSRowRecord)
|
||||
return this.equals((TSRowRecord)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSRowRecord that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
|
||||
boolean this_present_timestamp = true;
|
||||
boolean that_present_timestamp = true;
|
||||
if (this_present_timestamp || that_present_timestamp) {
|
||||
if (!(this_present_timestamp && that_present_timestamp))
|
||||
return false;
|
||||
if (this.timestamp != that.timestamp)
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_keys = true && this.isSetKeys();
|
||||
boolean that_present_keys = true && that.isSetKeys();
|
||||
if (this_present_keys || that_present_keys) {
|
||||
if (!(this_present_keys && that_present_keys))
|
||||
return false;
|
||||
if (!this.keys.equals(that.keys))
|
||||
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;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSRowRecord other) {
|
||||
if (!getClass().equals(other.getClass())) {
|
||||
return getClass().getName().compareTo(other.getClass().getName());
|
||||
}
|
||||
|
||||
int lastComparison = 0;
|
||||
|
||||
lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetTimestamp()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp);
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
}
|
||||
lastComparison = Boolean.valueOf(isSetKeys()).compareTo(other.isSetKeys());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetKeys()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keys, other.keys);
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
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("TSRowRecord(");
|
||||
boolean first = true;
|
||||
|
||||
sb.append("timestamp:");
|
||||
sb.append(this.timestamp);
|
||||
first = false;
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("keys:");
|
||||
if (this.keys == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.keys);
|
||||
}
|
||||
first = false;
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("values:");
|
||||
if (this.values == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.values);
|
||||
}
|
||||
first = false;
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
// alas, we cannot check 'timestamp' because it's a primitive and you chose the non-beans generator.
|
||||
if (keys == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'keys' was not present! Struct: " + toString());
|
||||
}
|
||||
if (values == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' was not present! 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 TSRowRecordStandardSchemeFactory implements SchemeFactory {
|
||||
public TSRowRecordStandardScheme getScheme() {
|
||||
return new TSRowRecordStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSRowRecordStandardScheme extends StandardScheme<TSRowRecord> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSRowRecord struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.TField schemeField;
|
||||
iprot.readStructBegin();
|
||||
while (true)
|
||||
{
|
||||
schemeField = iprot.readFieldBegin();
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
|
||||
break;
|
||||
}
|
||||
switch (schemeField.id) {
|
||||
case 1: // TIMESTAMP
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
|
||||
struct.timestamp = iprot.readI64();
|
||||
struct.setTimestampIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 2: // KEYS
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list52 = iprot.readListBegin();
|
||||
struct.keys = new ArrayList<String>(_list52.size);
|
||||
for (int _i53 = 0; _i53 < _list52.size; ++_i53)
|
||||
{
|
||||
String _elem54;
|
||||
_elem54 = iprot.readString();
|
||||
struct.keys.add(_elem54);
|
||||
}
|
||||
iprot.readListEnd();
|
||||
}
|
||||
struct.setKeysIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 3: // VALUES
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list55 = iprot.readListBegin();
|
||||
struct.values = new ArrayList<TSDataValue>(_list55.size);
|
||||
for (int _i56 = 0; _i56 < _list55.size; ++_i56)
|
||||
{
|
||||
TSDataValue _elem57;
|
||||
_elem57 = new TSDataValue();
|
||||
_elem57.read(iprot);
|
||||
struct.values.add(_elem57);
|
||||
}
|
||||
iprot.readListEnd();
|
||||
}
|
||||
struct.setValuesIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
if (!struct.isSetTimestamp()) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'timestamp' was not found in serialized data! Struct: " + toString());
|
||||
}
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSRowRecord struct) throws org.apache.thrift.TException {
|
||||
struct.validate();
|
||||
|
||||
oprot.writeStructBegin(STRUCT_DESC);
|
||||
oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
|
||||
oprot.writeI64(struct.timestamp);
|
||||
oprot.writeFieldEnd();
|
||||
if (struct.keys != null) {
|
||||
oprot.writeFieldBegin(KEYS_FIELD_DESC);
|
||||
{
|
||||
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.keys.size()));
|
||||
for (String _iter58 : struct.keys)
|
||||
{
|
||||
oprot.writeString(_iter58);
|
||||
}
|
||||
oprot.writeListEnd();
|
||||
}
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
if (struct.values != null) {
|
||||
oprot.writeFieldBegin(VALUES_FIELD_DESC);
|
||||
{
|
||||
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.values.size()));
|
||||
for (TSDataValue _iter59 : struct.values)
|
||||
{
|
||||
_iter59.write(oprot);
|
||||
}
|
||||
oprot.writeListEnd();
|
||||
}
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class TSRowRecordTupleSchemeFactory implements SchemeFactory {
|
||||
public TSRowRecordTupleScheme getScheme() {
|
||||
return new TSRowRecordTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSRowRecordTupleScheme extends TupleScheme<TSRowRecord> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSRowRecord struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
oprot.writeI64(struct.timestamp);
|
||||
{
|
||||
oprot.writeI32(struct.keys.size());
|
||||
for (String _iter60 : struct.keys)
|
||||
{
|
||||
oprot.writeString(_iter60);
|
||||
}
|
||||
}
|
||||
{
|
||||
oprot.writeI32(struct.values.size());
|
||||
for (TSDataValue _iter61 : struct.values)
|
||||
{
|
||||
_iter61.write(oprot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSRowRecord struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.timestamp = iprot.readI64();
|
||||
struct.setTimestampIsSet(true);
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list62 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
|
||||
struct.keys = new ArrayList<String>(_list62.size);
|
||||
for (int _i63 = 0; _i63 < _list62.size; ++_i63)
|
||||
{
|
||||
String _elem64;
|
||||
_elem64 = iprot.readString();
|
||||
struct.keys.add(_elem64);
|
||||
}
|
||||
}
|
||||
struct.setKeysIsSet(true);
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list65 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
|
||||
struct.values = new ArrayList<TSDataValue>(_list65.size);
|
||||
for (int _i66 = 0; _i66 < _list65.size; ++_i66)
|
||||
{
|
||||
TSDataValue _elem67;
|
||||
_elem67 = new TSDataValue();
|
||||
_elem67.read(iprot);
|
||||
struct.values.add(_elem67);
|
||||
}
|
||||
}
|
||||
struct.setValuesIsSet(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,381 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSSetTimeZoneReq implements org.apache.thrift.TBase<TSSetTimeZoneReq, TSSetTimeZoneReq._Fields>, java.io.Serializable, Cloneable, Comparable<TSSetTimeZoneReq> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSSetTimeZoneReq");
|
||||
|
||||
private static final org.apache.thrift.protocol.TField TIME_ZONE_FIELD_DESC = new org.apache.thrift.protocol.TField("timeZone", org.apache.thrift.protocol.TType.STRING, (short)1);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSSetTimeZoneReqStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSSetTimeZoneReqTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public String timeZone; // required
|
||||
|
||||
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
|
||||
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
|
||||
TIME_ZONE((short)1, "timeZone");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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: // TIME_ZONE
|
||||
return TIME_ZONE;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches 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.TIME_ZONE, new org.apache.thrift.meta_data.FieldMetaData("timeZone", 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(TSSetTimeZoneReq.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSSetTimeZoneReq() {
|
||||
}
|
||||
|
||||
public TSSetTimeZoneReq(
|
||||
String timeZone)
|
||||
{
|
||||
this();
|
||||
this.timeZone = timeZone;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSSetTimeZoneReq(TSSetTimeZoneReq other) {
|
||||
if (other.isSetTimeZone()) {
|
||||
this.timeZone = other.timeZone;
|
||||
}
|
||||
}
|
||||
|
||||
public TSSetTimeZoneReq deepCopy() {
|
||||
return new TSSetTimeZoneReq(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.timeZone = null;
|
||||
}
|
||||
|
||||
public String getTimeZone() {
|
||||
return this.timeZone;
|
||||
}
|
||||
|
||||
public TSSetTimeZoneReq setTimeZone(String timeZone) {
|
||||
this.timeZone = timeZone;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetTimeZone() {
|
||||
this.timeZone = null;
|
||||
}
|
||||
|
||||
/** Returns true if field timeZone is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetTimeZone() {
|
||||
return this.timeZone != null;
|
||||
}
|
||||
|
||||
public void setTimeZoneIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.timeZone = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case TIME_ZONE:
|
||||
if (value == null) {
|
||||
unsetTimeZone();
|
||||
} else {
|
||||
setTimeZone((String)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case TIME_ZONE:
|
||||
return getTimeZone();
|
||||
|
||||
}
|
||||
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 TIME_ZONE:
|
||||
return isSetTimeZone();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof TSSetTimeZoneReq)
|
||||
return this.equals((TSSetTimeZoneReq)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSSetTimeZoneReq that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
|
||||
boolean this_present_timeZone = true && this.isSetTimeZone();
|
||||
boolean that_present_timeZone = true && that.isSetTimeZone();
|
||||
if (this_present_timeZone || that_present_timeZone) {
|
||||
if (!(this_present_timeZone && that_present_timeZone))
|
||||
return false;
|
||||
if (!this.timeZone.equals(that.timeZone))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSSetTimeZoneReq other) {
|
||||
if (!getClass().equals(other.getClass())) {
|
||||
return getClass().getName().compareTo(other.getClass().getName());
|
||||
}
|
||||
|
||||
int lastComparison = 0;
|
||||
|
||||
lastComparison = Boolean.valueOf(isSetTimeZone()).compareTo(other.isSetTimeZone());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetTimeZone()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeZone, other.timeZone);
|
||||
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("TSSetTimeZoneReq(");
|
||||
boolean first = true;
|
||||
|
||||
sb.append("timeZone:");
|
||||
if (this.timeZone == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.timeZone);
|
||||
}
|
||||
first = false;
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
if (timeZone == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'timeZone' was not present! 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 TSSetTimeZoneReqStandardSchemeFactory implements SchemeFactory {
|
||||
public TSSetTimeZoneReqStandardScheme getScheme() {
|
||||
return new TSSetTimeZoneReqStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSSetTimeZoneReqStandardScheme extends StandardScheme<TSSetTimeZoneReq> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSSetTimeZoneReq struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.TField schemeField;
|
||||
iprot.readStructBegin();
|
||||
while (true)
|
||||
{
|
||||
schemeField = iprot.readFieldBegin();
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
|
||||
break;
|
||||
}
|
||||
switch (schemeField.id) {
|
||||
case 1: // TIME_ZONE
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
struct.timeZone = iprot.readString();
|
||||
struct.setTimeZoneIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSSetTimeZoneReq struct) throws org.apache.thrift.TException {
|
||||
struct.validate();
|
||||
|
||||
oprot.writeStructBegin(STRUCT_DESC);
|
||||
if (struct.timeZone != null) {
|
||||
oprot.writeFieldBegin(TIME_ZONE_FIELD_DESC);
|
||||
oprot.writeString(struct.timeZone);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class TSSetTimeZoneReqTupleSchemeFactory implements SchemeFactory {
|
||||
public TSSetTimeZoneReqTupleScheme getScheme() {
|
||||
return new TSSetTimeZoneReqTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSSetTimeZoneReqTupleScheme extends TupleScheme<TSSetTimeZoneReq> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSSetTimeZoneReq struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
oprot.writeString(struct.timeZone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSSetTimeZoneReq struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.timeZone = iprot.readString();
|
||||
struct.setTimeZoneIsSet(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,386 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TSSetTimeZoneResp implements org.apache.thrift.TBase<TSSetTimeZoneResp, TSSetTimeZoneResp._Fields>, java.io.Serializable, Cloneable, Comparable<TSSetTimeZoneResp> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSSetTimeZoneResp");
|
||||
|
||||
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TSSetTimeZoneRespStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TSSetTimeZoneRespTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public TS_Status 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<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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, TS_Status.class)));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSSetTimeZoneResp.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TSSetTimeZoneResp() {
|
||||
}
|
||||
|
||||
public TSSetTimeZoneResp(
|
||||
TS_Status status)
|
||||
{
|
||||
this();
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TSSetTimeZoneResp(TSSetTimeZoneResp other) {
|
||||
if (other.isSetStatus()) {
|
||||
this.status = new TS_Status(other.status);
|
||||
}
|
||||
}
|
||||
|
||||
public TSSetTimeZoneResp deepCopy() {
|
||||
return new TSSetTimeZoneResp(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.status = null;
|
||||
}
|
||||
|
||||
public TS_Status getStatus() {
|
||||
return this.status;
|
||||
}
|
||||
|
||||
public TSSetTimeZoneResp setStatus(TS_Status status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
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((TS_Status)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 TSSetTimeZoneResp)
|
||||
return this.equals((TSSetTimeZoneResp)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TSSetTimeZoneResp 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() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TSSetTimeZoneResp 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("TSSetTimeZoneResp(");
|
||||
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 (status == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' was not present! 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 TSSetTimeZoneRespStandardSchemeFactory implements SchemeFactory {
|
||||
public TSSetTimeZoneRespStandardScheme getScheme() {
|
||||
return new TSSetTimeZoneRespStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSSetTimeZoneRespStandardScheme extends StandardScheme<TSSetTimeZoneResp> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TSSetTimeZoneResp struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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 TS_Status();
|
||||
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();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TSSetTimeZoneResp 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 TSSetTimeZoneRespTupleSchemeFactory implements SchemeFactory {
|
||||
public TSSetTimeZoneRespTupleScheme getScheme() {
|
||||
return new TSSetTimeZoneRespTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TSSetTimeZoneRespTupleScheme extends TupleScheme<TSSetTimeZoneResp> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TSSetTimeZoneResp struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
struct.status.write(oprot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TSSetTimeZoneResp struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.status = new TS_Status();
|
||||
struct.status.read(iprot);
|
||||
struct.setStatusIsSet(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,386 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TS_SessionHandle implements org.apache.thrift.TBase<TS_SessionHandle, TS_SessionHandle._Fields>, java.io.Serializable, Cloneable, Comparable<TS_SessionHandle> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TS_SessionHandle");
|
||||
|
||||
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TS_SessionHandleStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TS_SessionHandleTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public TSHandleIdentifier 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<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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, TSHandleIdentifier.class)));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TS_SessionHandle.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TS_SessionHandle() {
|
||||
}
|
||||
|
||||
public TS_SessionHandle(
|
||||
TSHandleIdentifier sessionId)
|
||||
{
|
||||
this();
|
||||
this.sessionId = sessionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TS_SessionHandle(TS_SessionHandle other) {
|
||||
if (other.isSetSessionId()) {
|
||||
this.sessionId = new TSHandleIdentifier(other.sessionId);
|
||||
}
|
||||
}
|
||||
|
||||
public TS_SessionHandle deepCopy() {
|
||||
return new TS_SessionHandle(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.sessionId = null;
|
||||
}
|
||||
|
||||
public TSHandleIdentifier getSessionId() {
|
||||
return this.sessionId;
|
||||
}
|
||||
|
||||
public TS_SessionHandle setSessionId(TSHandleIdentifier sessionId) {
|
||||
this.sessionId = sessionId;
|
||||
return this;
|
||||
}
|
||||
|
||||
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((TSHandleIdentifier)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 TS_SessionHandle)
|
||||
return this.equals((TS_SessionHandle)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TS_SessionHandle 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() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TS_SessionHandle 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("TS_SessionHandle(");
|
||||
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 (sessionId == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionId' was not present! 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 TS_SessionHandleStandardSchemeFactory implements SchemeFactory {
|
||||
public TS_SessionHandleStandardScheme getScheme() {
|
||||
return new TS_SessionHandleStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TS_SessionHandleStandardScheme extends StandardScheme<TS_SessionHandle> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TS_SessionHandle struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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 TSHandleIdentifier();
|
||||
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();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TS_SessionHandle 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 TS_SessionHandleTupleSchemeFactory implements SchemeFactory {
|
||||
public TS_SessionHandleTupleScheme getScheme() {
|
||||
return new TS_SessionHandleTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TS_SessionHandleTupleScheme extends TupleScheme<TS_SessionHandle> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TS_SessionHandle struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
struct.sessionId.write(oprot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TS_SessionHandle struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.sessionId = new TSHandleIdentifier();
|
||||
struct.sessionId.read(iprot);
|
||||
struct.setSessionIdIsSet(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,855 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.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.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TS_Status implements org.apache.thrift.TBase<TS_Status, TS_Status._Fields>, java.io.Serializable, Cloneable, Comparable<TS_Status> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TS_Status");
|
||||
|
||||
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TS_StatusStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TS_StatusTupleSchemeFactory());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see TS_StatusCode
|
||||
*/
|
||||
public TS_StatusCode statusCode; // required
|
||||
public List<String> infoMessages; // optional
|
||||
public String sqlState; // optional
|
||||
public int errorCode; // optional
|
||||
public 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 TS_StatusCode
|
||||
*/
|
||||
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<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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 _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, TS_StatusCode.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(TS_Status.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TS_Status() {
|
||||
}
|
||||
|
||||
public TS_Status(
|
||||
TS_StatusCode statusCode)
|
||||
{
|
||||
this();
|
||||
this.statusCode = statusCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TS_Status(TS_Status other) {
|
||||
__isset_bitfield = other.__isset_bitfield;
|
||||
if (other.isSetStatusCode()) {
|
||||
this.statusCode = other.statusCode;
|
||||
}
|
||||
if (other.isSetInfoMessages()) {
|
||||
List<String> __this__infoMessages = new ArrayList<String>(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 TS_Status deepCopy() {
|
||||
return new TS_Status(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.statusCode = null;
|
||||
this.infoMessages = null;
|
||||
this.sqlState = null;
|
||||
setErrorCodeIsSet(false);
|
||||
this.errorCode = 0;
|
||||
this.errorMessage = null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see TS_StatusCode
|
||||
*/
|
||||
public TS_StatusCode getStatusCode() {
|
||||
return this.statusCode;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see TS_StatusCode
|
||||
*/
|
||||
public TS_Status setStatusCode(TS_StatusCode statusCode) {
|
||||
this.statusCode = statusCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
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<String> getInfoMessagesIterator() {
|
||||
return (this.infoMessages == null) ? null : this.infoMessages.iterator();
|
||||
}
|
||||
|
||||
public void addToInfoMessages(String elem) {
|
||||
if (this.infoMessages == null) {
|
||||
this.infoMessages = new ArrayList<String>();
|
||||
}
|
||||
this.infoMessages.add(elem);
|
||||
}
|
||||
|
||||
public List<String> getInfoMessages() {
|
||||
return this.infoMessages;
|
||||
}
|
||||
|
||||
public TS_Status setInfoMessages(List<String> infoMessages) {
|
||||
this.infoMessages = infoMessages;
|
||||
return this;
|
||||
}
|
||||
|
||||
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 TS_Status setSqlState(String sqlState) {
|
||||
this.sqlState = sqlState;
|
||||
return this;
|
||||
}
|
||||
|
||||
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 TS_Status setErrorCode(int errorCode) {
|
||||
this.errorCode = errorCode;
|
||||
setErrorCodeIsSet(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
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 TS_Status setErrorMessage(String errorMessage) {
|
||||
this.errorMessage = errorMessage;
|
||||
return this;
|
||||
}
|
||||
|
||||
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((TS_StatusCode)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case INFO_MESSAGES:
|
||||
if (value == null) {
|
||||
unsetInfoMessages();
|
||||
} else {
|
||||
setInfoMessages((List<String>)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 Integer.valueOf(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 TS_Status)
|
||||
return this.equals((TS_Status)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TS_Status 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() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TS_Status 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("TS_Status(");
|
||||
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 (statusCode == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'statusCode' was not present! 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 TS_StatusStandardSchemeFactory implements SchemeFactory {
|
||||
public TS_StatusStandardScheme getScheme() {
|
||||
return new TS_StatusStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TS_StatusStandardScheme extends StandardScheme<TS_Status> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TS_Status struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.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 = TS_StatusCode.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 _list0 = iprot.readListBegin();
|
||||
struct.infoMessages = new ArrayList<String>(_list0.size);
|
||||
for (int _i1 = 0; _i1 < _list0.size; ++_i1)
|
||||
{
|
||||
String _elem2;
|
||||
_elem2 = iprot.readString();
|
||||
struct.infoMessages.add(_elem2);
|
||||
}
|
||||
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();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, TS_Status 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 _iter3 : struct.infoMessages)
|
||||
{
|
||||
oprot.writeString(_iter3);
|
||||
}
|
||||
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 TS_StatusTupleSchemeFactory implements SchemeFactory {
|
||||
public TS_StatusTupleScheme getScheme() {
|
||||
return new TS_StatusTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TS_StatusTupleScheme extends TupleScheme<TS_Status> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TS_Status 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 _iter4 : struct.infoMessages)
|
||||
{
|
||||
oprot.writeString(_iter4);
|
||||
}
|
||||
}
|
||||
}
|
||||
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, TS_Status struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.statusCode = TS_StatusCode.findByValue(iprot.readI32());
|
||||
struct.setStatusCodeIsSet(true);
|
||||
BitSet incoming = iprot.readBitSet(4);
|
||||
if (incoming.get(0)) {
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
|
||||
struct.infoMessages = new ArrayList<String>(_list5.size);
|
||||
for (int _i6 = 0; _i6 < _list5.size; ++_i6)
|
||||
{
|
||||
String _elem7;
|
||||
_elem7 = iprot.readString();
|
||||
struct.infoMessages.add(_elem7);
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.service.rpc.thrift;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import org.apache.thrift.TEnum;
|
||||
|
||||
public enum TS_StatusCode 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 TS_StatusCode(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 TS_StatusCode 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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.tsfile.format;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import org.apache.thrift.TEnum;
|
||||
|
||||
/**
|
||||
* Supported compression algorithms.
|
||||
*/
|
||||
public enum CompressionType implements org.apache.thrift.TEnum {
|
||||
UNCOMPRESSED(0),
|
||||
SNAPPY(1),
|
||||
GZIP(2),
|
||||
LZO(3),
|
||||
SDT(4),
|
||||
PAA(5),
|
||||
PLA(6);
|
||||
|
||||
private final int value;
|
||||
|
||||
private CompressionType(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 CompressionType findByValue(int value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return UNCOMPRESSED;
|
||||
case 1:
|
||||
return SNAPPY;
|
||||
case 2:
|
||||
return GZIP;
|
||||
case 3:
|
||||
return LZO;
|
||||
case 4:
|
||||
return SDT;
|
||||
case 5:
|
||||
return PAA;
|
||||
case 6:
|
||||
return PLA;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.tsfile.format;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import org.apache.thrift.TEnum;
|
||||
|
||||
/**
|
||||
* Common types used by frameworks(e.g. hive, pig) using TSFile. This helps map
|
||||
* between types in those frameworks to the base types in TSFile. This is only
|
||||
* metadata and not needed to read or write the data.
|
||||
*
|
||||
* hold this place for future extension
|
||||
*/
|
||||
public enum ConvertedType implements org.apache.thrift.TEnum {
|
||||
/**
|
||||
* a BYTE_ARRAY actually contains UTF8 encoded chars
|
||||
*/
|
||||
UTF8(0);
|
||||
|
||||
private final int value;
|
||||
|
||||
private ConvertedType(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 ConvertedType findByValue(int value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return UTF8;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,75 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.tsfile.format;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import org.apache.thrift.TEnum;
|
||||
|
||||
/**
|
||||
* Types supported by TSFile. These types are intended to be used in combination
|
||||
* with the encodings to control the on disk storage format.
|
||||
* For example INT16 is not included as a type since a good encoding of INT32
|
||||
* would handle this.
|
||||
*/
|
||||
public enum DataType implements org.apache.thrift.TEnum {
|
||||
BOOLEAN(0),
|
||||
INT32(1),
|
||||
INT64(2),
|
||||
INT96(3),
|
||||
FLOAT(4),
|
||||
DOUBLE(5),
|
||||
TEXT(6),
|
||||
FIXED_LEN_BYTE_ARRAY(7),
|
||||
ENUMS(8),
|
||||
BIGDECIMAL(9);
|
||||
|
||||
private final int value;
|
||||
|
||||
private DataType(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 DataType findByValue(int value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return BOOLEAN;
|
||||
case 1:
|
||||
return INT32;
|
||||
case 2:
|
||||
return INT64;
|
||||
case 3:
|
||||
return INT96;
|
||||
case 4:
|
||||
return FLOAT;
|
||||
case 5:
|
||||
return DOUBLE;
|
||||
case 6:
|
||||
return TEXT;
|
||||
case 7:
|
||||
return FIXED_LEN_BYTE_ARRAY;
|
||||
case 8:
|
||||
return ENUMS;
|
||||
case 9:
|
||||
return BIGDECIMAL;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,729 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.2)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.tsfile.format;
|
||||
|
||||
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"})
|
||||
/**
|
||||
* Description for a delta object
|
||||
*/
|
||||
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-11-2")
|
||||
public class DeltaObject implements org.apache.thrift.TBase<DeltaObject, DeltaObject._Fields>, java.io.Serializable, Cloneable, Comparable<DeltaObject> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DeltaObject");
|
||||
|
||||
private static final org.apache.thrift.protocol.TField OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("offset", org.apache.thrift.protocol.TType.I64, (short)1);
|
||||
private static final org.apache.thrift.protocol.TField METADATA_BLOCK_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("metadata_block_size", org.apache.thrift.protocol.TType.I32, (short)2);
|
||||
private static final org.apache.thrift.protocol.TField START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("start_time", org.apache.thrift.protocol.TType.I64, (short)3);
|
||||
private static final org.apache.thrift.protocol.TField END_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("end_time", org.apache.thrift.protocol.TType.I64, (short)4);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new DeltaObjectStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new DeltaObjectTupleSchemeFactory());
|
||||
}
|
||||
|
||||
/**
|
||||
* start position of RowGroupMetadataBlock in file *
|
||||
*/
|
||||
public long offset; // required
|
||||
/**
|
||||
* size of RowGroupMetadataBlock in byte *
|
||||
*/
|
||||
public int metadata_block_size; // required
|
||||
/**
|
||||
* start time *
|
||||
*/
|
||||
public long start_time; // required
|
||||
/**
|
||||
* end time *
|
||||
*/
|
||||
public long end_time; // required
|
||||
|
||||
/** 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 position of RowGroupMetadataBlock in file *
|
||||
*/
|
||||
OFFSET((short)1, "offset"),
|
||||
/**
|
||||
* size of RowGroupMetadataBlock in byte *
|
||||
*/
|
||||
METADATA_BLOCK_SIZE((short)2, "metadata_block_size"),
|
||||
/**
|
||||
* start time *
|
||||
*/
|
||||
START_TIME((short)3, "start_time"),
|
||||
/**
|
||||
* end time *
|
||||
*/
|
||||
END_TIME((short)4, "end_time");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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: // OFFSET
|
||||
return OFFSET;
|
||||
case 2: // METADATA_BLOCK_SIZE
|
||||
return METADATA_BLOCK_SIZE;
|
||||
case 3: // START_TIME
|
||||
return START_TIME;
|
||||
case 4: // END_TIME
|
||||
return END_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 __OFFSET_ISSET_ID = 0;
|
||||
private static final int __METADATA_BLOCK_SIZE_ISSET_ID = 1;
|
||||
private static final int __START_TIME_ISSET_ID = 2;
|
||||
private static final int __END_TIME_ISSET_ID = 3;
|
||||
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.OFFSET, new org.apache.thrift.meta_data.FieldMetaData("offset", org.apache.thrift.TFieldRequirementType.REQUIRED,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
|
||||
tmpMap.put(_Fields.METADATA_BLOCK_SIZE, new org.apache.thrift.meta_data.FieldMetaData("metadata_block_size", org.apache.thrift.TFieldRequirementType.REQUIRED,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
|
||||
tmpMap.put(_Fields.START_TIME, new org.apache.thrift.meta_data.FieldMetaData("start_time", org.apache.thrift.TFieldRequirementType.REQUIRED,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
|
||||
tmpMap.put(_Fields.END_TIME, new org.apache.thrift.meta_data.FieldMetaData("end_time", 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(DeltaObject.class, metaDataMap);
|
||||
}
|
||||
|
||||
public DeltaObject() {
|
||||
}
|
||||
|
||||
public DeltaObject(
|
||||
long offset,
|
||||
int metadata_block_size,
|
||||
long start_time,
|
||||
long end_time)
|
||||
{
|
||||
this();
|
||||
this.offset = offset;
|
||||
setOffsetIsSet(true);
|
||||
this.metadata_block_size = metadata_block_size;
|
||||
setMetadata_block_sizeIsSet(true);
|
||||
this.start_time = start_time;
|
||||
setStart_timeIsSet(true);
|
||||
this.end_time = end_time;
|
||||
setEnd_timeIsSet(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public DeltaObject(DeltaObject other) {
|
||||
__isset_bitfield = other.__isset_bitfield;
|
||||
this.offset = other.offset;
|
||||
this.metadata_block_size = other.metadata_block_size;
|
||||
this.start_time = other.start_time;
|
||||
this.end_time = other.end_time;
|
||||
}
|
||||
|
||||
public DeltaObject deepCopy() {
|
||||
return new DeltaObject(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
setOffsetIsSet(false);
|
||||
this.offset = 0;
|
||||
setMetadata_block_sizeIsSet(false);
|
||||
this.metadata_block_size = 0;
|
||||
setStart_timeIsSet(false);
|
||||
this.start_time = 0;
|
||||
setEnd_timeIsSet(false);
|
||||
this.end_time = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* start position of RowGroupMetadataBlock in file *
|
||||
*/
|
||||
public long getOffset() {
|
||||
return this.offset;
|
||||
}
|
||||
|
||||
/**
|
||||
* start position of RowGroupMetadataBlock in file *
|
||||
*/
|
||||
public DeltaObject setOffset(long offset) {
|
||||
this.offset = offset;
|
||||
setOffsetIsSet(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetOffset() {
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OFFSET_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field offset is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetOffset() {
|
||||
return EncodingUtils.testBit(__isset_bitfield, __OFFSET_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setOffsetIsSet(boolean value) {
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OFFSET_ISSET_ID, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* size of RowGroupMetadataBlock in byte *
|
||||
*/
|
||||
public int getMetadata_block_size() {
|
||||
return this.metadata_block_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* size of RowGroupMetadataBlock in byte *
|
||||
*/
|
||||
public DeltaObject setMetadata_block_size(int metadata_block_size) {
|
||||
this.metadata_block_size = metadata_block_size;
|
||||
setMetadata_block_sizeIsSet(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetMetadata_block_size() {
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __METADATA_BLOCK_SIZE_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field metadata_block_size is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetMetadata_block_size() {
|
||||
return EncodingUtils.testBit(__isset_bitfield, __METADATA_BLOCK_SIZE_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setMetadata_block_sizeIsSet(boolean value) {
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __METADATA_BLOCK_SIZE_ISSET_ID, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* start time *
|
||||
*/
|
||||
public long getStart_time() {
|
||||
return this.start_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* start time *
|
||||
*/
|
||||
public DeltaObject setStart_time(long start_time) {
|
||||
this.start_time = start_time;
|
||||
setStart_timeIsSet(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetStart_time() {
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __START_TIME_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field start_time is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetStart_time() {
|
||||
return EncodingUtils.testBit(__isset_bitfield, __START_TIME_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setStart_timeIsSet(boolean value) {
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __START_TIME_ISSET_ID, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* end time *
|
||||
*/
|
||||
public long getEnd_time() {
|
||||
return this.end_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* end time *
|
||||
*/
|
||||
public DeltaObject setEnd_time(long end_time) {
|
||||
this.end_time = end_time;
|
||||
setEnd_timeIsSet(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetEnd_time() {
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __END_TIME_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field end_time is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetEnd_time() {
|
||||
return EncodingUtils.testBit(__isset_bitfield, __END_TIME_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setEnd_timeIsSet(boolean value) {
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __END_TIME_ISSET_ID, value);
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case OFFSET:
|
||||
if (value == null) {
|
||||
unsetOffset();
|
||||
} else {
|
||||
setOffset((Long)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case METADATA_BLOCK_SIZE:
|
||||
if (value == null) {
|
||||
unsetMetadata_block_size();
|
||||
} else {
|
||||
setMetadata_block_size((Integer)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case START_TIME:
|
||||
if (value == null) {
|
||||
unsetStart_time();
|
||||
} else {
|
||||
setStart_time((Long)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case END_TIME:
|
||||
if (value == null) {
|
||||
unsetEnd_time();
|
||||
} else {
|
||||
setEnd_time((Long)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case OFFSET:
|
||||
return Long.valueOf(getOffset());
|
||||
|
||||
case METADATA_BLOCK_SIZE:
|
||||
return Integer.valueOf(getMetadata_block_size());
|
||||
|
||||
case START_TIME:
|
||||
return Long.valueOf(getStart_time());
|
||||
|
||||
case END_TIME:
|
||||
return Long.valueOf(getEnd_time());
|
||||
|
||||
}
|
||||
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 OFFSET:
|
||||
return isSetOffset();
|
||||
case METADATA_BLOCK_SIZE:
|
||||
return isSetMetadata_block_size();
|
||||
case START_TIME:
|
||||
return isSetStart_time();
|
||||
case END_TIME:
|
||||
return isSetEnd_time();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof DeltaObject)
|
||||
return this.equals((DeltaObject)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(DeltaObject that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
|
||||
boolean this_present_offset = true;
|
||||
boolean that_present_offset = true;
|
||||
if (this_present_offset || that_present_offset) {
|
||||
if (!(this_present_offset && that_present_offset))
|
||||
return false;
|
||||
if (this.offset != that.offset)
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_metadata_block_size = true;
|
||||
boolean that_present_metadata_block_size = true;
|
||||
if (this_present_metadata_block_size || that_present_metadata_block_size) {
|
||||
if (!(this_present_metadata_block_size && that_present_metadata_block_size))
|
||||
return false;
|
||||
if (this.metadata_block_size != that.metadata_block_size)
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_start_time = true;
|
||||
boolean that_present_start_time = true;
|
||||
if (this_present_start_time || that_present_start_time) {
|
||||
if (!(this_present_start_time && that_present_start_time))
|
||||
return false;
|
||||
if (this.start_time != that.start_time)
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_end_time = true;
|
||||
boolean that_present_end_time = true;
|
||||
if (this_present_end_time || that_present_end_time) {
|
||||
if (!(this_present_end_time && that_present_end_time))
|
||||
return false;
|
||||
if (this.end_time != that.end_time)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
List<Object> list = new ArrayList<Object>();
|
||||
|
||||
boolean present_offset = true;
|
||||
list.add(present_offset);
|
||||
if (present_offset)
|
||||
list.add(offset);
|
||||
|
||||
boolean present_metadata_block_size = true;
|
||||
list.add(present_metadata_block_size);
|
||||
if (present_metadata_block_size)
|
||||
list.add(metadata_block_size);
|
||||
|
||||
boolean present_start_time = true;
|
||||
list.add(present_start_time);
|
||||
if (present_start_time)
|
||||
list.add(start_time);
|
||||
|
||||
boolean present_end_time = true;
|
||||
list.add(present_end_time);
|
||||
if (present_end_time)
|
||||
list.add(end_time);
|
||||
|
||||
return list.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(DeltaObject other) {
|
||||
if (!getClass().equals(other.getClass())) {
|
||||
return getClass().getName().compareTo(other.getClass().getName());
|
||||
}
|
||||
|
||||
int lastComparison = 0;
|
||||
|
||||
lastComparison = Boolean.valueOf(isSetOffset()).compareTo(other.isSetOffset());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetOffset()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.offset, other.offset);
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
}
|
||||
lastComparison = Boolean.valueOf(isSetMetadata_block_size()).compareTo(other.isSetMetadata_block_size());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetMetadata_block_size()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metadata_block_size, other.metadata_block_size);
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
}
|
||||
lastComparison = Boolean.valueOf(isSetStart_time()).compareTo(other.isSetStart_time());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetStart_time()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.start_time, other.start_time);
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
}
|
||||
lastComparison = Boolean.valueOf(isSetEnd_time()).compareTo(other.isSetEnd_time());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetEnd_time()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.end_time, other.end_time);
|
||||
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("DeltaObject(");
|
||||
boolean first = true;
|
||||
|
||||
sb.append("offset:");
|
||||
sb.append(this.offset);
|
||||
first = false;
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("metadata_block_size:");
|
||||
sb.append(this.metadata_block_size);
|
||||
first = false;
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("start_time:");
|
||||
sb.append(this.start_time);
|
||||
first = false;
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("end_time:");
|
||||
sb.append(this.end_time);
|
||||
first = false;
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
// alas, we cannot check 'offset' because it's a primitive and you chose the non-beans generator.
|
||||
// alas, we cannot check 'metadata_block_size' because it's a primitive and you chose the non-beans generator.
|
||||
// alas, we cannot check 'start_time' because it's a primitive and you chose the non-beans generator.
|
||||
// alas, we cannot check 'end_time' because it's a primitive and you chose the non-beans generator.
|
||||
// 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 DeltaObjectStandardSchemeFactory implements SchemeFactory {
|
||||
public DeltaObjectStandardScheme getScheme() {
|
||||
return new DeltaObjectStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class DeltaObjectStandardScheme extends StandardScheme<DeltaObject> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, DeltaObject struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.TField schemeField;
|
||||
iprot.readStructBegin();
|
||||
while (true)
|
||||
{
|
||||
schemeField = iprot.readFieldBegin();
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
|
||||
break;
|
||||
}
|
||||
switch (schemeField.id) {
|
||||
case 1: // OFFSET
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
|
||||
struct.offset = iprot.readI64();
|
||||
struct.setOffsetIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 2: // METADATA_BLOCK_SIZE
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
|
||||
struct.metadata_block_size = iprot.readI32();
|
||||
struct.setMetadata_block_sizeIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 3: // START_TIME
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
|
||||
struct.start_time = iprot.readI64();
|
||||
struct.setStart_timeIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 4: // END_TIME
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
|
||||
struct.end_time = iprot.readI64();
|
||||
struct.setEnd_timeIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
if (!struct.isSetOffset()) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'offset' was not found in serialized data! Struct: " + toString());
|
||||
}
|
||||
if (!struct.isSetMetadata_block_size()) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'metadata_block_size' was not found in serialized data! Struct: " + toString());
|
||||
}
|
||||
if (!struct.isSetStart_time()) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'start_time' was not found in serialized data! Struct: " + toString());
|
||||
}
|
||||
if (!struct.isSetEnd_time()) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'end_time' was not found in serialized data! Struct: " + toString());
|
||||
}
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, DeltaObject struct) throws org.apache.thrift.TException {
|
||||
struct.validate();
|
||||
|
||||
oprot.writeStructBegin(STRUCT_DESC);
|
||||
oprot.writeFieldBegin(OFFSET_FIELD_DESC);
|
||||
oprot.writeI64(struct.offset);
|
||||
oprot.writeFieldEnd();
|
||||
oprot.writeFieldBegin(METADATA_BLOCK_SIZE_FIELD_DESC);
|
||||
oprot.writeI32(struct.metadata_block_size);
|
||||
oprot.writeFieldEnd();
|
||||
oprot.writeFieldBegin(START_TIME_FIELD_DESC);
|
||||
oprot.writeI64(struct.start_time);
|
||||
oprot.writeFieldEnd();
|
||||
oprot.writeFieldBegin(END_TIME_FIELD_DESC);
|
||||
oprot.writeI64(struct.end_time);
|
||||
oprot.writeFieldEnd();
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class DeltaObjectTupleSchemeFactory implements SchemeFactory {
|
||||
public DeltaObjectTupleScheme getScheme() {
|
||||
return new DeltaObjectTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class DeltaObjectTupleScheme extends TupleScheme<DeltaObject> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, DeltaObject struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
oprot.writeI64(struct.offset);
|
||||
oprot.writeI32(struct.metadata_block_size);
|
||||
oprot.writeI64(struct.start_time);
|
||||
oprot.writeI64(struct.end_time);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, DeltaObject struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.offset = iprot.readI64();
|
||||
struct.setOffsetIsSet(true);
|
||||
struct.metadata_block_size = iprot.readI32();
|
||||
struct.setMetadata_block_sizeIsSet(true);
|
||||
struct.start_time = iprot.readI64();
|
||||
struct.setStart_timeIsSet(true);
|
||||
struct.end_time = iprot.readI64();
|
||||
struct.setEnd_timeIsSet(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,622 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.tsfile.format;
|
||||
|
||||
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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* TODO: *
|
||||
*/
|
||||
public class DictionaryPageHeader implements org.apache.thrift.TBase<DictionaryPageHeader, DictionaryPageHeader._Fields>, java.io.Serializable, Cloneable, Comparable<DictionaryPageHeader> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DictionaryPageHeader");
|
||||
|
||||
private static final org.apache.thrift.protocol.TField NUM_VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("num_values", org.apache.thrift.protocol.TType.I32, (short)1);
|
||||
private static final org.apache.thrift.protocol.TField ENCODING_FIELD_DESC = new org.apache.thrift.protocol.TField("encoding", org.apache.thrift.protocol.TType.I32, (short)2);
|
||||
private static final org.apache.thrift.protocol.TField IS_SORTED_FIELD_DESC = new org.apache.thrift.protocol.TField("is_sorted", org.apache.thrift.protocol.TType.BOOL, (short)3);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new DictionaryPageHeaderStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new DictionaryPageHeaderTupleSchemeFactory());
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of values in the dictionary *
|
||||
*/
|
||||
public int num_values; // required
|
||||
/**
|
||||
* Encoding using this dictionary page *
|
||||
*
|
||||
* @see Encoding
|
||||
*/
|
||||
public Encoding encoding; // required
|
||||
/**
|
||||
* If true, the entries in the dictionary are sorted in ascending order *
|
||||
*/
|
||||
public boolean is_sorted; // 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 {
|
||||
/**
|
||||
* Number of values in the dictionary *
|
||||
*/
|
||||
NUM_VALUES((short)1, "num_values"),
|
||||
/**
|
||||
* Encoding using this dictionary page *
|
||||
*
|
||||
* @see Encoding
|
||||
*/
|
||||
ENCODING((short)2, "encoding"),
|
||||
/**
|
||||
* If true, the entries in the dictionary are sorted in ascending order *
|
||||
*/
|
||||
IS_SORTED((short)3, "is_sorted");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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: // NUM_VALUES
|
||||
return NUM_VALUES;
|
||||
case 2: // ENCODING
|
||||
return ENCODING;
|
||||
case 3: // IS_SORTED
|
||||
return IS_SORTED;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches 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 __NUM_VALUES_ISSET_ID = 0;
|
||||
private static final int __IS_SORTED_ISSET_ID = 1;
|
||||
private byte __isset_bitfield = 0;
|
||||
private _Fields optionals[] = {_Fields.IS_SORTED};
|
||||
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.NUM_VALUES, new org.apache.thrift.meta_data.FieldMetaData("num_values", org.apache.thrift.TFieldRequirementType.REQUIRED,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
|
||||
tmpMap.put(_Fields.ENCODING, new org.apache.thrift.meta_data.FieldMetaData("encoding", org.apache.thrift.TFieldRequirementType.REQUIRED,
|
||||
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, Encoding.class)));
|
||||
tmpMap.put(_Fields.IS_SORTED, new org.apache.thrift.meta_data.FieldMetaData("is_sorted", 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(DictionaryPageHeader.class, metaDataMap);
|
||||
}
|
||||
|
||||
public DictionaryPageHeader() {
|
||||
}
|
||||
|
||||
public DictionaryPageHeader(
|
||||
int num_values,
|
||||
Encoding encoding)
|
||||
{
|
||||
this();
|
||||
this.num_values = num_values;
|
||||
setNum_valuesIsSet(true);
|
||||
this.encoding = encoding;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public DictionaryPageHeader(DictionaryPageHeader other) {
|
||||
__isset_bitfield = other.__isset_bitfield;
|
||||
this.num_values = other.num_values;
|
||||
if (other.isSetEncoding()) {
|
||||
this.encoding = other.encoding;
|
||||
}
|
||||
this.is_sorted = other.is_sorted;
|
||||
}
|
||||
|
||||
public DictionaryPageHeader deepCopy() {
|
||||
return new DictionaryPageHeader(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
setNum_valuesIsSet(false);
|
||||
this.num_values = 0;
|
||||
this.encoding = null;
|
||||
setIs_sortedIsSet(false);
|
||||
this.is_sorted = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of values in the dictionary *
|
||||
*/
|
||||
public int getNum_values() {
|
||||
return this.num_values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of values in the dictionary *
|
||||
*/
|
||||
public DictionaryPageHeader setNum_values(int num_values) {
|
||||
this.num_values = num_values;
|
||||
setNum_valuesIsSet(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetNum_values() {
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_VALUES_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field num_values is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetNum_values() {
|
||||
return EncodingUtils.testBit(__isset_bitfield, __NUM_VALUES_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setNum_valuesIsSet(boolean value) {
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_VALUES_ISSET_ID, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encoding using this dictionary page *
|
||||
*
|
||||
* @see Encoding
|
||||
*/
|
||||
public Encoding getEncoding() {
|
||||
return this.encoding;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encoding using this dictionary page *
|
||||
*
|
||||
* @see Encoding
|
||||
*/
|
||||
public DictionaryPageHeader setEncoding(Encoding encoding) {
|
||||
this.encoding = encoding;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetEncoding() {
|
||||
this.encoding = null;
|
||||
}
|
||||
|
||||
/** Returns true if field encoding is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetEncoding() {
|
||||
return this.encoding != null;
|
||||
}
|
||||
|
||||
public void setEncodingIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.encoding = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* If true, the entries in the dictionary are sorted in ascending order *
|
||||
*/
|
||||
public boolean isIs_sorted() {
|
||||
return this.is_sorted;
|
||||
}
|
||||
|
||||
/**
|
||||
* If true, the entries in the dictionary are sorted in ascending order *
|
||||
*/
|
||||
public DictionaryPageHeader setIs_sorted(boolean is_sorted) {
|
||||
this.is_sorted = is_sorted;
|
||||
setIs_sortedIsSet(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetIs_sorted() {
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __IS_SORTED_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field is_sorted is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetIs_sorted() {
|
||||
return EncodingUtils.testBit(__isset_bitfield, __IS_SORTED_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setIs_sortedIsSet(boolean value) {
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __IS_SORTED_ISSET_ID, value);
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case NUM_VALUES:
|
||||
if (value == null) {
|
||||
unsetNum_values();
|
||||
} else {
|
||||
setNum_values((Integer)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case ENCODING:
|
||||
if (value == null) {
|
||||
unsetEncoding();
|
||||
} else {
|
||||
setEncoding((Encoding)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case IS_SORTED:
|
||||
if (value == null) {
|
||||
unsetIs_sorted();
|
||||
} else {
|
||||
setIs_sorted((Boolean)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case NUM_VALUES:
|
||||
return Integer.valueOf(getNum_values());
|
||||
|
||||
case ENCODING:
|
||||
return getEncoding();
|
||||
|
||||
case IS_SORTED:
|
||||
return Boolean.valueOf(isIs_sorted());
|
||||
|
||||
}
|
||||
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 NUM_VALUES:
|
||||
return isSetNum_values();
|
||||
case ENCODING:
|
||||
return isSetEncoding();
|
||||
case IS_SORTED:
|
||||
return isSetIs_sorted();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof DictionaryPageHeader)
|
||||
return this.equals((DictionaryPageHeader)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(DictionaryPageHeader that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
|
||||
boolean this_present_num_values = true;
|
||||
boolean that_present_num_values = true;
|
||||
if (this_present_num_values || that_present_num_values) {
|
||||
if (!(this_present_num_values && that_present_num_values))
|
||||
return false;
|
||||
if (this.num_values != that.num_values)
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_encoding = true && this.isSetEncoding();
|
||||
boolean that_present_encoding = true && that.isSetEncoding();
|
||||
if (this_present_encoding || that_present_encoding) {
|
||||
if (!(this_present_encoding && that_present_encoding))
|
||||
return false;
|
||||
if (!this.encoding.equals(that.encoding))
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_is_sorted = true && this.isSetIs_sorted();
|
||||
boolean that_present_is_sorted = true && that.isSetIs_sorted();
|
||||
if (this_present_is_sorted || that_present_is_sorted) {
|
||||
if (!(this_present_is_sorted && that_present_is_sorted))
|
||||
return false;
|
||||
if (this.is_sorted != that.is_sorted)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(DictionaryPageHeader other) {
|
||||
if (!getClass().equals(other.getClass())) {
|
||||
return getClass().getName().compareTo(other.getClass().getName());
|
||||
}
|
||||
|
||||
int lastComparison = 0;
|
||||
|
||||
lastComparison = Boolean.valueOf(isSetNum_values()).compareTo(other.isSetNum_values());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetNum_values()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_values, other.num_values);
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
}
|
||||
lastComparison = Boolean.valueOf(isSetEncoding()).compareTo(other.isSetEncoding());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetEncoding()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.encoding, other.encoding);
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
}
|
||||
lastComparison = Boolean.valueOf(isSetIs_sorted()).compareTo(other.isSetIs_sorted());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetIs_sorted()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.is_sorted, other.is_sorted);
|
||||
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("DictionaryPageHeader(");
|
||||
boolean first = true;
|
||||
|
||||
sb.append("num_values:");
|
||||
sb.append(this.num_values);
|
||||
first = false;
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("encoding:");
|
||||
if (this.encoding == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.encoding);
|
||||
}
|
||||
first = false;
|
||||
if (isSetIs_sorted()) {
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("is_sorted:");
|
||||
sb.append(this.is_sorted);
|
||||
first = false;
|
||||
}
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
// alas, we cannot check 'num_values' because it's a primitive and you chose the non-beans generator.
|
||||
if (encoding == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'encoding' was not present! 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 DictionaryPageHeaderStandardSchemeFactory implements SchemeFactory {
|
||||
public DictionaryPageHeaderStandardScheme getScheme() {
|
||||
return new DictionaryPageHeaderStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class DictionaryPageHeaderStandardScheme extends StandardScheme<DictionaryPageHeader> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, DictionaryPageHeader struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.TField schemeField;
|
||||
iprot.readStructBegin();
|
||||
while (true)
|
||||
{
|
||||
schemeField = iprot.readFieldBegin();
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
|
||||
break;
|
||||
}
|
||||
switch (schemeField.id) {
|
||||
case 1: // NUM_VALUES
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
|
||||
struct.num_values = iprot.readI32();
|
||||
struct.setNum_valuesIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 2: // ENCODING
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
|
||||
struct.encoding = Encoding.findByValue(iprot.readI32());
|
||||
struct.setEncodingIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 3: // IS_SORTED
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
|
||||
struct.is_sorted = iprot.readBool();
|
||||
struct.setIs_sortedIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
if (!struct.isSetNum_values()) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'num_values' was not found in serialized data! Struct: " + toString());
|
||||
}
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, DictionaryPageHeader struct) throws org.apache.thrift.TException {
|
||||
struct.validate();
|
||||
|
||||
oprot.writeStructBegin(STRUCT_DESC);
|
||||
oprot.writeFieldBegin(NUM_VALUES_FIELD_DESC);
|
||||
oprot.writeI32(struct.num_values);
|
||||
oprot.writeFieldEnd();
|
||||
if (struct.encoding != null) {
|
||||
oprot.writeFieldBegin(ENCODING_FIELD_DESC);
|
||||
oprot.writeI32(struct.encoding.getValue());
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
if (struct.isSetIs_sorted()) {
|
||||
oprot.writeFieldBegin(IS_SORTED_FIELD_DESC);
|
||||
oprot.writeBool(struct.is_sorted);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class DictionaryPageHeaderTupleSchemeFactory implements SchemeFactory {
|
||||
public DictionaryPageHeaderTupleScheme getScheme() {
|
||||
return new DictionaryPageHeaderTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class DictionaryPageHeaderTupleScheme extends TupleScheme<DictionaryPageHeader> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, DictionaryPageHeader struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
oprot.writeI32(struct.num_values);
|
||||
oprot.writeI32(struct.encoding.getValue());
|
||||
BitSet optionals = new BitSet();
|
||||
if (struct.isSetIs_sorted()) {
|
||||
optionals.set(0);
|
||||
}
|
||||
oprot.writeBitSet(optionals, 1);
|
||||
if (struct.isSetIs_sorted()) {
|
||||
oprot.writeBool(struct.is_sorted);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, DictionaryPageHeader struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.num_values = iprot.readI32();
|
||||
struct.setNum_valuesIsSet(true);
|
||||
struct.encoding = Encoding.findByValue(iprot.readI32());
|
||||
struct.setEncodingIsSet(true);
|
||||
BitSet incoming = iprot.readBitSet(1);
|
||||
if (incoming.get(0)) {
|
||||
struct.is_sorted = iprot.readBool();
|
||||
struct.setIs_sortedIsSet(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,672 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.tsfile.format;
|
||||
|
||||
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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Digest/statistics per row group and per page
|
||||
* All fields are optional.
|
||||
*/
|
||||
public class Digest implements org.apache.thrift.TBase<Digest, Digest._Fields>, java.io.Serializable, Cloneable, Comparable<Digest> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Digest");
|
||||
|
||||
private static final org.apache.thrift.protocol.TField STATISTICS_FIELD_DESC = new org.apache.thrift.protocol.TField("statistics", org.apache.thrift.protocol.TType.MAP, (short)1);
|
||||
private static final org.apache.thrift.protocol.TField NULL_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("null_count", org.apache.thrift.protocol.TType.I64, (short)2);
|
||||
private static final org.apache.thrift.protocol.TField DISTINCT_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("distinct_count", org.apache.thrift.protocol.TType.I64, (short)3);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new DigestStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new DigestTupleSchemeFactory());
|
||||
}
|
||||
|
||||
/**
|
||||
* Statistics of timeseries, eg. min and max value, sum value
|
||||
*/
|
||||
public Map<String,ByteBuffer> statistics; // optional
|
||||
/**
|
||||
* count of null value in the timeseries
|
||||
*/
|
||||
public long null_count; // optional
|
||||
/**
|
||||
* count of distinct values occurring
|
||||
*/
|
||||
public long distinct_count; // 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 {
|
||||
/**
|
||||
* Statistics of timeseries, eg. min and max value, sum value
|
||||
*/
|
||||
STATISTICS((short)1, "statistics"),
|
||||
/**
|
||||
* count of null value in the timeseries
|
||||
*/
|
||||
NULL_COUNT((short)2, "null_count"),
|
||||
/**
|
||||
* count of distinct values occurring
|
||||
*/
|
||||
DISTINCT_COUNT((short)3, "distinct_count");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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: // STATISTICS
|
||||
return STATISTICS;
|
||||
case 2: // NULL_COUNT
|
||||
return NULL_COUNT;
|
||||
case 3: // DISTINCT_COUNT
|
||||
return DISTINCT_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 __NULL_COUNT_ISSET_ID = 0;
|
||||
private static final int __DISTINCT_COUNT_ISSET_ID = 1;
|
||||
private byte __isset_bitfield = 0;
|
||||
private _Fields optionals[] = {_Fields.STATISTICS,_Fields.NULL_COUNT,_Fields.DISTINCT_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.STATISTICS, new org.apache.thrift.meta_data.FieldMetaData("statistics", 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 , true))));
|
||||
tmpMap.put(_Fields.NULL_COUNT, new org.apache.thrift.meta_data.FieldMetaData("null_count", org.apache.thrift.TFieldRequirementType.OPTIONAL,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
|
||||
tmpMap.put(_Fields.DISTINCT_COUNT, new org.apache.thrift.meta_data.FieldMetaData("distinct_count", 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(Digest.class, metaDataMap);
|
||||
}
|
||||
|
||||
public Digest() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public Digest(Digest other) {
|
||||
__isset_bitfield = other.__isset_bitfield;
|
||||
if (other.isSetStatistics()) {
|
||||
Map<String,ByteBuffer> __this__statistics = new HashMap<String,ByteBuffer>(other.statistics);
|
||||
this.statistics = __this__statistics;
|
||||
}
|
||||
this.null_count = other.null_count;
|
||||
this.distinct_count = other.distinct_count;
|
||||
}
|
||||
|
||||
public Digest deepCopy() {
|
||||
return new Digest(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.statistics = null;
|
||||
setNull_countIsSet(false);
|
||||
this.null_count = 0;
|
||||
setDistinct_countIsSet(false);
|
||||
this.distinct_count = 0;
|
||||
}
|
||||
|
||||
public int getStatisticsSize() {
|
||||
return (this.statistics == null) ? 0 : this.statistics.size();
|
||||
}
|
||||
|
||||
public void putToStatistics(String key, ByteBuffer val) {
|
||||
if (this.statistics == null) {
|
||||
this.statistics = new HashMap<String,ByteBuffer>();
|
||||
}
|
||||
this.statistics.put(key, val);
|
||||
}
|
||||
|
||||
/**
|
||||
* Statistics of timeseries, eg. min and max value, sum value
|
||||
*/
|
||||
public Map<String,ByteBuffer> getStatistics() {
|
||||
return this.statistics;
|
||||
}
|
||||
|
||||
/**
|
||||
* Statistics of timeseries, eg. min and max value, sum value
|
||||
*/
|
||||
public Digest setStatistics(Map<String,ByteBuffer> statistics) {
|
||||
this.statistics = statistics;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetStatistics() {
|
||||
this.statistics = null;
|
||||
}
|
||||
|
||||
/** Returns true if field statistics is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetStatistics() {
|
||||
return this.statistics != null;
|
||||
}
|
||||
|
||||
public void setStatisticsIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.statistics = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* count of null value in the timeseries
|
||||
*/
|
||||
public long getNull_count() {
|
||||
return this.null_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* count of null value in the timeseries
|
||||
*/
|
||||
public Digest setNull_count(long null_count) {
|
||||
this.null_count = null_count;
|
||||
setNull_countIsSet(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetNull_count() {
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NULL_COUNT_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field null_count is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetNull_count() {
|
||||
return EncodingUtils.testBit(__isset_bitfield, __NULL_COUNT_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setNull_countIsSet(boolean value) {
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NULL_COUNT_ISSET_ID, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* count of distinct values occurring
|
||||
*/
|
||||
public long getDistinct_count() {
|
||||
return this.distinct_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* count of distinct values occurring
|
||||
*/
|
||||
public Digest setDistinct_count(long distinct_count) {
|
||||
this.distinct_count = distinct_count;
|
||||
setDistinct_countIsSet(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetDistinct_count() {
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DISTINCT_COUNT_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field distinct_count is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetDistinct_count() {
|
||||
return EncodingUtils.testBit(__isset_bitfield, __DISTINCT_COUNT_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setDistinct_countIsSet(boolean value) {
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DISTINCT_COUNT_ISSET_ID, value);
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case STATISTICS:
|
||||
if (value == null) {
|
||||
unsetStatistics();
|
||||
} else {
|
||||
setStatistics((Map<String,ByteBuffer>)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case NULL_COUNT:
|
||||
if (value == null) {
|
||||
unsetNull_count();
|
||||
} else {
|
||||
setNull_count((Long)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case DISTINCT_COUNT:
|
||||
if (value == null) {
|
||||
unsetDistinct_count();
|
||||
} else {
|
||||
setDistinct_count((Long)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case STATISTICS:
|
||||
return getStatistics();
|
||||
|
||||
case NULL_COUNT:
|
||||
return Long.valueOf(getNull_count());
|
||||
|
||||
case DISTINCT_COUNT:
|
||||
return Long.valueOf(getDistinct_count());
|
||||
|
||||
}
|
||||
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 STATISTICS:
|
||||
return isSetStatistics();
|
||||
case NULL_COUNT:
|
||||
return isSetNull_count();
|
||||
case DISTINCT_COUNT:
|
||||
return isSetDistinct_count();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof Digest)
|
||||
return this.equals((Digest)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(Digest that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
|
||||
boolean this_present_statistics = true && this.isSetStatistics();
|
||||
boolean that_present_statistics = true && that.isSetStatistics();
|
||||
if (this_present_statistics || that_present_statistics) {
|
||||
if (!(this_present_statistics && that_present_statistics))
|
||||
return false;
|
||||
if (!this.statistics.equals(that.statistics))
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_null_count = true && this.isSetNull_count();
|
||||
boolean that_present_null_count = true && that.isSetNull_count();
|
||||
if (this_present_null_count || that_present_null_count) {
|
||||
if (!(this_present_null_count && that_present_null_count))
|
||||
return false;
|
||||
if (this.null_count != that.null_count)
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_distinct_count = true && this.isSetDistinct_count();
|
||||
boolean that_present_distinct_count = true && that.isSetDistinct_count();
|
||||
if (this_present_distinct_count || that_present_distinct_count) {
|
||||
if (!(this_present_distinct_count && that_present_distinct_count))
|
||||
return false;
|
||||
if (this.distinct_count != that.distinct_count)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Digest other) {
|
||||
if (!getClass().equals(other.getClass())) {
|
||||
return getClass().getName().compareTo(other.getClass().getName());
|
||||
}
|
||||
|
||||
int lastComparison = 0;
|
||||
|
||||
lastComparison = Boolean.valueOf(isSetStatistics()).compareTo(other.isSetStatistics());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetStatistics()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.statistics, other.statistics);
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
}
|
||||
lastComparison = Boolean.valueOf(isSetNull_count()).compareTo(other.isSetNull_count());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetNull_count()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.null_count, other.null_count);
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
}
|
||||
lastComparison = Boolean.valueOf(isSetDistinct_count()).compareTo(other.isSetDistinct_count());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetDistinct_count()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.distinct_count, other.distinct_count);
|
||||
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("Digest(");
|
||||
boolean first = true;
|
||||
|
||||
if (isSetStatistics()) {
|
||||
sb.append("statistics:");
|
||||
if (this.statistics == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.statistics);
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
if (isSetNull_count()) {
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("null_count:");
|
||||
sb.append(this.null_count);
|
||||
first = false;
|
||||
}
|
||||
if (isSetDistinct_count()) {
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("distinct_count:");
|
||||
sb.append(this.distinct_count);
|
||||
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 DigestStandardSchemeFactory implements SchemeFactory {
|
||||
public DigestStandardScheme getScheme() {
|
||||
return new DigestStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class DigestStandardScheme extends StandardScheme<Digest> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, Digest struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.TField schemeField;
|
||||
iprot.readStructBegin();
|
||||
while (true)
|
||||
{
|
||||
schemeField = iprot.readFieldBegin();
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
|
||||
break;
|
||||
}
|
||||
switch (schemeField.id) {
|
||||
case 1: // STATISTICS
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
|
||||
{
|
||||
org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin();
|
||||
struct.statistics = new HashMap<String,ByteBuffer>(2*_map0.size);
|
||||
for (int _i1 = 0; _i1 < _map0.size; ++_i1)
|
||||
{
|
||||
String _key2;
|
||||
ByteBuffer _val3;
|
||||
_key2 = iprot.readString();
|
||||
_val3 = iprot.readBinary();
|
||||
struct.statistics.put(_key2, _val3);
|
||||
}
|
||||
iprot.readMapEnd();
|
||||
}
|
||||
struct.setStatisticsIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 2: // NULL_COUNT
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
|
||||
struct.null_count = iprot.readI64();
|
||||
struct.setNull_countIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 3: // DISTINCT_COUNT
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
|
||||
struct.distinct_count = iprot.readI64();
|
||||
struct.setDistinct_countIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, Digest struct) throws org.apache.thrift.TException {
|
||||
struct.validate();
|
||||
|
||||
oprot.writeStructBegin(STRUCT_DESC);
|
||||
if (struct.statistics != null) {
|
||||
if (struct.isSetStatistics()) {
|
||||
oprot.writeFieldBegin(STATISTICS_FIELD_DESC);
|
||||
{
|
||||
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.statistics.size()));
|
||||
for (Map.Entry<String, ByteBuffer> _iter4 : struct.statistics.entrySet())
|
||||
{
|
||||
oprot.writeString(_iter4.getKey());
|
||||
oprot.writeBinary(_iter4.getValue());
|
||||
}
|
||||
oprot.writeMapEnd();
|
||||
}
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
if (struct.isSetNull_count()) {
|
||||
oprot.writeFieldBegin(NULL_COUNT_FIELD_DESC);
|
||||
oprot.writeI64(struct.null_count);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
if (struct.isSetDistinct_count()) {
|
||||
oprot.writeFieldBegin(DISTINCT_COUNT_FIELD_DESC);
|
||||
oprot.writeI64(struct.distinct_count);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class DigestTupleSchemeFactory implements SchemeFactory {
|
||||
public DigestTupleScheme getScheme() {
|
||||
return new DigestTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class DigestTupleScheme extends TupleScheme<Digest> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, Digest struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
BitSet optionals = new BitSet();
|
||||
if (struct.isSetStatistics()) {
|
||||
optionals.set(0);
|
||||
}
|
||||
if (struct.isSetNull_count()) {
|
||||
optionals.set(1);
|
||||
}
|
||||
if (struct.isSetDistinct_count()) {
|
||||
optionals.set(2);
|
||||
}
|
||||
oprot.writeBitSet(optionals, 3);
|
||||
if (struct.isSetStatistics()) {
|
||||
{
|
||||
oprot.writeI32(struct.statistics.size());
|
||||
for (Map.Entry<String, ByteBuffer> _iter5 : struct.statistics.entrySet())
|
||||
{
|
||||
oprot.writeString(_iter5.getKey());
|
||||
oprot.writeBinary(_iter5.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (struct.isSetNull_count()) {
|
||||
oprot.writeI64(struct.null_count);
|
||||
}
|
||||
if (struct.isSetDistinct_count()) {
|
||||
oprot.writeI64(struct.distinct_count);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, Digest struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
BitSet incoming = iprot.readBitSet(3);
|
||||
if (incoming.get(0)) {
|
||||
{
|
||||
org.apache.thrift.protocol.TMap _map6 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
|
||||
struct.statistics = new HashMap<String,ByteBuffer>(2*_map6.size);
|
||||
for (int _i7 = 0; _i7 < _map6.size; ++_i7)
|
||||
{
|
||||
String _key8;
|
||||
ByteBuffer _val9;
|
||||
_key8 = iprot.readString();
|
||||
_val9 = iprot.readBinary();
|
||||
struct.statistics.put(_key8, _val9);
|
||||
}
|
||||
}
|
||||
struct.setStatisticsIsSet(true);
|
||||
}
|
||||
if (incoming.get(1)) {
|
||||
struct.null_count = iprot.readI64();
|
||||
struct.setNull_countIsSet(true);
|
||||
}
|
||||
if (incoming.get(2)) {
|
||||
struct.distinct_count = iprot.readI64();
|
||||
struct.setDistinct_countIsSet(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,144 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.2)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.tsfile.format;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import org.apache.thrift.TEnum;
|
||||
|
||||
/**
|
||||
* Encodings supported by TSFile. Not all encodings are valid for all types.
|
||||
*/
|
||||
public enum Encoding implements org.apache.thrift.TEnum {
|
||||
/**
|
||||
* Default encoding.
|
||||
* BOOLEAN - 1 bit per value. 0 is false; 1 is true.
|
||||
* INT32 - 4 bytes per value. Stored as little-endian.
|
||||
* INT64 - 8 bytes per value. Stored as little-endian.
|
||||
* FLOAT - 4 bytes per value. IEEE. Stored as little-endian.
|
||||
* DOUBLE - 8 bytes per value. IEEE. Stored as little-endian.
|
||||
* BYTE_ARRAY - 4 byte length stored as little endian, followed by bytes.
|
||||
* FIXED_LEN_BYTE_ARRAY - Just the bytes.
|
||||
* ENUMS - 1 byte per value. Stored as little-endian.
|
||||
*/
|
||||
PLAIN(0),
|
||||
/**
|
||||
* Deprecated: Dictionary encoding. The values in the dictionary are encoded in the
|
||||
* plain type.
|
||||
* in a data page use RLE_DICTIONARY instead.
|
||||
* in a Dictionary page use PLAIN instead
|
||||
*/
|
||||
PLAIN_DICTIONARY(2),
|
||||
/**
|
||||
* Group packed run length encoding. Usable for Booleans
|
||||
* (on one bit: 0 is false; 1 is true.)
|
||||
*/
|
||||
RLE(3),
|
||||
/**
|
||||
* Delta encoding for integers. This can be used for series of int values and works best
|
||||
* on sorted data
|
||||
*/
|
||||
DELTA_BINARY_PACKED(5),
|
||||
/**
|
||||
* Encoding for byte arrays to separate the length values and the data. The lengths
|
||||
* are encoded using DELTA_BINARY_PACKED
|
||||
*/
|
||||
DELTA_LENGTH_BYTE_ARRAY(6),
|
||||
/**
|
||||
* Incremental-encoded byte array. Prefix lengths are encoded using DELTA_BINARY_PACKED.
|
||||
* Suffixes are stored as delta length byte arrays.
|
||||
*/
|
||||
DELTA_BYTE_ARRAY(7),
|
||||
/**
|
||||
* Dictionary encoding: the ids are encoded using the RLE encoding
|
||||
*/
|
||||
RLE_DICTIONARY(8),
|
||||
/**
|
||||
* First-order difference encoding. Usable for encoding timestamps
|
||||
* in a time series.
|
||||
*/
|
||||
DIFF(9),
|
||||
/**
|
||||
* Second-order difference encoding. Usable for encoding timestamps
|
||||
* in a time series.
|
||||
*/
|
||||
TS_2DIFF(10),
|
||||
/**
|
||||
* Bitmap encoding. Usable for encoding switch values
|
||||
* in a time series.
|
||||
*/
|
||||
BITMAP(11),
|
||||
/**
|
||||
* Piecewise linear approximate
|
||||
*/
|
||||
PLA(12),
|
||||
/**
|
||||
* Swing door transform
|
||||
*/
|
||||
SDT(13),
|
||||
/**
|
||||
* Discrete Fourier transform
|
||||
*/
|
||||
DFT(14),
|
||||
/**
|
||||
* Float encoding used in Gorilla
|
||||
*/
|
||||
GORILLA(15);
|
||||
|
||||
private final int value;
|
||||
|
||||
private Encoding(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 Encoding findByValue(int value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return PLAIN;
|
||||
case 2:
|
||||
return PLAIN_DICTIONARY;
|
||||
case 3:
|
||||
return RLE;
|
||||
case 5:
|
||||
return DELTA_BINARY_PACKED;
|
||||
case 6:
|
||||
return DELTA_LENGTH_BYTE_ARRAY;
|
||||
case 7:
|
||||
return DELTA_BYTE_ARRAY;
|
||||
case 8:
|
||||
return RLE_DICTIONARY;
|
||||
case 9:
|
||||
return DIFF;
|
||||
case 10:
|
||||
return TS_2DIFF;
|
||||
case 11:
|
||||
return BITMAP;
|
||||
case 12:
|
||||
return PLA;
|
||||
case 13:
|
||||
return SDT;
|
||||
case 14:
|
||||
return DFT;
|
||||
case 15:
|
||||
return GORILLA;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,48 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.tsfile.format;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import org.apache.thrift.TEnum;
|
||||
|
||||
public enum FreqType implements org.apache.thrift.TEnum {
|
||||
SINGLE_FREQ(0),
|
||||
MULTI_FREQ(1),
|
||||
IRREGULAR_FREQ(2);
|
||||
|
||||
private final int value;
|
||||
|
||||
private FreqType(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 FreqType findByValue(int value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return SINGLE_FREQ;
|
||||
case 1:
|
||||
return MULTI_FREQ;
|
||||
case 2:
|
||||
return IRREGULAR_FREQ;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,280 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.tsfile.format;
|
||||
|
||||
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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class IndexPageHeader implements org.apache.thrift.TBase<IndexPageHeader, IndexPageHeader._Fields>, java.io.Serializable, Cloneable, Comparable<IndexPageHeader> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("IndexPageHeader");
|
||||
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new IndexPageHeaderStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new IndexPageHeaderTupleSchemeFactory());
|
||||
}
|
||||
|
||||
|
||||
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
|
||||
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
|
||||
;
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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) {
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches 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);
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(IndexPageHeader.class, metaDataMap);
|
||||
}
|
||||
|
||||
public IndexPageHeader() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public IndexPageHeader(IndexPageHeader other) {
|
||||
}
|
||||
|
||||
public IndexPageHeader deepCopy() {
|
||||
return new IndexPageHeader(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
}
|
||||
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) {
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof IndexPageHeader)
|
||||
return this.equals((IndexPageHeader)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(IndexPageHeader that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(IndexPageHeader other) {
|
||||
if (!getClass().equals(other.getClass())) {
|
||||
return getClass().getName().compareTo(other.getClass().getName());
|
||||
}
|
||||
|
||||
int lastComparison = 0;
|
||||
|
||||
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("IndexPageHeader(");
|
||||
boolean first = true;
|
||||
|
||||
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 IndexPageHeaderStandardSchemeFactory implements SchemeFactory {
|
||||
public IndexPageHeaderStandardScheme getScheme() {
|
||||
return new IndexPageHeaderStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class IndexPageHeaderStandardScheme extends StandardScheme<IndexPageHeader> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, IndexPageHeader struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.TField schemeField;
|
||||
iprot.readStructBegin();
|
||||
while (true)
|
||||
{
|
||||
schemeField = iprot.readFieldBegin();
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
|
||||
break;
|
||||
}
|
||||
switch (schemeField.id) {
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, IndexPageHeader struct) throws org.apache.thrift.TException {
|
||||
struct.validate();
|
||||
|
||||
oprot.writeStructBegin(STRUCT_DESC);
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class IndexPageHeaderTupleSchemeFactory implements SchemeFactory {
|
||||
public IndexPageHeaderTupleScheme getScheme() {
|
||||
return new IndexPageHeaderTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class IndexPageHeaderTupleScheme extends TupleScheme<IndexPageHeader> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, IndexPageHeader struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, IndexPageHeader struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1,48 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.tsfile.format;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import org.apache.thrift.TEnum;
|
||||
|
||||
public enum PageType implements org.apache.thrift.TEnum {
|
||||
DATA_PAGE(0),
|
||||
INDEX_PAGE(1),
|
||||
DICTIONARY_PAGE(2);
|
||||
|
||||
private final int value;
|
||||
|
||||
private PageType(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 PageType findByValue(int value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return DATA_PAGE;
|
||||
case 1:
|
||||
return INDEX_PAGE;
|
||||
case 2:
|
||||
return DICTIONARY_PAGE;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,556 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.2)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.tsfile.format;
|
||||
|
||||
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.2)", date = "2017-11-20")
|
||||
public class RowGroupBlockMetaData implements org.apache.thrift.TBase<RowGroupBlockMetaData, RowGroupBlockMetaData._Fields>, java.io.Serializable, Cloneable, Comparable<RowGroupBlockMetaData> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RowGroupBlockMetaData");
|
||||
|
||||
private static final org.apache.thrift.protocol.TField ROW_GROUPS_METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("row_groups_metadata", org.apache.thrift.protocol.TType.LIST, (short)1);
|
||||
private static final org.apache.thrift.protocol.TField DELTA_OBJECT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("delta_object_id", org.apache.thrift.protocol.TType.STRING, (short)2);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new RowGroupBlockMetaDataStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new RowGroupBlockMetaDataTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public List<RowGroupMetaData> row_groups_metadata; // required
|
||||
public String delta_object_id; // 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 {
|
||||
ROW_GROUPS_METADATA((short)1, "row_groups_metadata"),
|
||||
DELTA_OBJECT_ID((short)2, "delta_object_id");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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: // ROW_GROUPS_METADATA
|
||||
return ROW_GROUPS_METADATA;
|
||||
case 2: // DELTA_OBJECT_ID
|
||||
return DELTA_OBJECT_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
|
||||
private static final _Fields optionals[] = {_Fields.DELTA_OBJECT_ID};
|
||||
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.ROW_GROUPS_METADATA, new org.apache.thrift.meta_data.FieldMetaData("row_groups_metadata", 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, RowGroupMetaData.class))));
|
||||
tmpMap.put(_Fields.DELTA_OBJECT_ID, new org.apache.thrift.meta_data.FieldMetaData("delta_object_id", 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(RowGroupBlockMetaData.class, metaDataMap);
|
||||
}
|
||||
|
||||
public RowGroupBlockMetaData() {
|
||||
}
|
||||
|
||||
public RowGroupBlockMetaData(
|
||||
List<RowGroupMetaData> row_groups_metadata)
|
||||
{
|
||||
this();
|
||||
this.row_groups_metadata = row_groups_metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public RowGroupBlockMetaData(RowGroupBlockMetaData other) {
|
||||
if (other.isSetRow_groups_metadata()) {
|
||||
List<RowGroupMetaData> __this__row_groups_metadata = new ArrayList<RowGroupMetaData>(other.row_groups_metadata.size());
|
||||
for (RowGroupMetaData other_element : other.row_groups_metadata) {
|
||||
__this__row_groups_metadata.add(new RowGroupMetaData(other_element));
|
||||
}
|
||||
this.row_groups_metadata = __this__row_groups_metadata;
|
||||
}
|
||||
if (other.isSetDelta_object_id()) {
|
||||
this.delta_object_id = other.delta_object_id;
|
||||
}
|
||||
}
|
||||
|
||||
public RowGroupBlockMetaData deepCopy() {
|
||||
return new RowGroupBlockMetaData(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.row_groups_metadata = null;
|
||||
this.delta_object_id = null;
|
||||
}
|
||||
|
||||
public int getRow_groups_metadataSize() {
|
||||
return (this.row_groups_metadata == null) ? 0 : this.row_groups_metadata.size();
|
||||
}
|
||||
|
||||
public java.util.Iterator<RowGroupMetaData> getRow_groups_metadataIterator() {
|
||||
return (this.row_groups_metadata == null) ? null : this.row_groups_metadata.iterator();
|
||||
}
|
||||
|
||||
public void addToRow_groups_metadata(RowGroupMetaData elem) {
|
||||
if (this.row_groups_metadata == null) {
|
||||
this.row_groups_metadata = new ArrayList<RowGroupMetaData>();
|
||||
}
|
||||
this.row_groups_metadata.add(elem);
|
||||
}
|
||||
|
||||
public List<RowGroupMetaData> getRow_groups_metadata() {
|
||||
return this.row_groups_metadata;
|
||||
}
|
||||
|
||||
public RowGroupBlockMetaData setRow_groups_metadata(List<RowGroupMetaData> row_groups_metadata) {
|
||||
this.row_groups_metadata = row_groups_metadata;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetRow_groups_metadata() {
|
||||
this.row_groups_metadata = null;
|
||||
}
|
||||
|
||||
/** Returns true if field row_groups_metadata is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetRow_groups_metadata() {
|
||||
return this.row_groups_metadata != null;
|
||||
}
|
||||
|
||||
public void setRow_groups_metadataIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.row_groups_metadata = null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getDelta_object_id() {
|
||||
return this.delta_object_id;
|
||||
}
|
||||
|
||||
public RowGroupBlockMetaData setDelta_object_id(String delta_object_id) {
|
||||
this.delta_object_id = delta_object_id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetDelta_object_id() {
|
||||
this.delta_object_id = null;
|
||||
}
|
||||
|
||||
/** Returns true if field delta_object_id is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetDelta_object_id() {
|
||||
return this.delta_object_id != null;
|
||||
}
|
||||
|
||||
public void setDelta_object_idIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.delta_object_id = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case ROW_GROUPS_METADATA:
|
||||
if (value == null) {
|
||||
unsetRow_groups_metadata();
|
||||
} else {
|
||||
setRow_groups_metadata((List<RowGroupMetaData>)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case DELTA_OBJECT_ID:
|
||||
if (value == null) {
|
||||
unsetDelta_object_id();
|
||||
} else {
|
||||
setDelta_object_id((String)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case ROW_GROUPS_METADATA:
|
||||
return getRow_groups_metadata();
|
||||
|
||||
case DELTA_OBJECT_ID:
|
||||
return getDelta_object_id();
|
||||
|
||||
}
|
||||
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 ROW_GROUPS_METADATA:
|
||||
return isSetRow_groups_metadata();
|
||||
case DELTA_OBJECT_ID:
|
||||
return isSetDelta_object_id();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof RowGroupBlockMetaData)
|
||||
return this.equals((RowGroupBlockMetaData)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(RowGroupBlockMetaData that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
|
||||
boolean this_present_row_groups_metadata = true && this.isSetRow_groups_metadata();
|
||||
boolean that_present_row_groups_metadata = true && that.isSetRow_groups_metadata();
|
||||
if (this_present_row_groups_metadata || that_present_row_groups_metadata) {
|
||||
if (!(this_present_row_groups_metadata && that_present_row_groups_metadata))
|
||||
return false;
|
||||
if (!this.row_groups_metadata.equals(that.row_groups_metadata))
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_delta_object_id = true && this.isSetDelta_object_id();
|
||||
boolean that_present_delta_object_id = true && that.isSetDelta_object_id();
|
||||
if (this_present_delta_object_id || that_present_delta_object_id) {
|
||||
if (!(this_present_delta_object_id && that_present_delta_object_id))
|
||||
return false;
|
||||
if (!this.delta_object_id.equals(that.delta_object_id))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
List<Object> list = new ArrayList<Object>();
|
||||
|
||||
boolean present_row_groups_metadata = true && (isSetRow_groups_metadata());
|
||||
list.add(present_row_groups_metadata);
|
||||
if (present_row_groups_metadata)
|
||||
list.add(row_groups_metadata);
|
||||
|
||||
boolean present_delta_object_id = true && (isSetDelta_object_id());
|
||||
list.add(present_delta_object_id);
|
||||
if (present_delta_object_id)
|
||||
list.add(delta_object_id);
|
||||
|
||||
return list.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(RowGroupBlockMetaData other) {
|
||||
if (!getClass().equals(other.getClass())) {
|
||||
return getClass().getName().compareTo(other.getClass().getName());
|
||||
}
|
||||
|
||||
int lastComparison = 0;
|
||||
|
||||
lastComparison = Boolean.valueOf(isSetRow_groups_metadata()).compareTo(other.isSetRow_groups_metadata());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetRow_groups_metadata()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row_groups_metadata, other.row_groups_metadata);
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
}
|
||||
lastComparison = Boolean.valueOf(isSetDelta_object_id()).compareTo(other.isSetDelta_object_id());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetDelta_object_id()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delta_object_id, other.delta_object_id);
|
||||
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("RowGroupBlockMetaData(");
|
||||
boolean first = true;
|
||||
|
||||
sb.append("row_groups_metadata:");
|
||||
if (this.row_groups_metadata == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.row_groups_metadata);
|
||||
}
|
||||
first = false;
|
||||
if (isSetDelta_object_id()) {
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("delta_object_id:");
|
||||
if (this.delta_object_id == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.delta_object_id);
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
if (row_groups_metadata == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'row_groups_metadata' was not present! 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 RowGroupBlockMetaDataStandardSchemeFactory implements SchemeFactory {
|
||||
public RowGroupBlockMetaDataStandardScheme getScheme() {
|
||||
return new RowGroupBlockMetaDataStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class RowGroupBlockMetaDataStandardScheme extends StandardScheme<RowGroupBlockMetaData> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, RowGroupBlockMetaData struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.TField schemeField;
|
||||
iprot.readStructBegin();
|
||||
while (true)
|
||||
{
|
||||
schemeField = iprot.readFieldBegin();
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
|
||||
break;
|
||||
}
|
||||
switch (schemeField.id) {
|
||||
case 1: // ROW_GROUPS_METADATA
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list48 = iprot.readListBegin();
|
||||
struct.row_groups_metadata = new ArrayList<RowGroupMetaData>(_list48.size);
|
||||
RowGroupMetaData _elem49;
|
||||
for (int _i50 = 0; _i50 < _list48.size; ++_i50)
|
||||
{
|
||||
_elem49 = new RowGroupMetaData();
|
||||
_elem49.read(iprot);
|
||||
struct.row_groups_metadata.add(_elem49);
|
||||
}
|
||||
iprot.readListEnd();
|
||||
}
|
||||
struct.setRow_groups_metadataIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 2: // DELTA_OBJECT_ID
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
struct.delta_object_id = iprot.readString();
|
||||
struct.setDelta_object_idIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, RowGroupBlockMetaData struct) throws org.apache.thrift.TException {
|
||||
struct.validate();
|
||||
|
||||
oprot.writeStructBegin(STRUCT_DESC);
|
||||
if (struct.row_groups_metadata != null) {
|
||||
oprot.writeFieldBegin(ROW_GROUPS_METADATA_FIELD_DESC);
|
||||
{
|
||||
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.row_groups_metadata.size()));
|
||||
for (RowGroupMetaData _iter51 : struct.row_groups_metadata)
|
||||
{
|
||||
_iter51.write(oprot);
|
||||
}
|
||||
oprot.writeListEnd();
|
||||
}
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
if (struct.delta_object_id != null) {
|
||||
if (struct.isSetDelta_object_id()) {
|
||||
oprot.writeFieldBegin(DELTA_OBJECT_ID_FIELD_DESC);
|
||||
oprot.writeString(struct.delta_object_id);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class RowGroupBlockMetaDataTupleSchemeFactory implements SchemeFactory {
|
||||
public RowGroupBlockMetaDataTupleScheme getScheme() {
|
||||
return new RowGroupBlockMetaDataTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class RowGroupBlockMetaDataTupleScheme extends TupleScheme<RowGroupBlockMetaData> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, RowGroupBlockMetaData struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
{
|
||||
oprot.writeI32(struct.row_groups_metadata.size());
|
||||
for (RowGroupMetaData _iter52 : struct.row_groups_metadata)
|
||||
{
|
||||
_iter52.write(oprot);
|
||||
}
|
||||
}
|
||||
BitSet optionals = new BitSet();
|
||||
if (struct.isSetDelta_object_id()) {
|
||||
optionals.set(0);
|
||||
}
|
||||
oprot.writeBitSet(optionals, 1);
|
||||
if (struct.isSetDelta_object_id()) {
|
||||
oprot.writeString(struct.delta_object_id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, RowGroupBlockMetaData struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list53 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
|
||||
struct.row_groups_metadata = new ArrayList<RowGroupMetaData>(_list53.size);
|
||||
RowGroupMetaData _elem54;
|
||||
for (int _i55 = 0; _i55 < _list53.size; ++_i55)
|
||||
{
|
||||
_elem54 = new RowGroupMetaData();
|
||||
_elem54.read(iprot);
|
||||
struct.row_groups_metadata.add(_elem54);
|
||||
}
|
||||
}
|
||||
struct.setRow_groups_metadataIsSet(true);
|
||||
BitSet incoming = iprot.readBitSet(1);
|
||||
if (incoming.get(0)) {
|
||||
struct.delta_object_id = iprot.readString();
|
||||
struct.setDelta_object_idIsSet(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,45 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.tsfile.format;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import org.apache.thrift.TEnum;
|
||||
|
||||
public enum TimeSeriesChunkType implements org.apache.thrift.TEnum {
|
||||
TIME(0),
|
||||
VALUE(1);
|
||||
|
||||
private final int value;
|
||||
|
||||
private TimeSeriesChunkType(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 TimeSeriesChunkType findByValue(int value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return TIME;
|
||||
case 1:
|
||||
return VALUE;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,774 +0,0 @@
|
|||
/**
|
||||
* Autogenerated by Thrift Compiler (0.9.1)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
package cn.edu.tsinghua.tsfile.format;
|
||||
|
||||
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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class ValueInTimeSeriesChunkMetaData implements org.apache.thrift.TBase<ValueInTimeSeriesChunkMetaData, ValueInTimeSeriesChunkMetaData._Fields>, java.io.Serializable, Cloneable, Comparable<ValueInTimeSeriesChunkMetaData> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ValueInTimeSeriesChunkMetaData");
|
||||
|
||||
private static final org.apache.thrift.protocol.TField DATA_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("data_type", org.apache.thrift.protocol.TType.I32, (short)1);
|
||||
private static final org.apache.thrift.protocol.TField MAX_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("max_error", org.apache.thrift.protocol.TType.I32, (short)2);
|
||||
private static final org.apache.thrift.protocol.TField DIGEST_FIELD_DESC = new org.apache.thrift.protocol.TField("digest", org.apache.thrift.protocol.TType.STRUCT, (short)3);
|
||||
private static final org.apache.thrift.protocol.TField ENUM_VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("enum_values", org.apache.thrift.protocol.TType.LIST, (short)4);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new ValueInTimeSeriesChunkMetaDataStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new ValueInTimeSeriesChunkMetaDataTupleSchemeFactory());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see DataType
|
||||
*/
|
||||
public DataType data_type; // required
|
||||
public int max_error; // optional
|
||||
public Digest digest; // optional
|
||||
/**
|
||||
* If values of data consist of enum values, metadata will store all possible
|
||||
* values in time series
|
||||
*/
|
||||
public List<String> enum_values; // 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 DataType
|
||||
*/
|
||||
DATA_TYPE((short)1, "data_type"),
|
||||
MAX_ERROR((short)2, "max_error"),
|
||||
DIGEST((short)3, "digest"),
|
||||
/**
|
||||
* If values of data consist of enum values, metadata will store all possible
|
||||
* values in time series
|
||||
*/
|
||||
ENUM_VALUES((short)4, "enum_values");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
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: // DATA_TYPE
|
||||
return DATA_TYPE;
|
||||
case 2: // MAX_ERROR
|
||||
return MAX_ERROR;
|
||||
case 3: // DIGEST
|
||||
return DIGEST;
|
||||
case 4: // ENUM_VALUES
|
||||
return ENUM_VALUES;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the _Fields constant that matches 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 __MAX_ERROR_ISSET_ID = 0;
|
||||
private byte __isset_bitfield = 0;
|
||||
private _Fields optionals[] = {_Fields.MAX_ERROR,_Fields.DIGEST,_Fields.ENUM_VALUES};
|
||||
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.DATA_TYPE, new org.apache.thrift.meta_data.FieldMetaData("data_type", org.apache.thrift.TFieldRequirementType.REQUIRED,
|
||||
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, DataType.class)));
|
||||
tmpMap.put(_Fields.MAX_ERROR, new org.apache.thrift.meta_data.FieldMetaData("max_error", org.apache.thrift.TFieldRequirementType.OPTIONAL,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
|
||||
tmpMap.put(_Fields.DIGEST, new org.apache.thrift.meta_data.FieldMetaData("digest", org.apache.thrift.TFieldRequirementType.OPTIONAL,
|
||||
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Digest.class)));
|
||||
tmpMap.put(_Fields.ENUM_VALUES, new org.apache.thrift.meta_data.FieldMetaData("enum_values", 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(ValueInTimeSeriesChunkMetaData.class, metaDataMap);
|
||||
}
|
||||
|
||||
public ValueInTimeSeriesChunkMetaData() {
|
||||
}
|
||||
|
||||
public ValueInTimeSeriesChunkMetaData(
|
||||
DataType data_type)
|
||||
{
|
||||
this();
|
||||
this.data_type = data_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public ValueInTimeSeriesChunkMetaData(ValueInTimeSeriesChunkMetaData other) {
|
||||
__isset_bitfield = other.__isset_bitfield;
|
||||
if (other.isSetData_type()) {
|
||||
this.data_type = other.data_type;
|
||||
}
|
||||
this.max_error = other.max_error;
|
||||
if (other.isSetDigest()) {
|
||||
this.digest = new Digest(other.digest);
|
||||
}
|
||||
if (other.isSetEnum_values()) {
|
||||
List<String> __this__enum_values = new ArrayList<String>(other.enum_values);
|
||||
this.enum_values = __this__enum_values;
|
||||
}
|
||||
}
|
||||
|
||||
public ValueInTimeSeriesChunkMetaData deepCopy() {
|
||||
return new ValueInTimeSeriesChunkMetaData(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.data_type = null;
|
||||
setMax_errorIsSet(false);
|
||||
this.max_error = 0;
|
||||
this.digest = null;
|
||||
this.enum_values = null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see DataType
|
||||
*/
|
||||
public DataType getData_type() {
|
||||
return this.data_type;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see DataType
|
||||
*/
|
||||
public ValueInTimeSeriesChunkMetaData setData_type(DataType data_type) {
|
||||
this.data_type = data_type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetData_type() {
|
||||
this.data_type = null;
|
||||
}
|
||||
|
||||
/** Returns true if field data_type is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetData_type() {
|
||||
return this.data_type != null;
|
||||
}
|
||||
|
||||
public void setData_typeIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.data_type = null;
|
||||
}
|
||||
}
|
||||
|
||||
public int getMax_error() {
|
||||
return this.max_error;
|
||||
}
|
||||
|
||||
public ValueInTimeSeriesChunkMetaData setMax_error(int max_error) {
|
||||
this.max_error = max_error;
|
||||
setMax_errorIsSet(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetMax_error() {
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAX_ERROR_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field max_error is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetMax_error() {
|
||||
return EncodingUtils.testBit(__isset_bitfield, __MAX_ERROR_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setMax_errorIsSet(boolean value) {
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAX_ERROR_ISSET_ID, value);
|
||||
}
|
||||
|
||||
public Digest getDigest() {
|
||||
return this.digest;
|
||||
}
|
||||
|
||||
public ValueInTimeSeriesChunkMetaData setDigest(Digest digest) {
|
||||
this.digest = digest;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetDigest() {
|
||||
this.digest = null;
|
||||
}
|
||||
|
||||
/** Returns true if field digest is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetDigest() {
|
||||
return this.digest != null;
|
||||
}
|
||||
|
||||
public void setDigestIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.digest = null;
|
||||
}
|
||||
}
|
||||
|
||||
public int getEnum_valuesSize() {
|
||||
return (this.enum_values == null) ? 0 : this.enum_values.size();
|
||||
}
|
||||
|
||||
public java.util.Iterator<String> getEnum_valuesIterator() {
|
||||
return (this.enum_values == null) ? null : this.enum_values.iterator();
|
||||
}
|
||||
|
||||
public void addToEnum_values(String elem) {
|
||||
if (this.enum_values == null) {
|
||||
this.enum_values = new ArrayList<String>();
|
||||
}
|
||||
this.enum_values.add(elem);
|
||||
}
|
||||
|
||||
/**
|
||||
* If values of data consist of enum values, metadata will store all possible
|
||||
* values in time series
|
||||
*/
|
||||
public List<String> getEnum_values() {
|
||||
return this.enum_values;
|
||||
}
|
||||
|
||||
/**
|
||||
* If values of data consist of enum values, metadata will store all possible
|
||||
* values in time series
|
||||
*/
|
||||
public ValueInTimeSeriesChunkMetaData setEnum_values(List<String> enum_values) {
|
||||
this.enum_values = enum_values;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetEnum_values() {
|
||||
this.enum_values = null;
|
||||
}
|
||||
|
||||
/** Returns true if field enum_values is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetEnum_values() {
|
||||
return this.enum_values != null;
|
||||
}
|
||||
|
||||
public void setEnum_valuesIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.enum_values = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case DATA_TYPE:
|
||||
if (value == null) {
|
||||
unsetData_type();
|
||||
} else {
|
||||
setData_type((DataType)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case MAX_ERROR:
|
||||
if (value == null) {
|
||||
unsetMax_error();
|
||||
} else {
|
||||
setMax_error((Integer)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case DIGEST:
|
||||
if (value == null) {
|
||||
unsetDigest();
|
||||
} else {
|
||||
setDigest((Digest)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case ENUM_VALUES:
|
||||
if (value == null) {
|
||||
unsetEnum_values();
|
||||
} else {
|
||||
setEnum_values((List<String>)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case DATA_TYPE:
|
||||
return getData_type();
|
||||
|
||||
case MAX_ERROR:
|
||||
return Integer.valueOf(getMax_error());
|
||||
|
||||
case DIGEST:
|
||||
return getDigest();
|
||||
|
||||
case ENUM_VALUES:
|
||||
return getEnum_values();
|
||||
|
||||
}
|
||||
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 DATA_TYPE:
|
||||
return isSetData_type();
|
||||
case MAX_ERROR:
|
||||
return isSetMax_error();
|
||||
case DIGEST:
|
||||
return isSetDigest();
|
||||
case ENUM_VALUES:
|
||||
return isSetEnum_values();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof ValueInTimeSeriesChunkMetaData)
|
||||
return this.equals((ValueInTimeSeriesChunkMetaData)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(ValueInTimeSeriesChunkMetaData that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
|
||||
boolean this_present_data_type = true && this.isSetData_type();
|
||||
boolean that_present_data_type = true && that.isSetData_type();
|
||||
if (this_present_data_type || that_present_data_type) {
|
||||
if (!(this_present_data_type && that_present_data_type))
|
||||
return false;
|
||||
if (!this.data_type.equals(that.data_type))
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_max_error = true && this.isSetMax_error();
|
||||
boolean that_present_max_error = true && that.isSetMax_error();
|
||||
if (this_present_max_error || that_present_max_error) {
|
||||
if (!(this_present_max_error && that_present_max_error))
|
||||
return false;
|
||||
if (this.max_error != that.max_error)
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_digest = true && this.isSetDigest();
|
||||
boolean that_present_digest = true && that.isSetDigest();
|
||||
if (this_present_digest || that_present_digest) {
|
||||
if (!(this_present_digest && that_present_digest))
|
||||
return false;
|
||||
if (!this.digest.equals(that.digest))
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_enum_values = true && this.isSetEnum_values();
|
||||
boolean that_present_enum_values = true && that.isSetEnum_values();
|
||||
if (this_present_enum_values || that_present_enum_values) {
|
||||
if (!(this_present_enum_values && that_present_enum_values))
|
||||
return false;
|
||||
if (!this.enum_values.equals(that.enum_values))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(ValueInTimeSeriesChunkMetaData other) {
|
||||
if (!getClass().equals(other.getClass())) {
|
||||
return getClass().getName().compareTo(other.getClass().getName());
|
||||
}
|
||||
|
||||
int lastComparison = 0;
|
||||
|
||||
lastComparison = Boolean.valueOf(isSetData_type()).compareTo(other.isSetData_type());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetData_type()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data_type, other.data_type);
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
}
|
||||
lastComparison = Boolean.valueOf(isSetMax_error()).compareTo(other.isSetMax_error());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetMax_error()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.max_error, other.max_error);
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
}
|
||||
lastComparison = Boolean.valueOf(isSetDigest()).compareTo(other.isSetDigest());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetDigest()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.digest, other.digest);
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
}
|
||||
lastComparison = Boolean.valueOf(isSetEnum_values()).compareTo(other.isSetEnum_values());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetEnum_values()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.enum_values, other.enum_values);
|
||||
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("ValueInTimeSeriesChunkMetaData(");
|
||||
boolean first = true;
|
||||
|
||||
sb.append("data_type:");
|
||||
if (this.data_type == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.data_type);
|
||||
}
|
||||
first = false;
|
||||
if (isSetMax_error()) {
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("max_error:");
|
||||
sb.append(this.max_error);
|
||||
first = false;
|
||||
}
|
||||
if (isSetDigest()) {
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("digest:");
|
||||
if (this.digest == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.digest);
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
if (isSetEnum_values()) {
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("enum_values:");
|
||||
if (this.enum_values == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.enum_values);
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
if (data_type == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'data_type' was not present! Struct: " + toString());
|
||||
}
|
||||
// check for sub-struct validity
|
||||
if (digest != null) {
|
||||
digest.validate();
|
||||
}
|
||||
}
|
||||
|
||||
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
|
||||
try {
|
||||
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 ValueInTimeSeriesChunkMetaDataStandardSchemeFactory implements SchemeFactory {
|
||||
public ValueInTimeSeriesChunkMetaDataStandardScheme getScheme() {
|
||||
return new ValueInTimeSeriesChunkMetaDataStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class ValueInTimeSeriesChunkMetaDataStandardScheme extends StandardScheme<ValueInTimeSeriesChunkMetaData> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, ValueInTimeSeriesChunkMetaData struct) throws org.apache.thrift.TException {
|
||||
org.apache.thrift.protocol.TField schemeField;
|
||||
iprot.readStructBegin();
|
||||
while (true)
|
||||
{
|
||||
schemeField = iprot.readFieldBegin();
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
|
||||
break;
|
||||
}
|
||||
switch (schemeField.id) {
|
||||
case 1: // DATA_TYPE
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
|
||||
struct.data_type = DataType.findByValue(iprot.readI32());
|
||||
struct.setData_typeIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 2: // MAX_ERROR
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
|
||||
struct.max_error = iprot.readI32();
|
||||
struct.setMax_errorIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 3: // DIGEST
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
|
||||
struct.digest = new Digest();
|
||||
struct.digest.read(iprot);
|
||||
struct.setDigestIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 4: // ENUM_VALUES
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list32 = iprot.readListBegin();
|
||||
struct.enum_values = new ArrayList<String>(_list32.size);
|
||||
for (int _i33 = 0; _i33 < _list32.size; ++_i33)
|
||||
{
|
||||
String _elem34;
|
||||
_elem34 = iprot.readString();
|
||||
struct.enum_values.add(_elem34);
|
||||
}
|
||||
iprot.readListEnd();
|
||||
}
|
||||
struct.setEnum_valuesIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
|
||||
// check for required fields of primitive type, which can't be checked in the validate method
|
||||
struct.validate();
|
||||
}
|
||||
|
||||
public void write(org.apache.thrift.protocol.TProtocol oprot, ValueInTimeSeriesChunkMetaData struct) throws org.apache.thrift.TException {
|
||||
struct.validate();
|
||||
|
||||
oprot.writeStructBegin(STRUCT_DESC);
|
||||
if (struct.data_type != null) {
|
||||
oprot.writeFieldBegin(DATA_TYPE_FIELD_DESC);
|
||||
oprot.writeI32(struct.data_type.getValue());
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
if (struct.isSetMax_error()) {
|
||||
oprot.writeFieldBegin(MAX_ERROR_FIELD_DESC);
|
||||
oprot.writeI32(struct.max_error);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
if (struct.digest != null) {
|
||||
if (struct.isSetDigest()) {
|
||||
oprot.writeFieldBegin(DIGEST_FIELD_DESC);
|
||||
struct.digest.write(oprot);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
if (struct.enum_values != null) {
|
||||
if (struct.isSetEnum_values()) {
|
||||
oprot.writeFieldBegin(ENUM_VALUES_FIELD_DESC);
|
||||
{
|
||||
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.enum_values.size()));
|
||||
for (String _iter35 : struct.enum_values)
|
||||
{
|
||||
oprot.writeString(_iter35);
|
||||
}
|
||||
oprot.writeListEnd();
|
||||
}
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class ValueInTimeSeriesChunkMetaDataTupleSchemeFactory implements SchemeFactory {
|
||||
public ValueInTimeSeriesChunkMetaDataTupleScheme getScheme() {
|
||||
return new ValueInTimeSeriesChunkMetaDataTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class ValueInTimeSeriesChunkMetaDataTupleScheme extends TupleScheme<ValueInTimeSeriesChunkMetaData> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, ValueInTimeSeriesChunkMetaData struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
oprot.writeI32(struct.data_type.getValue());
|
||||
BitSet optionals = new BitSet();
|
||||
if (struct.isSetMax_error()) {
|
||||
optionals.set(0);
|
||||
}
|
||||
if (struct.isSetDigest()) {
|
||||
optionals.set(1);
|
||||
}
|
||||
if (struct.isSetEnum_values()) {
|
||||
optionals.set(2);
|
||||
}
|
||||
oprot.writeBitSet(optionals, 3);
|
||||
if (struct.isSetMax_error()) {
|
||||
oprot.writeI32(struct.max_error);
|
||||
}
|
||||
if (struct.isSetDigest()) {
|
||||
struct.digest.write(oprot);
|
||||
}
|
||||
if (struct.isSetEnum_values()) {
|
||||
{
|
||||
oprot.writeI32(struct.enum_values.size());
|
||||
for (String _iter36 : struct.enum_values)
|
||||
{
|
||||
oprot.writeString(_iter36);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, ValueInTimeSeriesChunkMetaData struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
struct.data_type = DataType.findByValue(iprot.readI32());
|
||||
struct.setData_typeIsSet(true);
|
||||
BitSet incoming = iprot.readBitSet(3);
|
||||
if (incoming.get(0)) {
|
||||
struct.max_error = iprot.readI32();
|
||||
struct.setMax_errorIsSet(true);
|
||||
}
|
||||
if (incoming.get(1)) {
|
||||
struct.digest = new Digest();
|
||||
struct.digest.read(iprot);
|
||||
struct.setDigestIsSet(true);
|
||||
}
|
||||
if (incoming.get(2)) {
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list37 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
|
||||
struct.enum_values = new ArrayList<String>(_list37.size);
|
||||
for (int _i38 = 0; _i38 < _list37.size; ++_i38)
|
||||
{
|
||||
String _elem39;
|
||||
_elem39 = iprot.readString();
|
||||
struct.enum_values.add(_elem39);
|
||||
}
|
||||
}
|
||||
struct.setEnum_valuesIsSet(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue