diff --git a/fs_brokers/apache_hdfs_broker/src/main/resources/thrift/PaloBrokerService.thrift b/fs_brokers/apache_hdfs_broker/src/main/resources/thrift/PaloBrokerService.thrift deleted file mode 100644 index 7487cc3c31..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/resources/thrift/PaloBrokerService.thrift +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright (c) 2017, Baidu.com, Inc. 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. - -namespace java com.baidu.palo.thrift -namespace cpp palo - -enum TBrokerOperationStatusCode { - OK = 0; - END_OF_FILE = 301; - - // user input error - NOT_AUTHORIZED = 401; - DUPLICATE_REQUEST = 402; - INVALID_INPUT_OFFSET = 403; // user input offset is invalid, is large than file length - INVALID_INPUT_FILE_PATH = 404; - INVALID_ARGUMENT = 405; - - // internal server error - FILE_NOT_FOUND = 501; - TARGET_STORAGE_SERVICE_ERROR = 502; // the target storage service error - OPERATION_NOT_SUPPORTED = 503; // the api is not implemented -} - -struct TBrokerOperationStatus { - 1: required TBrokerOperationStatusCode statusCode; - 2: optional string message; -} - -enum TBrokerVersion { - VERSION_ONE = 1; -} - -enum TBrokerOpenMode { - APPEND = 1; -} - -struct TBrokerFileStatus { - 1: required string path; // 文件的路径 - 2: required bool isDir; // 表示文件是个目录还是文件? - 3: required i64 size; // 文件的大小 - 4: required bool isSplitable; // 如果这个值是false,那么表示这个文件不可以切分,整个文件必须作为 - // 一个完整的map task来进行导入,如果是一个压缩文件返回值也是false -} - -struct TBrokerFD { - 1: required i64 high; - 2: required i64 low; -} - -struct TBrokerListResponse { - 1: required TBrokerOperationStatus opStatus; - 2: optional list files; - -} - -struct TBrokerOpenReaderResponse { - 1: required TBrokerOperationStatus opStatus; - 2: optional TBrokerFD fd; -} - -struct TBrokerReadResponse { - 1: required TBrokerOperationStatus opStatus; - 2: optional binary data; -} - -struct TBrokerOpenWriterResponse { - 1: required TBrokerOperationStatus opStatus; - 2: optional TBrokerFD fd; -} - -struct TBrokerCheckPathExistResponse { - 1: required TBrokerOperationStatus opStatus; - 2: required bool isPathExist; -} - -struct TBrokerListPathRequest { - 1: required TBrokerVersion version; - 2: required string path; - 3: required bool isRecursive; - 4: required map properties; - 5: optional bool fileNameOnly; -} - -struct TBrokerDeletePathRequest { - 1: required TBrokerVersion version; - 2: required string path; - 3: required map properties; -} - -struct TBrokerRenamePathRequest { - 1: required TBrokerVersion version; - 2: required string srcPath; - 3: required string destPath; - 4: required map properties; -} - -struct TBrokerCheckPathExistRequest { - 1: required TBrokerVersion version; - 2: required string path; - 3: required map properties; -} - -struct TBrokerOpenReaderRequest { - 1: required TBrokerVersion version; - 2: required string path; - 3: required i64 startOffset; - 4: required string clientId; - 5: required map properties; -} - -struct TBrokerPReadRequest { - 1: required TBrokerVersion version; - 2: required TBrokerFD fd; - 3: required i64 offset; - 4: required i64 length; -} - -struct TBrokerSeekRequest { - 1: required TBrokerVersion version; - 2: required TBrokerFD fd; - 3: required i64 offset; -} - -struct TBrokerCloseReaderRequest { - 1: required TBrokerVersion version; - 2: required TBrokerFD fd; -} - -struct TBrokerOpenWriterRequest { - 1: required TBrokerVersion version; - 2: required string path; - 3: required TBrokerOpenMode openMode; - 4: required string clientId; - 5: required map properties; -} - -struct TBrokerPWriteRequest { - 1: required TBrokerVersion version; - 2: required TBrokerFD fd; - 3: required i64 offset; - 4: required binary data; -} - -struct TBrokerCloseWriterRequest { - 1: required TBrokerVersion version; - 2: required TBrokerFD fd; -} - -struct TBrokerPingBrokerRequest { - 1: required TBrokerVersion version; - 2: required string clientId; -} - -service TPaloBrokerService { - - // 返回一个路径下的文件列表 - TBrokerListResponse listPath(1: TBrokerListPathRequest request); - - // 删除一个文件,如果删除文件失败,status code会返回error信息 - // input: - // path: 删除文件的路径 - TBrokerOperationStatus deletePath(1: TBrokerDeletePathRequest request); - - // 将文件重命名 - TBrokerOperationStatus renamePath(1: TBrokerRenamePathRequest request); - - // 检查一个文件是否存在 - TBrokerCheckPathExistResponse checkPathExist(1: TBrokerCheckPathExistRequest request); - - // 打开一个文件用来读取 - // input: - // path: 文件的路径 - // startOffset: 读取的起始位置 - // return: - // fd: 在broker内对这个文件读取流的唯一标识,用户每次读取的时候都需要带着这个fd,原因是一个broker - // 上可能有多个client端在读取同一个文件,所以需要用fd来分别标识。 - TBrokerOpenReaderResponse openReader(1: TBrokerOpenReaderRequest request); - - // 读取文件数据 - // input: - // fd: open reader时返回的fd - // length: 读取的长度 - // offset: 用户读取时必须每次带着offset,但是这并不表示用户可以指定offset来读取,这个offset主要是后端 - // 用来验证是否重复读取时使用的。 在网络通信时很有可能用户发起一次读取,但是并没有得到result, - // 然后又读取了一次,很有可能第一次读取已经发生了,只是用户没有收到结果,这样用户发起第二次读取, - // 返回的数据是错的,但是用户无法感知。 - // return: - // 正常情况下返回binary数据,异常情况,比如reader关闭了,文件读取到文件末尾了等,需要通过status code来返回 - // 这里的binary以后会封装到一个response对象里。 - TBrokerReadResponse pread(1: TBrokerPReadRequest request); - - // 将reader的offset定位到特定的位置 - TBrokerOperationStatus seek(1: TBrokerSeekRequest request); - - // 将reader关闭 - TBrokerOperationStatus closeReader(1: TBrokerCloseReaderRequest request); - - // 根据path打开一个文件写入流,这个API主要是为以后的backup restore设计的,目前导入来看不需要这个API - // 1. 如果文件不存在那么就创建,并返回fd; - // 2. 如果文件存在,但是是一个directory,那么返回失败 - // 这里不提供递归创建文件夹的参数,默认就是文件夹如果不存在,那么就创建 - // 这个API 目前考虑只是为了备份使用的,跟导入无关。 - // input: - // openMode: 打开写入流的方式,可选项:overwrite, create new, append等 - TBrokerOpenWriterResponse openWriter(1: TBrokerOpenWriterRequest request); - - // 向fd对应的文件中写入数据 - TBrokerOperationStatus pwrite(1: TBrokerPWriteRequest request); - - // 将文件写入流关闭 - TBrokerOperationStatus closeWriter(1: TBrokerCloseWriterRequest request); - - // - TBrokerOperationStatus ping(1: TBrokerPingBrokerRequest request); -} diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerCheckPathExistRequest.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerCheckPathExistRequest.java deleted file mode 100644 index 2a843df2c7..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerCheckPathExistRequest.java +++ /dev/null @@ -1,661 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-10-27") -public class TBrokerCheckPathExistRequest implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBrokerCheckPathExistRequest"); - - private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField PROPERTIES_FIELD_DESC = new org.apache.thrift.protocol.TField("properties", org.apache.thrift.protocol.TType.MAP, (short)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBrokerCheckPathExistRequestStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBrokerCheckPathExistRequestTupleSchemeFactory()); - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion version; // required - public String path; // required - public Map properties; // required - - /** 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 TBrokerVersion - */ - VERSION((short)1, "version"), - PATH((short)2, "path"), - PROPERTIES((short)3, "properties"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VERSION - return VERSION; - case 2: // PATH - return PATH; - case 3: // PROPERTIES - return PROPERTIES; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TBrokerVersion.class))); - tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.PROPERTIES, new org.apache.thrift.meta_data.FieldMetaData("properties", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBrokerCheckPathExistRequest.class, metaDataMap); - } - - public TBrokerCheckPathExistRequest() { - } - - public TBrokerCheckPathExistRequest( - TBrokerVersion version, - String path, - Map properties) - { - this(); - this.version = version; - this.path = path; - this.properties = properties; - } - - /** - * Performs a deep copy on other. - */ - public TBrokerCheckPathExistRequest(TBrokerCheckPathExistRequest other) { - if (other.isSetVersion()) { - this.version = other.version; - } - if (other.isSetPath()) { - this.path = other.path; - } - if (other.isSetProperties()) { - Map __this__properties = new HashMap(other.properties); - this.properties = __this__properties; - } - } - - public TBrokerCheckPathExistRequest deepCopy() { - return new TBrokerCheckPathExistRequest(this); - } - - @Override - public void clear() { - this.version = null; - this.path = null; - this.properties = null; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion getVersion() { - return this.version; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerCheckPathExistRequest setVersion(TBrokerVersion 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 String getPath() { - return this.path; - } - - public TBrokerCheckPathExistRequest setPath(String path) { - this.path = path; - return this; - } - - public void unsetPath() { - this.path = null; - } - - /** Returns true if field path is set (has been assigned a value) and false otherwise */ - public boolean isSetPath() { - return this.path != null; - } - - public void setPathIsSet(boolean value) { - if (!value) { - this.path = null; - } - } - - public int getPropertiesSize() { - return (this.properties == null) ? 0 : this.properties.size(); - } - - public void putToProperties(String key, String val) { - if (this.properties == null) { - this.properties = new HashMap(); - } - this.properties.put(key, val); - } - - public Map getProperties() { - return this.properties; - } - - public TBrokerCheckPathExistRequest setProperties(Map properties) { - this.properties = properties; - return this; - } - - public void unsetProperties() { - this.properties = null; - } - - /** Returns true if field properties is set (has been assigned a value) and false otherwise */ - public boolean isSetProperties() { - return this.properties != null; - } - - public void setPropertiesIsSet(boolean value) { - if (!value) { - this.properties = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VERSION: - if (value == null) { - unsetVersion(); - } else { - setVersion((TBrokerVersion)value); - } - break; - - case PATH: - if (value == null) { - unsetPath(); - } else { - setPath((String)value); - } - break; - - case PROPERTIES: - if (value == null) { - unsetProperties(); - } else { - setProperties((Map)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VERSION: - return getVersion(); - - case PATH: - return getPath(); - - case PROPERTIES: - return getProperties(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 PATH: - return isSetPath(); - case PROPERTIES: - return isSetProperties(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBrokerCheckPathExistRequest) - return this.equals((TBrokerCheckPathExistRequest)that); - return false; - } - - public boolean equals(TBrokerCheckPathExistRequest 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_path = true && this.isSetPath(); - boolean that_present_path = true && that.isSetPath(); - if (this_present_path || that_present_path) { - if (!(this_present_path && that_present_path)) - return false; - if (!this.path.equals(that.path)) - return false; - } - - boolean this_present_properties = true && this.isSetProperties(); - boolean that_present_properties = true && that.isSetProperties(); - if (this_present_properties || that_present_properties) { - if (!(this_present_properties && that_present_properties)) - return false; - if (!this.properties.equals(that.properties)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_version = true && (isSetVersion()); - list.add(present_version); - if (present_version) - list.add(version.getValue()); - - boolean present_path = true && (isSetPath()); - list.add(present_path); - if (present_path) - list.add(path); - - boolean present_properties = true && (isSetProperties()); - list.add(present_properties); - if (present_properties) - list.add(properties); - - return list.hashCode(); - } - - @Override - public int compareTo(TBrokerCheckPathExistRequest 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(isSetPath()).compareTo(other.isSetPath()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPath()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetProperties()).compareTo(other.isSetProperties()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetProperties()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.properties, other.properties); - 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("TBrokerCheckPathExistRequest("); - 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("path:"); - if (this.path == null) { - sb.append("null"); - } else { - sb.append(this.path); - } - first = false; - if (!first) sb.append(", "); - sb.append("properties:"); - if (this.properties == null) { - sb.append("null"); - } else { - sb.append(this.properties); - } - 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 (path == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'path' was not present! Struct: " + toString()); - } - if (properties == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'properties' 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 TBrokerCheckPathExistRequestStandardSchemeFactory implements SchemeFactory { - public TBrokerCheckPathExistRequestStandardScheme getScheme() { - return new TBrokerCheckPathExistRequestStandardScheme(); - } - } - - private static class TBrokerCheckPathExistRequestStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBrokerCheckPathExistRequest struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.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.I32) { - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // PATH - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.path = iprot.readString(); - struct.setPathIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // PROPERTIES - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map38 = iprot.readMapBegin(); - struct.properties = new HashMap(2*_map38.size); - String _key39; - String _val40; - for (int _i41 = 0; _i41 < _map38.size; ++_i41) - { - _key39 = iprot.readString(); - _val40 = iprot.readString(); - struct.properties.put(_key39, _val40); - } - iprot.readMapEnd(); - } - struct.setPropertiesIsSet(true); - } else { - 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, TBrokerCheckPathExistRequest struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.version != null) { - oprot.writeFieldBegin(VERSION_FIELD_DESC); - oprot.writeI32(struct.version.getValue()); - oprot.writeFieldEnd(); - } - if (struct.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(struct.path); - oprot.writeFieldEnd(); - } - if (struct.properties != null) { - oprot.writeFieldBegin(PROPERTIES_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.properties.size())); - for (Map.Entry _iter42 : struct.properties.entrySet()) - { - oprot.writeString(_iter42.getKey()); - oprot.writeString(_iter42.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBrokerCheckPathExistRequestTupleSchemeFactory implements SchemeFactory { - public TBrokerCheckPathExistRequestTupleScheme getScheme() { - return new TBrokerCheckPathExistRequestTupleScheme(); - } - } - - private static class TBrokerCheckPathExistRequestTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBrokerCheckPathExistRequest struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.version.getValue()); - oprot.writeString(struct.path); - { - oprot.writeI32(struct.properties.size()); - for (Map.Entry _iter43 : struct.properties.entrySet()) - { - oprot.writeString(_iter43.getKey()); - oprot.writeString(_iter43.getValue()); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBrokerCheckPathExistRequest struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - struct.path = iprot.readString(); - struct.setPathIsSet(true); - { - org.apache.thrift.protocol.TMap _map44 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.properties = new HashMap(2*_map44.size); - String _key45; - String _val46; - for (int _i47 = 0; _i47 < _map44.size; ++_i47) - { - _key45 = iprot.readString(); - _val46 = iprot.readString(); - struct.properties.put(_key45, _val46); - } - } - struct.setPropertiesIsSet(true); - } - } - -} - diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerCheckPathExistResponse.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerCheckPathExistResponse.java deleted file mode 100644 index f248fd55fd..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerCheckPathExistResponse.java +++ /dev/null @@ -1,496 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-10-27") -public class TBrokerCheckPathExistResponse implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBrokerCheckPathExistResponse"); - - private static final org.apache.thrift.protocol.TField OP_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("opStatus", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField IS_PATH_EXIST_FIELD_DESC = new org.apache.thrift.protocol.TField("isPathExist", org.apache.thrift.protocol.TType.BOOL, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBrokerCheckPathExistResponseStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBrokerCheckPathExistResponseTupleSchemeFactory()); - } - - public TBrokerOperationStatus opStatus; // required - public boolean isPathExist; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - OP_STATUS((short)1, "opStatus"), - IS_PATH_EXIST((short)2, "isPathExist"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OP_STATUS - return OP_STATUS; - case 2: // IS_PATH_EXIST - return IS_PATH_EXIST; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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 __ISPATHEXIST_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.OP_STATUS, new org.apache.thrift.meta_data.FieldMetaData("opStatus", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerOperationStatus.class))); - tmpMap.put(_Fields.IS_PATH_EXIST, new org.apache.thrift.meta_data.FieldMetaData("isPathExist", 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(TBrokerCheckPathExistResponse.class, metaDataMap); - } - - public TBrokerCheckPathExistResponse() { - } - - public TBrokerCheckPathExistResponse( - TBrokerOperationStatus opStatus, - boolean isPathExist) - { - this(); - this.opStatus = opStatus; - this.isPathExist = isPathExist; - setIsPathExistIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public TBrokerCheckPathExistResponse(TBrokerCheckPathExistResponse other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetOpStatus()) { - this.opStatus = new TBrokerOperationStatus(other.opStatus); - } - this.isPathExist = other.isPathExist; - } - - public TBrokerCheckPathExistResponse deepCopy() { - return new TBrokerCheckPathExistResponse(this); - } - - @Override - public void clear() { - this.opStatus = null; - setIsPathExistIsSet(false); - this.isPathExist = false; - } - - public TBrokerOperationStatus getOpStatus() { - return this.opStatus; - } - - public TBrokerCheckPathExistResponse setOpStatus(TBrokerOperationStatus opStatus) { - this.opStatus = opStatus; - return this; - } - - public void unsetOpStatus() { - this.opStatus = null; - } - - /** Returns true if field opStatus is set (has been assigned a value) and false otherwise */ - public boolean isSetOpStatus() { - return this.opStatus != null; - } - - public void setOpStatusIsSet(boolean value) { - if (!value) { - this.opStatus = null; - } - } - - public boolean isIsPathExist() { - return this.isPathExist; - } - - public TBrokerCheckPathExistResponse setIsPathExist(boolean isPathExist) { - this.isPathExist = isPathExist; - setIsPathExistIsSet(true); - return this; - } - - public void unsetIsPathExist() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISPATHEXIST_ISSET_ID); - } - - /** Returns true if field isPathExist is set (has been assigned a value) and false otherwise */ - public boolean isSetIsPathExist() { - return EncodingUtils.testBit(__isset_bitfield, __ISPATHEXIST_ISSET_ID); - } - - public void setIsPathExistIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISPATHEXIST_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case OP_STATUS: - if (value == null) { - unsetOpStatus(); - } else { - setOpStatus((TBrokerOperationStatus)value); - } - break; - - case IS_PATH_EXIST: - if (value == null) { - unsetIsPathExist(); - } else { - setIsPathExist((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case OP_STATUS: - return getOpStatus(); - - case IS_PATH_EXIST: - return isIsPathExist(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 OP_STATUS: - return isSetOpStatus(); - case IS_PATH_EXIST: - return isSetIsPathExist(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBrokerCheckPathExistResponse) - return this.equals((TBrokerCheckPathExistResponse)that); - return false; - } - - public boolean equals(TBrokerCheckPathExistResponse that) { - if (that == null) - return false; - - boolean this_present_opStatus = true && this.isSetOpStatus(); - boolean that_present_opStatus = true && that.isSetOpStatus(); - if (this_present_opStatus || that_present_opStatus) { - if (!(this_present_opStatus && that_present_opStatus)) - return false; - if (!this.opStatus.equals(that.opStatus)) - return false; - } - - boolean this_present_isPathExist = true; - boolean that_present_isPathExist = true; - if (this_present_isPathExist || that_present_isPathExist) { - if (!(this_present_isPathExist && that_present_isPathExist)) - return false; - if (this.isPathExist != that.isPathExist) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_opStatus = true && (isSetOpStatus()); - list.add(present_opStatus); - if (present_opStatus) - list.add(opStatus); - - boolean present_isPathExist = true; - list.add(present_isPathExist); - if (present_isPathExist) - list.add(isPathExist); - - return list.hashCode(); - } - - @Override - public int compareTo(TBrokerCheckPathExistResponse other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetOpStatus()).compareTo(other.isSetOpStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOpStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.opStatus, other.opStatus); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIsPathExist()).compareTo(other.isSetIsPathExist()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIsPathExist()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isPathExist, other.isPathExist); - 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("TBrokerCheckPathExistResponse("); - boolean first = true; - - sb.append("opStatus:"); - if (this.opStatus == null) { - sb.append("null"); - } else { - sb.append(this.opStatus); - } - first = false; - if (!first) sb.append(", "); - sb.append("isPathExist:"); - sb.append(this.isPathExist); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (opStatus == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'opStatus' was not present! Struct: " + toString()); - } - // alas, we cannot check 'isPathExist' because it's a primitive and you chose the non-beans generator. - // check for sub-struct validity - if (opStatus != null) { - opStatus.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 TBrokerCheckPathExistResponseStandardSchemeFactory implements SchemeFactory { - public TBrokerCheckPathExistResponseStandardScheme getScheme() { - return new TBrokerCheckPathExistResponseStandardScheme(); - } - } - - private static class TBrokerCheckPathExistResponseStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBrokerCheckPathExistResponse struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // OP_STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.opStatus = new TBrokerOperationStatus(); - struct.opStatus.read(iprot); - struct.setOpStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // IS_PATH_EXIST - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.isPathExist = iprot.readBool(); - struct.setIsPathExistIsSet(true); - } else { - 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.isSetIsPathExist()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'isPathExist' was not found in serialized data! Struct: " + toString()); - } - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TBrokerCheckPathExistResponse struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.opStatus != null) { - oprot.writeFieldBegin(OP_STATUS_FIELD_DESC); - struct.opStatus.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(IS_PATH_EXIST_FIELD_DESC); - oprot.writeBool(struct.isPathExist); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBrokerCheckPathExistResponseTupleSchemeFactory implements SchemeFactory { - public TBrokerCheckPathExistResponseTupleScheme getScheme() { - return new TBrokerCheckPathExistResponseTupleScheme(); - } - } - - private static class TBrokerCheckPathExistResponseTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBrokerCheckPathExistResponse struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.opStatus.write(oprot); - oprot.writeBool(struct.isPathExist); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBrokerCheckPathExistResponse struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.opStatus = new TBrokerOperationStatus(); - struct.opStatus.read(iprot); - struct.setOpStatusIsSet(true); - struct.isPathExist = iprot.readBool(); - struct.setIsPathExistIsSet(true); - } - } - -} - diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerCloseReaderRequest.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerCloseReaderRequest.java deleted file mode 100644 index d51d1138a0..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerCloseReaderRequest.java +++ /dev/null @@ -1,513 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-10-27") -public class TBrokerCloseReaderRequest implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBrokerCloseReaderRequest"); - - private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField FD_FIELD_DESC = new org.apache.thrift.protocol.TField("fd", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBrokerCloseReaderRequestStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBrokerCloseReaderRequestTupleSchemeFactory()); - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion version; // required - public TBrokerFD fd; // required - - /** 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 TBrokerVersion - */ - VERSION((short)1, "version"), - FD((short)2, "fd"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VERSION - return VERSION; - case 2: // FD - return FD; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TBrokerVersion.class))); - tmpMap.put(_Fields.FD, new org.apache.thrift.meta_data.FieldMetaData("fd", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerFD.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBrokerCloseReaderRequest.class, metaDataMap); - } - - public TBrokerCloseReaderRequest() { - } - - public TBrokerCloseReaderRequest( - TBrokerVersion version, - TBrokerFD fd) - { - this(); - this.version = version; - this.fd = fd; - } - - /** - * Performs a deep copy on other. - */ - public TBrokerCloseReaderRequest(TBrokerCloseReaderRequest other) { - if (other.isSetVersion()) { - this.version = other.version; - } - if (other.isSetFd()) { - this.fd = new TBrokerFD(other.fd); - } - } - - public TBrokerCloseReaderRequest deepCopy() { - return new TBrokerCloseReaderRequest(this); - } - - @Override - public void clear() { - this.version = null; - this.fd = null; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion getVersion() { - return this.version; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerCloseReaderRequest setVersion(TBrokerVersion 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 TBrokerFD getFd() { - return this.fd; - } - - public TBrokerCloseReaderRequest setFd(TBrokerFD fd) { - this.fd = fd; - return this; - } - - public void unsetFd() { - this.fd = null; - } - - /** Returns true if field fd is set (has been assigned a value) and false otherwise */ - public boolean isSetFd() { - return this.fd != null; - } - - public void setFdIsSet(boolean value) { - if (!value) { - this.fd = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VERSION: - if (value == null) { - unsetVersion(); - } else { - setVersion((TBrokerVersion)value); - } - break; - - case FD: - if (value == null) { - unsetFd(); - } else { - setFd((TBrokerFD)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VERSION: - return getVersion(); - - case FD: - return getFd(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 FD: - return isSetFd(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBrokerCloseReaderRequest) - return this.equals((TBrokerCloseReaderRequest)that); - return false; - } - - public boolean equals(TBrokerCloseReaderRequest 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_fd = true && this.isSetFd(); - boolean that_present_fd = true && that.isSetFd(); - if (this_present_fd || that_present_fd) { - if (!(this_present_fd && that_present_fd)) - return false; - if (!this.fd.equals(that.fd)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_version = true && (isSetVersion()); - list.add(present_version); - if (present_version) - list.add(version.getValue()); - - boolean present_fd = true && (isSetFd()); - list.add(present_fd); - if (present_fd) - list.add(fd); - - return list.hashCode(); - } - - @Override - public int compareTo(TBrokerCloseReaderRequest 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(isSetFd()).compareTo(other.isSetFd()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFd()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fd, other.fd); - 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("TBrokerCloseReaderRequest("); - 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("fd:"); - if (this.fd == null) { - sb.append("null"); - } else { - sb.append(this.fd); - } - 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 (fd == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'fd' was not present! Struct: " + toString()); - } - // check for sub-struct validity - if (fd != null) { - fd.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 TBrokerCloseReaderRequestStandardSchemeFactory implements SchemeFactory { - public TBrokerCloseReaderRequestStandardScheme getScheme() { - return new TBrokerCloseReaderRequestStandardScheme(); - } - } - - private static class TBrokerCloseReaderRequestStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBrokerCloseReaderRequest struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.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.I32) { - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // FD - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.fd = new TBrokerFD(); - struct.fd.read(iprot); - struct.setFdIsSet(true); - } else { - 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, TBrokerCloseReaderRequest struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.version != null) { - oprot.writeFieldBegin(VERSION_FIELD_DESC); - oprot.writeI32(struct.version.getValue()); - oprot.writeFieldEnd(); - } - if (struct.fd != null) { - oprot.writeFieldBegin(FD_FIELD_DESC); - struct.fd.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBrokerCloseReaderRequestTupleSchemeFactory implements SchemeFactory { - public TBrokerCloseReaderRequestTupleScheme getScheme() { - return new TBrokerCloseReaderRequestTupleScheme(); - } - } - - private static class TBrokerCloseReaderRequestTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBrokerCloseReaderRequest struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.version.getValue()); - struct.fd.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBrokerCloseReaderRequest struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - struct.fd = new TBrokerFD(); - struct.fd.read(iprot); - struct.setFdIsSet(true); - } - } - -} - diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerCloseWriterRequest.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerCloseWriterRequest.java deleted file mode 100644 index 695c87389e..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerCloseWriterRequest.java +++ /dev/null @@ -1,513 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-10-27") -public class TBrokerCloseWriterRequest implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBrokerCloseWriterRequest"); - - private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField FD_FIELD_DESC = new org.apache.thrift.protocol.TField("fd", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBrokerCloseWriterRequestStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBrokerCloseWriterRequestTupleSchemeFactory()); - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion version; // required - public TBrokerFD fd; // required - - /** 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 TBrokerVersion - */ - VERSION((short)1, "version"), - FD((short)2, "fd"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VERSION - return VERSION; - case 2: // FD - return FD; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TBrokerVersion.class))); - tmpMap.put(_Fields.FD, new org.apache.thrift.meta_data.FieldMetaData("fd", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerFD.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBrokerCloseWriterRequest.class, metaDataMap); - } - - public TBrokerCloseWriterRequest() { - } - - public TBrokerCloseWriterRequest( - TBrokerVersion version, - TBrokerFD fd) - { - this(); - this.version = version; - this.fd = fd; - } - - /** - * Performs a deep copy on other. - */ - public TBrokerCloseWriterRequest(TBrokerCloseWriterRequest other) { - if (other.isSetVersion()) { - this.version = other.version; - } - if (other.isSetFd()) { - this.fd = new TBrokerFD(other.fd); - } - } - - public TBrokerCloseWriterRequest deepCopy() { - return new TBrokerCloseWriterRequest(this); - } - - @Override - public void clear() { - this.version = null; - this.fd = null; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion getVersion() { - return this.version; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerCloseWriterRequest setVersion(TBrokerVersion 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 TBrokerFD getFd() { - return this.fd; - } - - public TBrokerCloseWriterRequest setFd(TBrokerFD fd) { - this.fd = fd; - return this; - } - - public void unsetFd() { - this.fd = null; - } - - /** Returns true if field fd is set (has been assigned a value) and false otherwise */ - public boolean isSetFd() { - return this.fd != null; - } - - public void setFdIsSet(boolean value) { - if (!value) { - this.fd = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VERSION: - if (value == null) { - unsetVersion(); - } else { - setVersion((TBrokerVersion)value); - } - break; - - case FD: - if (value == null) { - unsetFd(); - } else { - setFd((TBrokerFD)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VERSION: - return getVersion(); - - case FD: - return getFd(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 FD: - return isSetFd(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBrokerCloseWriterRequest) - return this.equals((TBrokerCloseWriterRequest)that); - return false; - } - - public boolean equals(TBrokerCloseWriterRequest 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_fd = true && this.isSetFd(); - boolean that_present_fd = true && that.isSetFd(); - if (this_present_fd || that_present_fd) { - if (!(this_present_fd && that_present_fd)) - return false; - if (!this.fd.equals(that.fd)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_version = true && (isSetVersion()); - list.add(present_version); - if (present_version) - list.add(version.getValue()); - - boolean present_fd = true && (isSetFd()); - list.add(present_fd); - if (present_fd) - list.add(fd); - - return list.hashCode(); - } - - @Override - public int compareTo(TBrokerCloseWriterRequest 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(isSetFd()).compareTo(other.isSetFd()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFd()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fd, other.fd); - 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("TBrokerCloseWriterRequest("); - 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("fd:"); - if (this.fd == null) { - sb.append("null"); - } else { - sb.append(this.fd); - } - 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 (fd == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'fd' was not present! Struct: " + toString()); - } - // check for sub-struct validity - if (fd != null) { - fd.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 TBrokerCloseWriterRequestStandardSchemeFactory implements SchemeFactory { - public TBrokerCloseWriterRequestStandardScheme getScheme() { - return new TBrokerCloseWriterRequestStandardScheme(); - } - } - - private static class TBrokerCloseWriterRequestStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBrokerCloseWriterRequest struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.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.I32) { - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // FD - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.fd = new TBrokerFD(); - struct.fd.read(iprot); - struct.setFdIsSet(true); - } else { - 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, TBrokerCloseWriterRequest struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.version != null) { - oprot.writeFieldBegin(VERSION_FIELD_DESC); - oprot.writeI32(struct.version.getValue()); - oprot.writeFieldEnd(); - } - if (struct.fd != null) { - oprot.writeFieldBegin(FD_FIELD_DESC); - struct.fd.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBrokerCloseWriterRequestTupleSchemeFactory implements SchemeFactory { - public TBrokerCloseWriterRequestTupleScheme getScheme() { - return new TBrokerCloseWriterRequestTupleScheme(); - } - } - - private static class TBrokerCloseWriterRequestTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBrokerCloseWriterRequest struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.version.getValue()); - struct.fd.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBrokerCloseWriterRequest struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - struct.fd = new TBrokerFD(); - struct.fd.read(iprot); - struct.setFdIsSet(true); - } - } - -} - diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerDeletePathRequest.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerDeletePathRequest.java deleted file mode 100644 index a3b236b8ff..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerDeletePathRequest.java +++ /dev/null @@ -1,661 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-10-27") -public class TBrokerDeletePathRequest implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBrokerDeletePathRequest"); - - private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField PROPERTIES_FIELD_DESC = new org.apache.thrift.protocol.TField("properties", org.apache.thrift.protocol.TType.MAP, (short)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBrokerDeletePathRequestStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBrokerDeletePathRequestTupleSchemeFactory()); - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion version; // required - public String path; // required - public Map properties; // required - - /** 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 TBrokerVersion - */ - VERSION((short)1, "version"), - PATH((short)2, "path"), - PROPERTIES((short)3, "properties"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VERSION - return VERSION; - case 2: // PATH - return PATH; - case 3: // PROPERTIES - return PROPERTIES; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TBrokerVersion.class))); - tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.PROPERTIES, new org.apache.thrift.meta_data.FieldMetaData("properties", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBrokerDeletePathRequest.class, metaDataMap); - } - - public TBrokerDeletePathRequest() { - } - - public TBrokerDeletePathRequest( - TBrokerVersion version, - String path, - Map properties) - { - this(); - this.version = version; - this.path = path; - this.properties = properties; - } - - /** - * Performs a deep copy on other. - */ - public TBrokerDeletePathRequest(TBrokerDeletePathRequest other) { - if (other.isSetVersion()) { - this.version = other.version; - } - if (other.isSetPath()) { - this.path = other.path; - } - if (other.isSetProperties()) { - Map __this__properties = new HashMap(other.properties); - this.properties = __this__properties; - } - } - - public TBrokerDeletePathRequest deepCopy() { - return new TBrokerDeletePathRequest(this); - } - - @Override - public void clear() { - this.version = null; - this.path = null; - this.properties = null; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion getVersion() { - return this.version; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerDeletePathRequest setVersion(TBrokerVersion 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 String getPath() { - return this.path; - } - - public TBrokerDeletePathRequest setPath(String path) { - this.path = path; - return this; - } - - public void unsetPath() { - this.path = null; - } - - /** Returns true if field path is set (has been assigned a value) and false otherwise */ - public boolean isSetPath() { - return this.path != null; - } - - public void setPathIsSet(boolean value) { - if (!value) { - this.path = null; - } - } - - public int getPropertiesSize() { - return (this.properties == null) ? 0 : this.properties.size(); - } - - public void putToProperties(String key, String val) { - if (this.properties == null) { - this.properties = new HashMap(); - } - this.properties.put(key, val); - } - - public Map getProperties() { - return this.properties; - } - - public TBrokerDeletePathRequest setProperties(Map properties) { - this.properties = properties; - return this; - } - - public void unsetProperties() { - this.properties = null; - } - - /** Returns true if field properties is set (has been assigned a value) and false otherwise */ - public boolean isSetProperties() { - return this.properties != null; - } - - public void setPropertiesIsSet(boolean value) { - if (!value) { - this.properties = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VERSION: - if (value == null) { - unsetVersion(); - } else { - setVersion((TBrokerVersion)value); - } - break; - - case PATH: - if (value == null) { - unsetPath(); - } else { - setPath((String)value); - } - break; - - case PROPERTIES: - if (value == null) { - unsetProperties(); - } else { - setProperties((Map)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VERSION: - return getVersion(); - - case PATH: - return getPath(); - - case PROPERTIES: - return getProperties(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 PATH: - return isSetPath(); - case PROPERTIES: - return isSetProperties(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBrokerDeletePathRequest) - return this.equals((TBrokerDeletePathRequest)that); - return false; - } - - public boolean equals(TBrokerDeletePathRequest 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_path = true && this.isSetPath(); - boolean that_present_path = true && that.isSetPath(); - if (this_present_path || that_present_path) { - if (!(this_present_path && that_present_path)) - return false; - if (!this.path.equals(that.path)) - return false; - } - - boolean this_present_properties = true && this.isSetProperties(); - boolean that_present_properties = true && that.isSetProperties(); - if (this_present_properties || that_present_properties) { - if (!(this_present_properties && that_present_properties)) - return false; - if (!this.properties.equals(that.properties)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_version = true && (isSetVersion()); - list.add(present_version); - if (present_version) - list.add(version.getValue()); - - boolean present_path = true && (isSetPath()); - list.add(present_path); - if (present_path) - list.add(path); - - boolean present_properties = true && (isSetProperties()); - list.add(present_properties); - if (present_properties) - list.add(properties); - - return list.hashCode(); - } - - @Override - public int compareTo(TBrokerDeletePathRequest 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(isSetPath()).compareTo(other.isSetPath()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPath()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetProperties()).compareTo(other.isSetProperties()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetProperties()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.properties, other.properties); - 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("TBrokerDeletePathRequest("); - 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("path:"); - if (this.path == null) { - sb.append("null"); - } else { - sb.append(this.path); - } - first = false; - if (!first) sb.append(", "); - sb.append("properties:"); - if (this.properties == null) { - sb.append("null"); - } else { - sb.append(this.properties); - } - 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 (path == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'path' was not present! Struct: " + toString()); - } - if (properties == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'properties' 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 TBrokerDeletePathRequestStandardSchemeFactory implements SchemeFactory { - public TBrokerDeletePathRequestStandardScheme getScheme() { - return new TBrokerDeletePathRequestStandardScheme(); - } - } - - private static class TBrokerDeletePathRequestStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBrokerDeletePathRequest struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.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.I32) { - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // PATH - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.path = iprot.readString(); - struct.setPathIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // PROPERTIES - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map18 = iprot.readMapBegin(); - struct.properties = new HashMap(2*_map18.size); - String _key19; - String _val20; - for (int _i21 = 0; _i21 < _map18.size; ++_i21) - { - _key19 = iprot.readString(); - _val20 = iprot.readString(); - struct.properties.put(_key19, _val20); - } - iprot.readMapEnd(); - } - struct.setPropertiesIsSet(true); - } else { - 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, TBrokerDeletePathRequest struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.version != null) { - oprot.writeFieldBegin(VERSION_FIELD_DESC); - oprot.writeI32(struct.version.getValue()); - oprot.writeFieldEnd(); - } - if (struct.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(struct.path); - oprot.writeFieldEnd(); - } - if (struct.properties != null) { - oprot.writeFieldBegin(PROPERTIES_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.properties.size())); - for (Map.Entry _iter22 : struct.properties.entrySet()) - { - oprot.writeString(_iter22.getKey()); - oprot.writeString(_iter22.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBrokerDeletePathRequestTupleSchemeFactory implements SchemeFactory { - public TBrokerDeletePathRequestTupleScheme getScheme() { - return new TBrokerDeletePathRequestTupleScheme(); - } - } - - private static class TBrokerDeletePathRequestTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBrokerDeletePathRequest struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.version.getValue()); - oprot.writeString(struct.path); - { - oprot.writeI32(struct.properties.size()); - for (Map.Entry _iter23 : struct.properties.entrySet()) - { - oprot.writeString(_iter23.getKey()); - oprot.writeString(_iter23.getValue()); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBrokerDeletePathRequest struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - struct.path = iprot.readString(); - struct.setPathIsSet(true); - { - org.apache.thrift.protocol.TMap _map24 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.properties = new HashMap(2*_map24.size); - String _key25; - String _val26; - for (int _i27 = 0; _i27 < _map24.size; ++_i27) - { - _key25 = iprot.readString(); - _val26 = iprot.readString(); - struct.properties.put(_key25, _val26); - } - } - struct.setPropertiesIsSet(true); - } - } - -} - diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerFD.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerFD.java deleted file mode 100644 index 7b5081d593..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerFD.java +++ /dev/null @@ -1,486 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-10-27") -public class TBrokerFD implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBrokerFD"); - - private static final org.apache.thrift.protocol.TField HIGH_FIELD_DESC = new org.apache.thrift.protocol.TField("high", org.apache.thrift.protocol.TType.I64, (short)1); - private static final org.apache.thrift.protocol.TField LOW_FIELD_DESC = new org.apache.thrift.protocol.TField("low", org.apache.thrift.protocol.TType.I64, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBrokerFDStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBrokerFDTupleSchemeFactory()); - } - - public long high; // required - public long low; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - HIGH((short)1, "high"), - LOW((short)2, "low"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // HIGH - return HIGH; - case 2: // LOW - return LOW; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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 __HIGH_ISSET_ID = 0; - private static final int __LOW_ISSET_ID = 1; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.HIGH, new org.apache.thrift.meta_data.FieldMetaData("high", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.LOW, new org.apache.thrift.meta_data.FieldMetaData("low", 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(TBrokerFD.class, metaDataMap); - } - - public TBrokerFD() { - } - - public TBrokerFD( - long high, - long low) - { - this(); - this.high = high; - setHighIsSet(true); - this.low = low; - setLowIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public TBrokerFD(TBrokerFD other) { - __isset_bitfield = other.__isset_bitfield; - this.high = other.high; - this.low = other.low; - } - - public TBrokerFD deepCopy() { - return new TBrokerFD(this); - } - - @Override - public void clear() { - setHighIsSet(false); - this.high = 0; - setLowIsSet(false); - this.low = 0; - } - - public long getHigh() { - return this.high; - } - - public TBrokerFD setHigh(long high) { - this.high = high; - setHighIsSet(true); - return this; - } - - public void unsetHigh() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HIGH_ISSET_ID); - } - - /** Returns true if field high is set (has been assigned a value) and false otherwise */ - public boolean isSetHigh() { - return EncodingUtils.testBit(__isset_bitfield, __HIGH_ISSET_ID); - } - - public void setHighIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HIGH_ISSET_ID, value); - } - - public long getLow() { - return this.low; - } - - public TBrokerFD setLow(long low) { - this.low = low; - setLowIsSet(true); - return this; - } - - public void unsetLow() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LOW_ISSET_ID); - } - - /** Returns true if field low is set (has been assigned a value) and false otherwise */ - public boolean isSetLow() { - return EncodingUtils.testBit(__isset_bitfield, __LOW_ISSET_ID); - } - - public void setLowIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LOW_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case HIGH: - if (value == null) { - unsetHigh(); - } else { - setHigh((Long)value); - } - break; - - case LOW: - if (value == null) { - unsetLow(); - } else { - setLow((Long)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case HIGH: - return getHigh(); - - case LOW: - return getLow(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 HIGH: - return isSetHigh(); - case LOW: - return isSetLow(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBrokerFD) - return this.equals((TBrokerFD)that); - return false; - } - - public boolean equals(TBrokerFD that) { - if (that == null) - return false; - - boolean this_present_high = true; - boolean that_present_high = true; - if (this_present_high || that_present_high) { - if (!(this_present_high && that_present_high)) - return false; - if (this.high != that.high) - return false; - } - - boolean this_present_low = true; - boolean that_present_low = true; - if (this_present_low || that_present_low) { - if (!(this_present_low && that_present_low)) - return false; - if (this.low != that.low) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_high = true; - list.add(present_high); - if (present_high) - list.add(high); - - boolean present_low = true; - list.add(present_low); - if (present_low) - list.add(low); - - return list.hashCode(); - } - - @Override - public int compareTo(TBrokerFD other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetHigh()).compareTo(other.isSetHigh()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHigh()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.high, other.high); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetLow()).compareTo(other.isSetLow()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLow()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.low, other.low); - 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("TBrokerFD("); - boolean first = true; - - sb.append("high:"); - sb.append(this.high); - first = false; - if (!first) sb.append(", "); - sb.append("low:"); - sb.append(this.low); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // alas, we cannot check 'high' because it's a primitive and you chose the non-beans generator. - // alas, we cannot check 'low' 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 TBrokerFDStandardSchemeFactory implements SchemeFactory { - public TBrokerFDStandardScheme getScheme() { - return new TBrokerFDStandardScheme(); - } - } - - private static class TBrokerFDStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBrokerFD struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // HIGH - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.high = iprot.readI64(); - struct.setHighIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // LOW - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.low = iprot.readI64(); - struct.setLowIsSet(true); - } else { - 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.isSetHigh()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'high' was not found in serialized data! Struct: " + toString()); - } - if (!struct.isSetLow()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'low' was not found in serialized data! Struct: " + toString()); - } - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TBrokerFD struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(HIGH_FIELD_DESC); - oprot.writeI64(struct.high); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(LOW_FIELD_DESC); - oprot.writeI64(struct.low); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBrokerFDTupleSchemeFactory implements SchemeFactory { - public TBrokerFDTupleScheme getScheme() { - return new TBrokerFDTupleScheme(); - } - } - - private static class TBrokerFDTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBrokerFD struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI64(struct.high); - oprot.writeI64(struct.low); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBrokerFD struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.high = iprot.readI64(); - struct.setHighIsSet(true); - struct.low = iprot.readI64(); - struct.setLowIsSet(true); - } - } - -} - diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerFileStatus.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerFileStatus.java deleted file mode 100644 index 713a20f9fe..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerFileStatus.java +++ /dev/null @@ -1,683 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-10-27") -public class TBrokerFileStatus implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBrokerFileStatus"); - - private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField IS_DIR_FIELD_DESC = new org.apache.thrift.protocol.TField("isDir", org.apache.thrift.protocol.TType.BOOL, (short)2); - private static final org.apache.thrift.protocol.TField SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("size", org.apache.thrift.protocol.TType.I64, (short)3); - private static final org.apache.thrift.protocol.TField IS_SPLITABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("isSplitable", org.apache.thrift.protocol.TType.BOOL, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBrokerFileStatusStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBrokerFileStatusTupleSchemeFactory()); - } - - public String path; // required - public boolean isDir; // required - public long size; // required - public boolean isSplitable; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - PATH((short)1, "path"), - IS_DIR((short)2, "isDir"), - SIZE((short)3, "size"), - IS_SPLITABLE((short)4, "isSplitable"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // PATH - return PATH; - case 2: // IS_DIR - return IS_DIR; - case 3: // SIZE - return SIZE; - case 4: // IS_SPLITABLE - return IS_SPLITABLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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 __ISDIR_ISSET_ID = 0; - private static final int __SIZE_ISSET_ID = 1; - private static final int __ISSPLITABLE_ISSET_ID = 2; - 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.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.IS_DIR, new org.apache.thrift.meta_data.FieldMetaData("isDir", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.SIZE, new org.apache.thrift.meta_data.FieldMetaData("size", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.IS_SPLITABLE, new org.apache.thrift.meta_data.FieldMetaData("isSplitable", 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(TBrokerFileStatus.class, metaDataMap); - } - - public TBrokerFileStatus() { - } - - public TBrokerFileStatus( - String path, - boolean isDir, - long size, - boolean isSplitable) - { - this(); - this.path = path; - this.isDir = isDir; - setIsDirIsSet(true); - this.size = size; - setSizeIsSet(true); - this.isSplitable = isSplitable; - setIsSplitableIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public TBrokerFileStatus(TBrokerFileStatus other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetPath()) { - this.path = other.path; - } - this.isDir = other.isDir; - this.size = other.size; - this.isSplitable = other.isSplitable; - } - - public TBrokerFileStatus deepCopy() { - return new TBrokerFileStatus(this); - } - - @Override - public void clear() { - this.path = null; - setIsDirIsSet(false); - this.isDir = false; - setSizeIsSet(false); - this.size = 0; - setIsSplitableIsSet(false); - this.isSplitable = false; - } - - public String getPath() { - return this.path; - } - - public TBrokerFileStatus setPath(String path) { - this.path = path; - return this; - } - - public void unsetPath() { - this.path = null; - } - - /** Returns true if field path is set (has been assigned a value) and false otherwise */ - public boolean isSetPath() { - return this.path != null; - } - - public void setPathIsSet(boolean value) { - if (!value) { - this.path = null; - } - } - - public boolean isIsDir() { - return this.isDir; - } - - public TBrokerFileStatus setIsDir(boolean isDir) { - this.isDir = isDir; - setIsDirIsSet(true); - return this; - } - - public void unsetIsDir() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISDIR_ISSET_ID); - } - - /** Returns true if field isDir is set (has been assigned a value) and false otherwise */ - public boolean isSetIsDir() { - return EncodingUtils.testBit(__isset_bitfield, __ISDIR_ISSET_ID); - } - - public void setIsDirIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISDIR_ISSET_ID, value); - } - - public long getSize() { - return this.size; - } - - public TBrokerFileStatus setSize(long size) { - this.size = size; - setSizeIsSet(true); - return this; - } - - public void unsetSize() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SIZE_ISSET_ID); - } - - /** Returns true if field size is set (has been assigned a value) and false otherwise */ - public boolean isSetSize() { - return EncodingUtils.testBit(__isset_bitfield, __SIZE_ISSET_ID); - } - - public void setSizeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SIZE_ISSET_ID, value); - } - - public boolean isIsSplitable() { - return this.isSplitable; - } - - public TBrokerFileStatus setIsSplitable(boolean isSplitable) { - this.isSplitable = isSplitable; - setIsSplitableIsSet(true); - return this; - } - - public void unsetIsSplitable() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISSPLITABLE_ISSET_ID); - } - - /** Returns true if field isSplitable is set (has been assigned a value) and false otherwise */ - public boolean isSetIsSplitable() { - return EncodingUtils.testBit(__isset_bitfield, __ISSPLITABLE_ISSET_ID); - } - - public void setIsSplitableIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISSPLITABLE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case PATH: - if (value == null) { - unsetPath(); - } else { - setPath((String)value); - } - break; - - case IS_DIR: - if (value == null) { - unsetIsDir(); - } else { - setIsDir((Boolean)value); - } - break; - - case SIZE: - if (value == null) { - unsetSize(); - } else { - setSize((Long)value); - } - break; - - case IS_SPLITABLE: - if (value == null) { - unsetIsSplitable(); - } else { - setIsSplitable((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case PATH: - return getPath(); - - case IS_DIR: - return isIsDir(); - - case SIZE: - return getSize(); - - case IS_SPLITABLE: - return isIsSplitable(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 PATH: - return isSetPath(); - case IS_DIR: - return isSetIsDir(); - case SIZE: - return isSetSize(); - case IS_SPLITABLE: - return isSetIsSplitable(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBrokerFileStatus) - return this.equals((TBrokerFileStatus)that); - return false; - } - - public boolean equals(TBrokerFileStatus that) { - if (that == null) - return false; - - boolean this_present_path = true && this.isSetPath(); - boolean that_present_path = true && that.isSetPath(); - if (this_present_path || that_present_path) { - if (!(this_present_path && that_present_path)) - return false; - if (!this.path.equals(that.path)) - return false; - } - - boolean this_present_isDir = true; - boolean that_present_isDir = true; - if (this_present_isDir || that_present_isDir) { - if (!(this_present_isDir && that_present_isDir)) - return false; - if (this.isDir != that.isDir) - return false; - } - - boolean this_present_size = true; - boolean that_present_size = true; - if (this_present_size || that_present_size) { - if (!(this_present_size && that_present_size)) - return false; - if (this.size != that.size) - return false; - } - - boolean this_present_isSplitable = true; - boolean that_present_isSplitable = true; - if (this_present_isSplitable || that_present_isSplitable) { - if (!(this_present_isSplitable && that_present_isSplitable)) - return false; - if (this.isSplitable != that.isSplitable) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_path = true && (isSetPath()); - list.add(present_path); - if (present_path) - list.add(path); - - boolean present_isDir = true; - list.add(present_isDir); - if (present_isDir) - list.add(isDir); - - boolean present_size = true; - list.add(present_size); - if (present_size) - list.add(size); - - boolean present_isSplitable = true; - list.add(present_isSplitable); - if (present_isSplitable) - list.add(isSplitable); - - return list.hashCode(); - } - - @Override - public int compareTo(TBrokerFileStatus other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPath()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIsDir()).compareTo(other.isSetIsDir()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIsDir()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isDir, other.isDir); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSize()).compareTo(other.isSetSize()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSize()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.size, other.size); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIsSplitable()).compareTo(other.isSetIsSplitable()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIsSplitable()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isSplitable, other.isSplitable); - 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("TBrokerFileStatus("); - boolean first = true; - - sb.append("path:"); - if (this.path == null) { - sb.append("null"); - } else { - sb.append(this.path); - } - first = false; - if (!first) sb.append(", "); - sb.append("isDir:"); - sb.append(this.isDir); - first = false; - if (!first) sb.append(", "); - sb.append("size:"); - sb.append(this.size); - first = false; - if (!first) sb.append(", "); - sb.append("isSplitable:"); - sb.append(this.isSplitable); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (path == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'path' was not present! Struct: " + toString()); - } - // alas, we cannot check 'isDir' because it's a primitive and you chose the non-beans generator. - // alas, we cannot check 'size' because it's a primitive and you chose the non-beans generator. - // alas, we cannot check 'isSplitable' 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 TBrokerFileStatusStandardSchemeFactory implements SchemeFactory { - public TBrokerFileStatusStandardScheme getScheme() { - return new TBrokerFileStatusStandardScheme(); - } - } - - private static class TBrokerFileStatusStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBrokerFileStatus struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // PATH - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.path = iprot.readString(); - struct.setPathIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // IS_DIR - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.isDir = iprot.readBool(); - struct.setIsDirIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SIZE - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.size = iprot.readI64(); - struct.setSizeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // IS_SPLITABLE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.isSplitable = iprot.readBool(); - struct.setIsSplitableIsSet(true); - } else { - 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.isSetIsDir()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'isDir' was not found in serialized data! Struct: " + toString()); - } - if (!struct.isSetSize()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'size' was not found in serialized data! Struct: " + toString()); - } - if (!struct.isSetIsSplitable()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'isSplitable' was not found in serialized data! Struct: " + toString()); - } - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TBrokerFileStatus struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(struct.path); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(IS_DIR_FIELD_DESC); - oprot.writeBool(struct.isDir); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(SIZE_FIELD_DESC); - oprot.writeI64(struct.size); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(IS_SPLITABLE_FIELD_DESC); - oprot.writeBool(struct.isSplitable); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBrokerFileStatusTupleSchemeFactory implements SchemeFactory { - public TBrokerFileStatusTupleScheme getScheme() { - return new TBrokerFileStatusTupleScheme(); - } - } - - private static class TBrokerFileStatusTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBrokerFileStatus struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeString(struct.path); - oprot.writeBool(struct.isDir); - oprot.writeI64(struct.size); - oprot.writeBool(struct.isSplitable); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBrokerFileStatus struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.path = iprot.readString(); - struct.setPathIsSet(true); - struct.isDir = iprot.readBool(); - struct.setIsDirIsSet(true); - struct.size = iprot.readI64(); - struct.setSizeIsSet(true); - struct.isSplitable = iprot.readBool(); - struct.setIsSplitableIsSet(true); - } - } - -} - diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerListPathRequest.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerListPathRequest.java deleted file mode 100644 index f5db356dfb..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerListPathRequest.java +++ /dev/null @@ -1,865 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-10-27") -public class TBrokerListPathRequest implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBrokerListPathRequest"); - - private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField IS_RECURSIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("isRecursive", org.apache.thrift.protocol.TType.BOOL, (short)3); - private static final org.apache.thrift.protocol.TField PROPERTIES_FIELD_DESC = new org.apache.thrift.protocol.TField("properties", org.apache.thrift.protocol.TType.MAP, (short)4); - private static final org.apache.thrift.protocol.TField FILE_NAME_ONLY_FIELD_DESC = new org.apache.thrift.protocol.TField("fileNameOnly", org.apache.thrift.protocol.TType.BOOL, (short)5); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBrokerListPathRequestStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBrokerListPathRequestTupleSchemeFactory()); - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion version; // required - public String path; // required - public boolean isRecursive; // required - public Map properties; // required - public boolean fileNameOnly; // 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 TBrokerVersion - */ - VERSION((short)1, "version"), - PATH((short)2, "path"), - IS_RECURSIVE((short)3, "isRecursive"), - PROPERTIES((short)4, "properties"), - FILE_NAME_ONLY((short)5, "fileNameOnly"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VERSION - return VERSION; - case 2: // PATH - return PATH; - case 3: // IS_RECURSIVE - return IS_RECURSIVE; - case 4: // PROPERTIES - return PROPERTIES; - case 5: // FILE_NAME_ONLY - return FILE_NAME_ONLY; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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 __ISRECURSIVE_ISSET_ID = 0; - private static final int __FILENAMEONLY_ISSET_ID = 1; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.FILE_NAME_ONLY}; - 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.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TBrokerVersion.class))); - tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.IS_RECURSIVE, new org.apache.thrift.meta_data.FieldMetaData("isRecursive", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.PROPERTIES, new org.apache.thrift.meta_data.FieldMetaData("properties", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - tmpMap.put(_Fields.FILE_NAME_ONLY, new org.apache.thrift.meta_data.FieldMetaData("fileNameOnly", 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(TBrokerListPathRequest.class, metaDataMap); - } - - public TBrokerListPathRequest() { - } - - public TBrokerListPathRequest( - TBrokerVersion version, - String path, - boolean isRecursive, - Map properties) - { - this(); - this.version = version; - this.path = path; - this.isRecursive = isRecursive; - setIsRecursiveIsSet(true); - this.properties = properties; - } - - /** - * Performs a deep copy on other. - */ - public TBrokerListPathRequest(TBrokerListPathRequest other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetVersion()) { - this.version = other.version; - } - if (other.isSetPath()) { - this.path = other.path; - } - this.isRecursive = other.isRecursive; - if (other.isSetProperties()) { - Map __this__properties = new HashMap(other.properties); - this.properties = __this__properties; - } - this.fileNameOnly = other.fileNameOnly; - } - - public TBrokerListPathRequest deepCopy() { - return new TBrokerListPathRequest(this); - } - - @Override - public void clear() { - this.version = null; - this.path = null; - setIsRecursiveIsSet(false); - this.isRecursive = false; - this.properties = null; - setFileNameOnlyIsSet(false); - this.fileNameOnly = false; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion getVersion() { - return this.version; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerListPathRequest setVersion(TBrokerVersion 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 String getPath() { - return this.path; - } - - public TBrokerListPathRequest setPath(String path) { - this.path = path; - return this; - } - - public void unsetPath() { - this.path = null; - } - - /** Returns true if field path is set (has been assigned a value) and false otherwise */ - public boolean isSetPath() { - return this.path != null; - } - - public void setPathIsSet(boolean value) { - if (!value) { - this.path = null; - } - } - - public boolean isIsRecursive() { - return this.isRecursive; - } - - public TBrokerListPathRequest setIsRecursive(boolean isRecursive) { - this.isRecursive = isRecursive; - setIsRecursiveIsSet(true); - return this; - } - - public void unsetIsRecursive() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISRECURSIVE_ISSET_ID); - } - - /** Returns true if field isRecursive is set (has been assigned a value) and false otherwise */ - public boolean isSetIsRecursive() { - return EncodingUtils.testBit(__isset_bitfield, __ISRECURSIVE_ISSET_ID); - } - - public void setIsRecursiveIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISRECURSIVE_ISSET_ID, value); - } - - public int getPropertiesSize() { - return (this.properties == null) ? 0 : this.properties.size(); - } - - public void putToProperties(String key, String val) { - if (this.properties == null) { - this.properties = new HashMap(); - } - this.properties.put(key, val); - } - - public Map getProperties() { - return this.properties; - } - - public TBrokerListPathRequest setProperties(Map properties) { - this.properties = properties; - return this; - } - - public void unsetProperties() { - this.properties = null; - } - - /** Returns true if field properties is set (has been assigned a value) and false otherwise */ - public boolean isSetProperties() { - return this.properties != null; - } - - public void setPropertiesIsSet(boolean value) { - if (!value) { - this.properties = null; - } - } - - public boolean isFileNameOnly() { - return this.fileNameOnly; - } - - public TBrokerListPathRequest setFileNameOnly(boolean fileNameOnly) { - this.fileNameOnly = fileNameOnly; - setFileNameOnlyIsSet(true); - return this; - } - - public void unsetFileNameOnly() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILENAMEONLY_ISSET_ID); - } - - /** Returns true if field fileNameOnly is set (has been assigned a value) and false otherwise */ - public boolean isSetFileNameOnly() { - return EncodingUtils.testBit(__isset_bitfield, __FILENAMEONLY_ISSET_ID); - } - - public void setFileNameOnlyIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILENAMEONLY_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VERSION: - if (value == null) { - unsetVersion(); - } else { - setVersion((TBrokerVersion)value); - } - break; - - case PATH: - if (value == null) { - unsetPath(); - } else { - setPath((String)value); - } - break; - - case IS_RECURSIVE: - if (value == null) { - unsetIsRecursive(); - } else { - setIsRecursive((Boolean)value); - } - break; - - case PROPERTIES: - if (value == null) { - unsetProperties(); - } else { - setProperties((Map)value); - } - break; - - case FILE_NAME_ONLY: - if (value == null) { - unsetFileNameOnly(); - } else { - setFileNameOnly((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VERSION: - return getVersion(); - - case PATH: - return getPath(); - - case IS_RECURSIVE: - return isIsRecursive(); - - case PROPERTIES: - return getProperties(); - - case FILE_NAME_ONLY: - return isFileNameOnly(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 PATH: - return isSetPath(); - case IS_RECURSIVE: - return isSetIsRecursive(); - case PROPERTIES: - return isSetProperties(); - case FILE_NAME_ONLY: - return isSetFileNameOnly(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBrokerListPathRequest) - return this.equals((TBrokerListPathRequest)that); - return false; - } - - public boolean equals(TBrokerListPathRequest 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_path = true && this.isSetPath(); - boolean that_present_path = true && that.isSetPath(); - if (this_present_path || that_present_path) { - if (!(this_present_path && that_present_path)) - return false; - if (!this.path.equals(that.path)) - return false; - } - - boolean this_present_isRecursive = true; - boolean that_present_isRecursive = true; - if (this_present_isRecursive || that_present_isRecursive) { - if (!(this_present_isRecursive && that_present_isRecursive)) - return false; - if (this.isRecursive != that.isRecursive) - return false; - } - - boolean this_present_properties = true && this.isSetProperties(); - boolean that_present_properties = true && that.isSetProperties(); - if (this_present_properties || that_present_properties) { - if (!(this_present_properties && that_present_properties)) - return false; - if (!this.properties.equals(that.properties)) - return false; - } - - boolean this_present_fileNameOnly = true && this.isSetFileNameOnly(); - boolean that_present_fileNameOnly = true && that.isSetFileNameOnly(); - if (this_present_fileNameOnly || that_present_fileNameOnly) { - if (!(this_present_fileNameOnly && that_present_fileNameOnly)) - return false; - if (this.fileNameOnly != that.fileNameOnly) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_version = true && (isSetVersion()); - list.add(present_version); - if (present_version) - list.add(version.getValue()); - - boolean present_path = true && (isSetPath()); - list.add(present_path); - if (present_path) - list.add(path); - - boolean present_isRecursive = true; - list.add(present_isRecursive); - if (present_isRecursive) - list.add(isRecursive); - - boolean present_properties = true && (isSetProperties()); - list.add(present_properties); - if (present_properties) - list.add(properties); - - boolean present_fileNameOnly = true && (isSetFileNameOnly()); - list.add(present_fileNameOnly); - if (present_fileNameOnly) - list.add(fileNameOnly); - - return list.hashCode(); - } - - @Override - public int compareTo(TBrokerListPathRequest 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(isSetPath()).compareTo(other.isSetPath()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPath()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIsRecursive()).compareTo(other.isSetIsRecursive()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIsRecursive()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isRecursive, other.isRecursive); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetProperties()).compareTo(other.isSetProperties()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetProperties()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.properties, other.properties); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFileNameOnly()).compareTo(other.isSetFileNameOnly()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFileNameOnly()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileNameOnly, other.fileNameOnly); - 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("TBrokerListPathRequest("); - 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("path:"); - if (this.path == null) { - sb.append("null"); - } else { - sb.append(this.path); - } - first = false; - if (!first) sb.append(", "); - sb.append("isRecursive:"); - sb.append(this.isRecursive); - first = false; - if (!first) sb.append(", "); - sb.append("properties:"); - if (this.properties == null) { - sb.append("null"); - } else { - sb.append(this.properties); - } - first = false; - if (isSetFileNameOnly()) { - if (!first) sb.append(", "); - sb.append("fileNameOnly:"); - sb.append(this.fileNameOnly); - 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 (path == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'path' was not present! Struct: " + toString()); - } - // alas, we cannot check 'isRecursive' because it's a primitive and you chose the non-beans generator. - if (properties == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'properties' 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 TBrokerListPathRequestStandardSchemeFactory implements SchemeFactory { - public TBrokerListPathRequestStandardScheme getScheme() { - return new TBrokerListPathRequestStandardScheme(); - } - } - - private static class TBrokerListPathRequestStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBrokerListPathRequest struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.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.I32) { - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // PATH - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.path = iprot.readString(); - struct.setPathIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // IS_RECURSIVE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.isRecursive = iprot.readBool(); - struct.setIsRecursiveIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // PROPERTIES - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map8 = iprot.readMapBegin(); - struct.properties = new HashMap(2*_map8.size); - String _key9; - String _val10; - for (int _i11 = 0; _i11 < _map8.size; ++_i11) - { - _key9 = iprot.readString(); - _val10 = iprot.readString(); - struct.properties.put(_key9, _val10); - } - iprot.readMapEnd(); - } - struct.setPropertiesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // FILE_NAME_ONLY - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.fileNameOnly = iprot.readBool(); - struct.setFileNameOnlyIsSet(true); - } else { - 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.isSetIsRecursive()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'isRecursive' was not found in serialized data! Struct: " + toString()); - } - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TBrokerListPathRequest struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.version != null) { - oprot.writeFieldBegin(VERSION_FIELD_DESC); - oprot.writeI32(struct.version.getValue()); - oprot.writeFieldEnd(); - } - if (struct.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(struct.path); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(IS_RECURSIVE_FIELD_DESC); - oprot.writeBool(struct.isRecursive); - oprot.writeFieldEnd(); - if (struct.properties != null) { - oprot.writeFieldBegin(PROPERTIES_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.properties.size())); - for (Map.Entry _iter12 : struct.properties.entrySet()) - { - oprot.writeString(_iter12.getKey()); - oprot.writeString(_iter12.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.isSetFileNameOnly()) { - oprot.writeFieldBegin(FILE_NAME_ONLY_FIELD_DESC); - oprot.writeBool(struct.fileNameOnly); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBrokerListPathRequestTupleSchemeFactory implements SchemeFactory { - public TBrokerListPathRequestTupleScheme getScheme() { - return new TBrokerListPathRequestTupleScheme(); - } - } - - private static class TBrokerListPathRequestTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBrokerListPathRequest struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.version.getValue()); - oprot.writeString(struct.path); - oprot.writeBool(struct.isRecursive); - { - oprot.writeI32(struct.properties.size()); - for (Map.Entry _iter13 : struct.properties.entrySet()) - { - oprot.writeString(_iter13.getKey()); - oprot.writeString(_iter13.getValue()); - } - } - BitSet optionals = new BitSet(); - if (struct.isSetFileNameOnly()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetFileNameOnly()) { - oprot.writeBool(struct.fileNameOnly); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBrokerListPathRequest struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - struct.path = iprot.readString(); - struct.setPathIsSet(true); - struct.isRecursive = iprot.readBool(); - struct.setIsRecursiveIsSet(true); - { - org.apache.thrift.protocol.TMap _map14 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.properties = new HashMap(2*_map14.size); - String _key15; - String _val16; - for (int _i17 = 0; _i17 < _map14.size; ++_i17) - { - _key15 = iprot.readString(); - _val16 = iprot.readString(); - struct.properties.put(_key15, _val16); - } - } - struct.setPropertiesIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.fileNameOnly = iprot.readBool(); - struct.setFileNameOnlyIsSet(true); - } - } - } - -} - diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerListResponse.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerListResponse.java deleted file mode 100644 index d95529c4cf..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerListResponse.java +++ /dev/null @@ -1,561 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-10-27") -public class TBrokerListResponse implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBrokerListResponse"); - - private static final org.apache.thrift.protocol.TField OP_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("opStatus", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField FILES_FIELD_DESC = new org.apache.thrift.protocol.TField("files", org.apache.thrift.protocol.TType.LIST, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBrokerListResponseStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBrokerListResponseTupleSchemeFactory()); - } - - public TBrokerOperationStatus opStatus; // required - public List files; // 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 { - OP_STATUS((short)1, "opStatus"), - FILES((short)2, "files"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OP_STATUS - return OP_STATUS; - case 2: // FILES - return FILES; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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.FILES}; - 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.OP_STATUS, new org.apache.thrift.meta_data.FieldMetaData("opStatus", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerOperationStatus.class))); - tmpMap.put(_Fields.FILES, new org.apache.thrift.meta_data.FieldMetaData("files", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerFileStatus.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBrokerListResponse.class, metaDataMap); - } - - public TBrokerListResponse() { - } - - public TBrokerListResponse( - TBrokerOperationStatus opStatus) - { - this(); - this.opStatus = opStatus; - } - - /** - * Performs a deep copy on other. - */ - public TBrokerListResponse(TBrokerListResponse other) { - if (other.isSetOpStatus()) { - this.opStatus = new TBrokerOperationStatus(other.opStatus); - } - if (other.isSetFiles()) { - List __this__files = new ArrayList(other.files.size()); - for (TBrokerFileStatus other_element : other.files) { - __this__files.add(new TBrokerFileStatus(other_element)); - } - this.files = __this__files; - } - } - - public TBrokerListResponse deepCopy() { - return new TBrokerListResponse(this); - } - - @Override - public void clear() { - this.opStatus = null; - this.files = null; - } - - public TBrokerOperationStatus getOpStatus() { - return this.opStatus; - } - - public TBrokerListResponse setOpStatus(TBrokerOperationStatus opStatus) { - this.opStatus = opStatus; - return this; - } - - public void unsetOpStatus() { - this.opStatus = null; - } - - /** Returns true if field opStatus is set (has been assigned a value) and false otherwise */ - public boolean isSetOpStatus() { - return this.opStatus != null; - } - - public void setOpStatusIsSet(boolean value) { - if (!value) { - this.opStatus = null; - } - } - - public int getFilesSize() { - return (this.files == null) ? 0 : this.files.size(); - } - - public java.util.Iterator getFilesIterator() { - return (this.files == null) ? null : this.files.iterator(); - } - - public void addToFiles(TBrokerFileStatus elem) { - if (this.files == null) { - this.files = new ArrayList(); - } - this.files.add(elem); - } - - public List getFiles() { - return this.files; - } - - public TBrokerListResponse setFiles(List files) { - this.files = files; - return this; - } - - public void unsetFiles() { - this.files = null; - } - - /** Returns true if field files is set (has been assigned a value) and false otherwise */ - public boolean isSetFiles() { - return this.files != null; - } - - public void setFilesIsSet(boolean value) { - if (!value) { - this.files = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case OP_STATUS: - if (value == null) { - unsetOpStatus(); - } else { - setOpStatus((TBrokerOperationStatus)value); - } - break; - - case FILES: - if (value == null) { - unsetFiles(); - } else { - setFiles((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case OP_STATUS: - return getOpStatus(); - - case FILES: - return getFiles(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 OP_STATUS: - return isSetOpStatus(); - case FILES: - return isSetFiles(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBrokerListResponse) - return this.equals((TBrokerListResponse)that); - return false; - } - - public boolean equals(TBrokerListResponse that) { - if (that == null) - return false; - - boolean this_present_opStatus = true && this.isSetOpStatus(); - boolean that_present_opStatus = true && that.isSetOpStatus(); - if (this_present_opStatus || that_present_opStatus) { - if (!(this_present_opStatus && that_present_opStatus)) - return false; - if (!this.opStatus.equals(that.opStatus)) - return false; - } - - boolean this_present_files = true && this.isSetFiles(); - boolean that_present_files = true && that.isSetFiles(); - if (this_present_files || that_present_files) { - if (!(this_present_files && that_present_files)) - return false; - if (!this.files.equals(that.files)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_opStatus = true && (isSetOpStatus()); - list.add(present_opStatus); - if (present_opStatus) - list.add(opStatus); - - boolean present_files = true && (isSetFiles()); - list.add(present_files); - if (present_files) - list.add(files); - - return list.hashCode(); - } - - @Override - public int compareTo(TBrokerListResponse other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetOpStatus()).compareTo(other.isSetOpStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOpStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.opStatus, other.opStatus); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFiles()).compareTo(other.isSetFiles()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFiles()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.files, other.files); - 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("TBrokerListResponse("); - boolean first = true; - - sb.append("opStatus:"); - if (this.opStatus == null) { - sb.append("null"); - } else { - sb.append(this.opStatus); - } - first = false; - if (isSetFiles()) { - if (!first) sb.append(", "); - sb.append("files:"); - if (this.files == null) { - sb.append("null"); - } else { - sb.append(this.files); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (opStatus == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'opStatus' was not present! Struct: " + toString()); - } - // check for sub-struct validity - if (opStatus != null) { - opStatus.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 TBrokerListResponseStandardSchemeFactory implements SchemeFactory { - public TBrokerListResponseStandardScheme getScheme() { - return new TBrokerListResponseStandardScheme(); - } - } - - private static class TBrokerListResponseStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBrokerListResponse struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // OP_STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.opStatus = new TBrokerOperationStatus(); - struct.opStatus.read(iprot); - struct.setOpStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // FILES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); - struct.files = new ArrayList(_list0.size); - TBrokerFileStatus _elem1; - for (int _i2 = 0; _i2 < _list0.size; ++_i2) - { - _elem1 = new TBrokerFileStatus(); - _elem1.read(iprot); - struct.files.add(_elem1); - } - iprot.readListEnd(); - } - struct.setFilesIsSet(true); - } else { - 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, TBrokerListResponse struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.opStatus != null) { - oprot.writeFieldBegin(OP_STATUS_FIELD_DESC); - struct.opStatus.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.files != null) { - if (struct.isSetFiles()) { - oprot.writeFieldBegin(FILES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.files.size())); - for (TBrokerFileStatus _iter3 : struct.files) - { - _iter3.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBrokerListResponseTupleSchemeFactory implements SchemeFactory { - public TBrokerListResponseTupleScheme getScheme() { - return new TBrokerListResponseTupleScheme(); - } - } - - private static class TBrokerListResponseTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBrokerListResponse struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.opStatus.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetFiles()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetFiles()) { - { - oprot.writeI32(struct.files.size()); - for (TBrokerFileStatus _iter4 : struct.files) - { - _iter4.write(oprot); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBrokerListResponse struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.opStatus = new TBrokerOperationStatus(); - struct.opStatus.read(iprot); - struct.setOpStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.files = new ArrayList(_list5.size); - TBrokerFileStatus _elem6; - for (int _i7 = 0; _i7 < _list5.size; ++_i7) - { - _elem6 = new TBrokerFileStatus(); - _elem6.read(iprot); - struct.files.add(_elem6); - } - } - struct.setFilesIsSet(true); - } - } - } - -} - diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerOpenMode.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerOpenMode.java deleted file mode 100644 index 7256074ca2..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerOpenMode.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.thrift; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum TBrokerOpenMode implements org.apache.thrift.TEnum { - APPEND(1); - - private final int value; - - private TBrokerOpenMode(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 TBrokerOpenMode findByValue(int value) { - switch (value) { - case 1: - return APPEND; - default: - return null; - } - } -} diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerOpenReaderRequest.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerOpenReaderRequest.java deleted file mode 100644 index cccba95e31..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerOpenReaderRequest.java +++ /dev/null @@ -1,862 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-10-27") -public class TBrokerOpenReaderRequest implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBrokerOpenReaderRequest"); - - private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField START_OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("startOffset", org.apache.thrift.protocol.TType.I64, (short)3); - private static final org.apache.thrift.protocol.TField CLIENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("clientId", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.protocol.TField PROPERTIES_FIELD_DESC = new org.apache.thrift.protocol.TField("properties", org.apache.thrift.protocol.TType.MAP, (short)5); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBrokerOpenReaderRequestStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBrokerOpenReaderRequestTupleSchemeFactory()); - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion version; // required - public String path; // required - public long startOffset; // required - public String clientId; // required - public Map properties; // required - - /** 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 TBrokerVersion - */ - VERSION((short)1, "version"), - PATH((short)2, "path"), - START_OFFSET((short)3, "startOffset"), - CLIENT_ID((short)4, "clientId"), - PROPERTIES((short)5, "properties"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VERSION - return VERSION; - case 2: // PATH - return PATH; - case 3: // START_OFFSET - return START_OFFSET; - case 4: // CLIENT_ID - return CLIENT_ID; - case 5: // PROPERTIES - return PROPERTIES; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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 __STARTOFFSET_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.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TBrokerVersion.class))); - tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.START_OFFSET, new org.apache.thrift.meta_data.FieldMetaData("startOffset", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.CLIENT_ID, new org.apache.thrift.meta_data.FieldMetaData("clientId", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.PROPERTIES, new org.apache.thrift.meta_data.FieldMetaData("properties", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBrokerOpenReaderRequest.class, metaDataMap); - } - - public TBrokerOpenReaderRequest() { - } - - public TBrokerOpenReaderRequest( - TBrokerVersion version, - String path, - long startOffset, - String clientId, - Map properties) - { - this(); - this.version = version; - this.path = path; - this.startOffset = startOffset; - setStartOffsetIsSet(true); - this.clientId = clientId; - this.properties = properties; - } - - /** - * Performs a deep copy on other. - */ - public TBrokerOpenReaderRequest(TBrokerOpenReaderRequest other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetVersion()) { - this.version = other.version; - } - if (other.isSetPath()) { - this.path = other.path; - } - this.startOffset = other.startOffset; - if (other.isSetClientId()) { - this.clientId = other.clientId; - } - if (other.isSetProperties()) { - Map __this__properties = new HashMap(other.properties); - this.properties = __this__properties; - } - } - - public TBrokerOpenReaderRequest deepCopy() { - return new TBrokerOpenReaderRequest(this); - } - - @Override - public void clear() { - this.version = null; - this.path = null; - setStartOffsetIsSet(false); - this.startOffset = 0; - this.clientId = null; - this.properties = null; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion getVersion() { - return this.version; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerOpenReaderRequest setVersion(TBrokerVersion 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 String getPath() { - return this.path; - } - - public TBrokerOpenReaderRequest setPath(String path) { - this.path = path; - return this; - } - - public void unsetPath() { - this.path = null; - } - - /** Returns true if field path is set (has been assigned a value) and false otherwise */ - public boolean isSetPath() { - return this.path != null; - } - - public void setPathIsSet(boolean value) { - if (!value) { - this.path = null; - } - } - - public long getStartOffset() { - return this.startOffset; - } - - public TBrokerOpenReaderRequest setStartOffset(long startOffset) { - this.startOffset = startOffset; - setStartOffsetIsSet(true); - return this; - } - - public void unsetStartOffset() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTOFFSET_ISSET_ID); - } - - /** Returns true if field startOffset is set (has been assigned a value) and false otherwise */ - public boolean isSetStartOffset() { - return EncodingUtils.testBit(__isset_bitfield, __STARTOFFSET_ISSET_ID); - } - - public void setStartOffsetIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTOFFSET_ISSET_ID, value); - } - - public String getClientId() { - return this.clientId; - } - - public TBrokerOpenReaderRequest setClientId(String clientId) { - this.clientId = clientId; - return this; - } - - public void unsetClientId() { - this.clientId = null; - } - - /** Returns true if field clientId is set (has been assigned a value) and false otherwise */ - public boolean isSetClientId() { - return this.clientId != null; - } - - public void setClientIdIsSet(boolean value) { - if (!value) { - this.clientId = null; - } - } - - public int getPropertiesSize() { - return (this.properties == null) ? 0 : this.properties.size(); - } - - public void putToProperties(String key, String val) { - if (this.properties == null) { - this.properties = new HashMap(); - } - this.properties.put(key, val); - } - - public Map getProperties() { - return this.properties; - } - - public TBrokerOpenReaderRequest setProperties(Map properties) { - this.properties = properties; - return this; - } - - public void unsetProperties() { - this.properties = null; - } - - /** Returns true if field properties is set (has been assigned a value) and false otherwise */ - public boolean isSetProperties() { - return this.properties != null; - } - - public void setPropertiesIsSet(boolean value) { - if (!value) { - this.properties = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VERSION: - if (value == null) { - unsetVersion(); - } else { - setVersion((TBrokerVersion)value); - } - break; - - case PATH: - if (value == null) { - unsetPath(); - } else { - setPath((String)value); - } - break; - - case START_OFFSET: - if (value == null) { - unsetStartOffset(); - } else { - setStartOffset((Long)value); - } - break; - - case CLIENT_ID: - if (value == null) { - unsetClientId(); - } else { - setClientId((String)value); - } - break; - - case PROPERTIES: - if (value == null) { - unsetProperties(); - } else { - setProperties((Map)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VERSION: - return getVersion(); - - case PATH: - return getPath(); - - case START_OFFSET: - return getStartOffset(); - - case CLIENT_ID: - return getClientId(); - - case PROPERTIES: - return getProperties(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 PATH: - return isSetPath(); - case START_OFFSET: - return isSetStartOffset(); - case CLIENT_ID: - return isSetClientId(); - case PROPERTIES: - return isSetProperties(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBrokerOpenReaderRequest) - return this.equals((TBrokerOpenReaderRequest)that); - return false; - } - - public boolean equals(TBrokerOpenReaderRequest 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_path = true && this.isSetPath(); - boolean that_present_path = true && that.isSetPath(); - if (this_present_path || that_present_path) { - if (!(this_present_path && that_present_path)) - return false; - if (!this.path.equals(that.path)) - return false; - } - - boolean this_present_startOffset = true; - boolean that_present_startOffset = true; - if (this_present_startOffset || that_present_startOffset) { - if (!(this_present_startOffset && that_present_startOffset)) - return false; - if (this.startOffset != that.startOffset) - return false; - } - - boolean this_present_clientId = true && this.isSetClientId(); - boolean that_present_clientId = true && that.isSetClientId(); - if (this_present_clientId || that_present_clientId) { - if (!(this_present_clientId && that_present_clientId)) - return false; - if (!this.clientId.equals(that.clientId)) - return false; - } - - boolean this_present_properties = true && this.isSetProperties(); - boolean that_present_properties = true && that.isSetProperties(); - if (this_present_properties || that_present_properties) { - if (!(this_present_properties && that_present_properties)) - return false; - if (!this.properties.equals(that.properties)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_version = true && (isSetVersion()); - list.add(present_version); - if (present_version) - list.add(version.getValue()); - - boolean present_path = true && (isSetPath()); - list.add(present_path); - if (present_path) - list.add(path); - - boolean present_startOffset = true; - list.add(present_startOffset); - if (present_startOffset) - list.add(startOffset); - - boolean present_clientId = true && (isSetClientId()); - list.add(present_clientId); - if (present_clientId) - list.add(clientId); - - boolean present_properties = true && (isSetProperties()); - list.add(present_properties); - if (present_properties) - list.add(properties); - - return list.hashCode(); - } - - @Override - public int compareTo(TBrokerOpenReaderRequest 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(isSetPath()).compareTo(other.isSetPath()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPath()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStartOffset()).compareTo(other.isSetStartOffset()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStartOffset()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startOffset, other.startOffset); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetClientId()).compareTo(other.isSetClientId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetClientId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clientId, other.clientId); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetProperties()).compareTo(other.isSetProperties()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetProperties()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.properties, other.properties); - 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("TBrokerOpenReaderRequest("); - 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("path:"); - if (this.path == null) { - sb.append("null"); - } else { - sb.append(this.path); - } - first = false; - if (!first) sb.append(", "); - sb.append("startOffset:"); - sb.append(this.startOffset); - first = false; - if (!first) sb.append(", "); - sb.append("clientId:"); - if (this.clientId == null) { - sb.append("null"); - } else { - sb.append(this.clientId); - } - first = false; - if (!first) sb.append(", "); - sb.append("properties:"); - if (this.properties == null) { - sb.append("null"); - } else { - sb.append(this.properties); - } - 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 (path == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'path' was not present! Struct: " + toString()); - } - // alas, we cannot check 'startOffset' because it's a primitive and you chose the non-beans generator. - if (clientId == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'clientId' was not present! Struct: " + toString()); - } - if (properties == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'properties' 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 TBrokerOpenReaderRequestStandardSchemeFactory implements SchemeFactory { - public TBrokerOpenReaderRequestStandardScheme getScheme() { - return new TBrokerOpenReaderRequestStandardScheme(); - } - } - - private static class TBrokerOpenReaderRequestStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBrokerOpenReaderRequest struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.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.I32) { - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // PATH - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.path = iprot.readString(); - struct.setPathIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // START_OFFSET - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.startOffset = iprot.readI64(); - struct.setStartOffsetIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // CLIENT_ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.clientId = iprot.readString(); - struct.setClientIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // PROPERTIES - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map48 = iprot.readMapBegin(); - struct.properties = new HashMap(2*_map48.size); - String _key49; - String _val50; - for (int _i51 = 0; _i51 < _map48.size; ++_i51) - { - _key49 = iprot.readString(); - _val50 = iprot.readString(); - struct.properties.put(_key49, _val50); - } - iprot.readMapEnd(); - } - struct.setPropertiesIsSet(true); - } else { - 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.isSetStartOffset()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'startOffset' was not found in serialized data! Struct: " + toString()); - } - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TBrokerOpenReaderRequest struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.version != null) { - oprot.writeFieldBegin(VERSION_FIELD_DESC); - oprot.writeI32(struct.version.getValue()); - oprot.writeFieldEnd(); - } - if (struct.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(struct.path); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(START_OFFSET_FIELD_DESC); - oprot.writeI64(struct.startOffset); - oprot.writeFieldEnd(); - if (struct.clientId != null) { - oprot.writeFieldBegin(CLIENT_ID_FIELD_DESC); - oprot.writeString(struct.clientId); - oprot.writeFieldEnd(); - } - if (struct.properties != null) { - oprot.writeFieldBegin(PROPERTIES_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.properties.size())); - for (Map.Entry _iter52 : struct.properties.entrySet()) - { - oprot.writeString(_iter52.getKey()); - oprot.writeString(_iter52.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBrokerOpenReaderRequestTupleSchemeFactory implements SchemeFactory { - public TBrokerOpenReaderRequestTupleScheme getScheme() { - return new TBrokerOpenReaderRequestTupleScheme(); - } - } - - private static class TBrokerOpenReaderRequestTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBrokerOpenReaderRequest struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.version.getValue()); - oprot.writeString(struct.path); - oprot.writeI64(struct.startOffset); - oprot.writeString(struct.clientId); - { - oprot.writeI32(struct.properties.size()); - for (Map.Entry _iter53 : struct.properties.entrySet()) - { - oprot.writeString(_iter53.getKey()); - oprot.writeString(_iter53.getValue()); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBrokerOpenReaderRequest struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - struct.path = iprot.readString(); - struct.setPathIsSet(true); - struct.startOffset = iprot.readI64(); - struct.setStartOffsetIsSet(true); - struct.clientId = iprot.readString(); - struct.setClientIdIsSet(true); - { - org.apache.thrift.protocol.TMap _map54 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.properties = new HashMap(2*_map54.size); - String _key55; - String _val56; - for (int _i57 = 0; _i57 < _map54.size; ++_i57) - { - _key55 = iprot.readString(); - _val56 = iprot.readString(); - struct.properties.put(_key55, _val56); - } - } - struct.setPropertiesIsSet(true); - } - } - -} - diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerOpenReaderResponse.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerOpenReaderResponse.java deleted file mode 100644 index f0149df531..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerOpenReaderResponse.java +++ /dev/null @@ -1,512 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-10-27") -public class TBrokerOpenReaderResponse implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBrokerOpenReaderResponse"); - - private static final org.apache.thrift.protocol.TField OP_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("opStatus", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField FD_FIELD_DESC = new org.apache.thrift.protocol.TField("fd", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBrokerOpenReaderResponseStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBrokerOpenReaderResponseTupleSchemeFactory()); - } - - public TBrokerOperationStatus opStatus; // required - public TBrokerFD fd; // 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 { - OP_STATUS((short)1, "opStatus"), - FD((short)2, "fd"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OP_STATUS - return OP_STATUS; - case 2: // FD - return FD; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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.FD}; - 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.OP_STATUS, new org.apache.thrift.meta_data.FieldMetaData("opStatus", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerOperationStatus.class))); - tmpMap.put(_Fields.FD, new org.apache.thrift.meta_data.FieldMetaData("fd", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerFD.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBrokerOpenReaderResponse.class, metaDataMap); - } - - public TBrokerOpenReaderResponse() { - } - - public TBrokerOpenReaderResponse( - TBrokerOperationStatus opStatus) - { - this(); - this.opStatus = opStatus; - } - - /** - * Performs a deep copy on other. - */ - public TBrokerOpenReaderResponse(TBrokerOpenReaderResponse other) { - if (other.isSetOpStatus()) { - this.opStatus = new TBrokerOperationStatus(other.opStatus); - } - if (other.isSetFd()) { - this.fd = new TBrokerFD(other.fd); - } - } - - public TBrokerOpenReaderResponse deepCopy() { - return new TBrokerOpenReaderResponse(this); - } - - @Override - public void clear() { - this.opStatus = null; - this.fd = null; - } - - public TBrokerOperationStatus getOpStatus() { - return this.opStatus; - } - - public TBrokerOpenReaderResponse setOpStatus(TBrokerOperationStatus opStatus) { - this.opStatus = opStatus; - return this; - } - - public void unsetOpStatus() { - this.opStatus = null; - } - - /** Returns true if field opStatus is set (has been assigned a value) and false otherwise */ - public boolean isSetOpStatus() { - return this.opStatus != null; - } - - public void setOpStatusIsSet(boolean value) { - if (!value) { - this.opStatus = null; - } - } - - public TBrokerFD getFd() { - return this.fd; - } - - public TBrokerOpenReaderResponse setFd(TBrokerFD fd) { - this.fd = fd; - return this; - } - - public void unsetFd() { - this.fd = null; - } - - /** Returns true if field fd is set (has been assigned a value) and false otherwise */ - public boolean isSetFd() { - return this.fd != null; - } - - public void setFdIsSet(boolean value) { - if (!value) { - this.fd = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case OP_STATUS: - if (value == null) { - unsetOpStatus(); - } else { - setOpStatus((TBrokerOperationStatus)value); - } - break; - - case FD: - if (value == null) { - unsetFd(); - } else { - setFd((TBrokerFD)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case OP_STATUS: - return getOpStatus(); - - case FD: - return getFd(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 OP_STATUS: - return isSetOpStatus(); - case FD: - return isSetFd(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBrokerOpenReaderResponse) - return this.equals((TBrokerOpenReaderResponse)that); - return false; - } - - public boolean equals(TBrokerOpenReaderResponse that) { - if (that == null) - return false; - - boolean this_present_opStatus = true && this.isSetOpStatus(); - boolean that_present_opStatus = true && that.isSetOpStatus(); - if (this_present_opStatus || that_present_opStatus) { - if (!(this_present_opStatus && that_present_opStatus)) - return false; - if (!this.opStatus.equals(that.opStatus)) - return false; - } - - boolean this_present_fd = true && this.isSetFd(); - boolean that_present_fd = true && that.isSetFd(); - if (this_present_fd || that_present_fd) { - if (!(this_present_fd && that_present_fd)) - return false; - if (!this.fd.equals(that.fd)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_opStatus = true && (isSetOpStatus()); - list.add(present_opStatus); - if (present_opStatus) - list.add(opStatus); - - boolean present_fd = true && (isSetFd()); - list.add(present_fd); - if (present_fd) - list.add(fd); - - return list.hashCode(); - } - - @Override - public int compareTo(TBrokerOpenReaderResponse other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetOpStatus()).compareTo(other.isSetOpStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOpStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.opStatus, other.opStatus); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFd()).compareTo(other.isSetFd()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFd()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fd, other.fd); - 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("TBrokerOpenReaderResponse("); - boolean first = true; - - sb.append("opStatus:"); - if (this.opStatus == null) { - sb.append("null"); - } else { - sb.append(this.opStatus); - } - first = false; - if (isSetFd()) { - if (!first) sb.append(", "); - sb.append("fd:"); - if (this.fd == null) { - sb.append("null"); - } else { - sb.append(this.fd); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (opStatus == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'opStatus' was not present! Struct: " + toString()); - } - // check for sub-struct validity - if (opStatus != null) { - opStatus.validate(); - } - if (fd != null) { - fd.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 TBrokerOpenReaderResponseStandardSchemeFactory implements SchemeFactory { - public TBrokerOpenReaderResponseStandardScheme getScheme() { - return new TBrokerOpenReaderResponseStandardScheme(); - } - } - - private static class TBrokerOpenReaderResponseStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBrokerOpenReaderResponse struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // OP_STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.opStatus = new TBrokerOperationStatus(); - struct.opStatus.read(iprot); - struct.setOpStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // FD - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.fd = new TBrokerFD(); - struct.fd.read(iprot); - struct.setFdIsSet(true); - } else { - 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, TBrokerOpenReaderResponse struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.opStatus != null) { - oprot.writeFieldBegin(OP_STATUS_FIELD_DESC); - struct.opStatus.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.fd != null) { - if (struct.isSetFd()) { - oprot.writeFieldBegin(FD_FIELD_DESC); - struct.fd.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBrokerOpenReaderResponseTupleSchemeFactory implements SchemeFactory { - public TBrokerOpenReaderResponseTupleScheme getScheme() { - return new TBrokerOpenReaderResponseTupleScheme(); - } - } - - private static class TBrokerOpenReaderResponseTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBrokerOpenReaderResponse struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.opStatus.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetFd()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetFd()) { - struct.fd.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBrokerOpenReaderResponse struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.opStatus = new TBrokerOperationStatus(); - struct.opStatus.read(iprot); - struct.setOpStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.fd = new TBrokerFD(); - struct.fd.read(iprot); - struct.setFdIsSet(true); - } - } - } - -} - diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerOpenWriterRequest.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerOpenWriterRequest.java deleted file mode 100644 index 1321d29be4..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerOpenWriterRequest.java +++ /dev/null @@ -1,879 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-10-27") -public class TBrokerOpenWriterRequest implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBrokerOpenWriterRequest"); - - private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField OPEN_MODE_FIELD_DESC = new org.apache.thrift.protocol.TField("openMode", org.apache.thrift.protocol.TType.I32, (short)3); - private static final org.apache.thrift.protocol.TField CLIENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("clientId", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.protocol.TField PROPERTIES_FIELD_DESC = new org.apache.thrift.protocol.TField("properties", org.apache.thrift.protocol.TType.MAP, (short)5); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBrokerOpenWriterRequestStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBrokerOpenWriterRequestTupleSchemeFactory()); - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion version; // required - public String path; // required - /** - * - * @see TBrokerOpenMode - */ - public TBrokerOpenMode openMode; // required - public String clientId; // required - public Map properties; // required - - /** 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 TBrokerVersion - */ - VERSION((short)1, "version"), - PATH((short)2, "path"), - /** - * - * @see TBrokerOpenMode - */ - OPEN_MODE((short)3, "openMode"), - CLIENT_ID((short)4, "clientId"), - PROPERTIES((short)5, "properties"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VERSION - return VERSION; - case 2: // PATH - return PATH; - case 3: // OPEN_MODE - return OPEN_MODE; - case 4: // CLIENT_ID - return CLIENT_ID; - case 5: // PROPERTIES - return PROPERTIES; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TBrokerVersion.class))); - tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.OPEN_MODE, new org.apache.thrift.meta_data.FieldMetaData("openMode", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TBrokerOpenMode.class))); - tmpMap.put(_Fields.CLIENT_ID, new org.apache.thrift.meta_data.FieldMetaData("clientId", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.PROPERTIES, new org.apache.thrift.meta_data.FieldMetaData("properties", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBrokerOpenWriterRequest.class, metaDataMap); - } - - public TBrokerOpenWriterRequest() { - } - - public TBrokerOpenWriterRequest( - TBrokerVersion version, - String path, - TBrokerOpenMode openMode, - String clientId, - Map properties) - { - this(); - this.version = version; - this.path = path; - this.openMode = openMode; - this.clientId = clientId; - this.properties = properties; - } - - /** - * Performs a deep copy on other. - */ - public TBrokerOpenWriterRequest(TBrokerOpenWriterRequest other) { - if (other.isSetVersion()) { - this.version = other.version; - } - if (other.isSetPath()) { - this.path = other.path; - } - if (other.isSetOpenMode()) { - this.openMode = other.openMode; - } - if (other.isSetClientId()) { - this.clientId = other.clientId; - } - if (other.isSetProperties()) { - Map __this__properties = new HashMap(other.properties); - this.properties = __this__properties; - } - } - - public TBrokerOpenWriterRequest deepCopy() { - return new TBrokerOpenWriterRequest(this); - } - - @Override - public void clear() { - this.version = null; - this.path = null; - this.openMode = null; - this.clientId = null; - this.properties = null; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion getVersion() { - return this.version; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerOpenWriterRequest setVersion(TBrokerVersion 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 String getPath() { - return this.path; - } - - public TBrokerOpenWriterRequest setPath(String path) { - this.path = path; - return this; - } - - public void unsetPath() { - this.path = null; - } - - /** Returns true if field path is set (has been assigned a value) and false otherwise */ - public boolean isSetPath() { - return this.path != null; - } - - public void setPathIsSet(boolean value) { - if (!value) { - this.path = null; - } - } - - /** - * - * @see TBrokerOpenMode - */ - public TBrokerOpenMode getOpenMode() { - return this.openMode; - } - - /** - * - * @see TBrokerOpenMode - */ - public TBrokerOpenWriterRequest setOpenMode(TBrokerOpenMode openMode) { - this.openMode = openMode; - return this; - } - - public void unsetOpenMode() { - this.openMode = null; - } - - /** Returns true if field openMode is set (has been assigned a value) and false otherwise */ - public boolean isSetOpenMode() { - return this.openMode != null; - } - - public void setOpenModeIsSet(boolean value) { - if (!value) { - this.openMode = null; - } - } - - public String getClientId() { - return this.clientId; - } - - public TBrokerOpenWriterRequest setClientId(String clientId) { - this.clientId = clientId; - return this; - } - - public void unsetClientId() { - this.clientId = null; - } - - /** Returns true if field clientId is set (has been assigned a value) and false otherwise */ - public boolean isSetClientId() { - return this.clientId != null; - } - - public void setClientIdIsSet(boolean value) { - if (!value) { - this.clientId = null; - } - } - - public int getPropertiesSize() { - return (this.properties == null) ? 0 : this.properties.size(); - } - - public void putToProperties(String key, String val) { - if (this.properties == null) { - this.properties = new HashMap(); - } - this.properties.put(key, val); - } - - public Map getProperties() { - return this.properties; - } - - public TBrokerOpenWriterRequest setProperties(Map properties) { - this.properties = properties; - return this; - } - - public void unsetProperties() { - this.properties = null; - } - - /** Returns true if field properties is set (has been assigned a value) and false otherwise */ - public boolean isSetProperties() { - return this.properties != null; - } - - public void setPropertiesIsSet(boolean value) { - if (!value) { - this.properties = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VERSION: - if (value == null) { - unsetVersion(); - } else { - setVersion((TBrokerVersion)value); - } - break; - - case PATH: - if (value == null) { - unsetPath(); - } else { - setPath((String)value); - } - break; - - case OPEN_MODE: - if (value == null) { - unsetOpenMode(); - } else { - setOpenMode((TBrokerOpenMode)value); - } - break; - - case CLIENT_ID: - if (value == null) { - unsetClientId(); - } else { - setClientId((String)value); - } - break; - - case PROPERTIES: - if (value == null) { - unsetProperties(); - } else { - setProperties((Map)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VERSION: - return getVersion(); - - case PATH: - return getPath(); - - case OPEN_MODE: - return getOpenMode(); - - case CLIENT_ID: - return getClientId(); - - case PROPERTIES: - return getProperties(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 PATH: - return isSetPath(); - case OPEN_MODE: - return isSetOpenMode(); - case CLIENT_ID: - return isSetClientId(); - case PROPERTIES: - return isSetProperties(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBrokerOpenWriterRequest) - return this.equals((TBrokerOpenWriterRequest)that); - return false; - } - - public boolean equals(TBrokerOpenWriterRequest 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_path = true && this.isSetPath(); - boolean that_present_path = true && that.isSetPath(); - if (this_present_path || that_present_path) { - if (!(this_present_path && that_present_path)) - return false; - if (!this.path.equals(that.path)) - return false; - } - - boolean this_present_openMode = true && this.isSetOpenMode(); - boolean that_present_openMode = true && that.isSetOpenMode(); - if (this_present_openMode || that_present_openMode) { - if (!(this_present_openMode && that_present_openMode)) - return false; - if (!this.openMode.equals(that.openMode)) - return false; - } - - boolean this_present_clientId = true && this.isSetClientId(); - boolean that_present_clientId = true && that.isSetClientId(); - if (this_present_clientId || that_present_clientId) { - if (!(this_present_clientId && that_present_clientId)) - return false; - if (!this.clientId.equals(that.clientId)) - return false; - } - - boolean this_present_properties = true && this.isSetProperties(); - boolean that_present_properties = true && that.isSetProperties(); - if (this_present_properties || that_present_properties) { - if (!(this_present_properties && that_present_properties)) - return false; - if (!this.properties.equals(that.properties)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_version = true && (isSetVersion()); - list.add(present_version); - if (present_version) - list.add(version.getValue()); - - boolean present_path = true && (isSetPath()); - list.add(present_path); - if (present_path) - list.add(path); - - boolean present_openMode = true && (isSetOpenMode()); - list.add(present_openMode); - if (present_openMode) - list.add(openMode.getValue()); - - boolean present_clientId = true && (isSetClientId()); - list.add(present_clientId); - if (present_clientId) - list.add(clientId); - - boolean present_properties = true && (isSetProperties()); - list.add(present_properties); - if (present_properties) - list.add(properties); - - return list.hashCode(); - } - - @Override - public int compareTo(TBrokerOpenWriterRequest 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(isSetPath()).compareTo(other.isSetPath()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPath()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOpenMode()).compareTo(other.isSetOpenMode()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOpenMode()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.openMode, other.openMode); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetClientId()).compareTo(other.isSetClientId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetClientId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clientId, other.clientId); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetProperties()).compareTo(other.isSetProperties()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetProperties()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.properties, other.properties); - 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("TBrokerOpenWriterRequest("); - 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("path:"); - if (this.path == null) { - sb.append("null"); - } else { - sb.append(this.path); - } - first = false; - if (!first) sb.append(", "); - sb.append("openMode:"); - if (this.openMode == null) { - sb.append("null"); - } else { - sb.append(this.openMode); - } - first = false; - if (!first) sb.append(", "); - sb.append("clientId:"); - if (this.clientId == null) { - sb.append("null"); - } else { - sb.append(this.clientId); - } - first = false; - if (!first) sb.append(", "); - sb.append("properties:"); - if (this.properties == null) { - sb.append("null"); - } else { - sb.append(this.properties); - } - 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 (path == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'path' was not present! Struct: " + toString()); - } - if (openMode == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'openMode' was not present! Struct: " + toString()); - } - if (clientId == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'clientId' was not present! Struct: " + toString()); - } - if (properties == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'properties' 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 TBrokerOpenWriterRequestStandardSchemeFactory implements SchemeFactory { - public TBrokerOpenWriterRequestStandardScheme getScheme() { - return new TBrokerOpenWriterRequestStandardScheme(); - } - } - - private static class TBrokerOpenWriterRequestStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBrokerOpenWriterRequest struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.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.I32) { - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // PATH - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.path = iprot.readString(); - struct.setPathIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // OPEN_MODE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.openMode = com.baidu.palo.thrift.TBrokerOpenMode.findByValue(iprot.readI32()); - struct.setOpenModeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // CLIENT_ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.clientId = iprot.readString(); - struct.setClientIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // PROPERTIES - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map58 = iprot.readMapBegin(); - struct.properties = new HashMap(2*_map58.size); - String _key59; - String _val60; - for (int _i61 = 0; _i61 < _map58.size; ++_i61) - { - _key59 = iprot.readString(); - _val60 = iprot.readString(); - struct.properties.put(_key59, _val60); - } - iprot.readMapEnd(); - } - struct.setPropertiesIsSet(true); - } else { - 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, TBrokerOpenWriterRequest struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.version != null) { - oprot.writeFieldBegin(VERSION_FIELD_DESC); - oprot.writeI32(struct.version.getValue()); - oprot.writeFieldEnd(); - } - if (struct.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(struct.path); - oprot.writeFieldEnd(); - } - if (struct.openMode != null) { - oprot.writeFieldBegin(OPEN_MODE_FIELD_DESC); - oprot.writeI32(struct.openMode.getValue()); - oprot.writeFieldEnd(); - } - if (struct.clientId != null) { - oprot.writeFieldBegin(CLIENT_ID_FIELD_DESC); - oprot.writeString(struct.clientId); - oprot.writeFieldEnd(); - } - if (struct.properties != null) { - oprot.writeFieldBegin(PROPERTIES_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.properties.size())); - for (Map.Entry _iter62 : struct.properties.entrySet()) - { - oprot.writeString(_iter62.getKey()); - oprot.writeString(_iter62.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBrokerOpenWriterRequestTupleSchemeFactory implements SchemeFactory { - public TBrokerOpenWriterRequestTupleScheme getScheme() { - return new TBrokerOpenWriterRequestTupleScheme(); - } - } - - private static class TBrokerOpenWriterRequestTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBrokerOpenWriterRequest struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.version.getValue()); - oprot.writeString(struct.path); - oprot.writeI32(struct.openMode.getValue()); - oprot.writeString(struct.clientId); - { - oprot.writeI32(struct.properties.size()); - for (Map.Entry _iter63 : struct.properties.entrySet()) - { - oprot.writeString(_iter63.getKey()); - oprot.writeString(_iter63.getValue()); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBrokerOpenWriterRequest struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - struct.path = iprot.readString(); - struct.setPathIsSet(true); - struct.openMode = com.baidu.palo.thrift.TBrokerOpenMode.findByValue(iprot.readI32()); - struct.setOpenModeIsSet(true); - struct.clientId = iprot.readString(); - struct.setClientIdIsSet(true); - { - org.apache.thrift.protocol.TMap _map64 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.properties = new HashMap(2*_map64.size); - String _key65; - String _val66; - for (int _i67 = 0; _i67 < _map64.size; ++_i67) - { - _key65 = iprot.readString(); - _val66 = iprot.readString(); - struct.properties.put(_key65, _val66); - } - } - struct.setPropertiesIsSet(true); - } - } - -} - diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerOpenWriterResponse.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerOpenWriterResponse.java deleted file mode 100644 index ba1ed5983c..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerOpenWriterResponse.java +++ /dev/null @@ -1,512 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-10-27") -public class TBrokerOpenWriterResponse implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBrokerOpenWriterResponse"); - - private static final org.apache.thrift.protocol.TField OP_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("opStatus", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField FD_FIELD_DESC = new org.apache.thrift.protocol.TField("fd", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBrokerOpenWriterResponseStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBrokerOpenWriterResponseTupleSchemeFactory()); - } - - public TBrokerOperationStatus opStatus; // required - public TBrokerFD fd; // 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 { - OP_STATUS((short)1, "opStatus"), - FD((short)2, "fd"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OP_STATUS - return OP_STATUS; - case 2: // FD - return FD; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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.FD}; - 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.OP_STATUS, new org.apache.thrift.meta_data.FieldMetaData("opStatus", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerOperationStatus.class))); - tmpMap.put(_Fields.FD, new org.apache.thrift.meta_data.FieldMetaData("fd", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerFD.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBrokerOpenWriterResponse.class, metaDataMap); - } - - public TBrokerOpenWriterResponse() { - } - - public TBrokerOpenWriterResponse( - TBrokerOperationStatus opStatus) - { - this(); - this.opStatus = opStatus; - } - - /** - * Performs a deep copy on other. - */ - public TBrokerOpenWriterResponse(TBrokerOpenWriterResponse other) { - if (other.isSetOpStatus()) { - this.opStatus = new TBrokerOperationStatus(other.opStatus); - } - if (other.isSetFd()) { - this.fd = new TBrokerFD(other.fd); - } - } - - public TBrokerOpenWriterResponse deepCopy() { - return new TBrokerOpenWriterResponse(this); - } - - @Override - public void clear() { - this.opStatus = null; - this.fd = null; - } - - public TBrokerOperationStatus getOpStatus() { - return this.opStatus; - } - - public TBrokerOpenWriterResponse setOpStatus(TBrokerOperationStatus opStatus) { - this.opStatus = opStatus; - return this; - } - - public void unsetOpStatus() { - this.opStatus = null; - } - - /** Returns true if field opStatus is set (has been assigned a value) and false otherwise */ - public boolean isSetOpStatus() { - return this.opStatus != null; - } - - public void setOpStatusIsSet(boolean value) { - if (!value) { - this.opStatus = null; - } - } - - public TBrokerFD getFd() { - return this.fd; - } - - public TBrokerOpenWriterResponse setFd(TBrokerFD fd) { - this.fd = fd; - return this; - } - - public void unsetFd() { - this.fd = null; - } - - /** Returns true if field fd is set (has been assigned a value) and false otherwise */ - public boolean isSetFd() { - return this.fd != null; - } - - public void setFdIsSet(boolean value) { - if (!value) { - this.fd = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case OP_STATUS: - if (value == null) { - unsetOpStatus(); - } else { - setOpStatus((TBrokerOperationStatus)value); - } - break; - - case FD: - if (value == null) { - unsetFd(); - } else { - setFd((TBrokerFD)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case OP_STATUS: - return getOpStatus(); - - case FD: - return getFd(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 OP_STATUS: - return isSetOpStatus(); - case FD: - return isSetFd(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBrokerOpenWriterResponse) - return this.equals((TBrokerOpenWriterResponse)that); - return false; - } - - public boolean equals(TBrokerOpenWriterResponse that) { - if (that == null) - return false; - - boolean this_present_opStatus = true && this.isSetOpStatus(); - boolean that_present_opStatus = true && that.isSetOpStatus(); - if (this_present_opStatus || that_present_opStatus) { - if (!(this_present_opStatus && that_present_opStatus)) - return false; - if (!this.opStatus.equals(that.opStatus)) - return false; - } - - boolean this_present_fd = true && this.isSetFd(); - boolean that_present_fd = true && that.isSetFd(); - if (this_present_fd || that_present_fd) { - if (!(this_present_fd && that_present_fd)) - return false; - if (!this.fd.equals(that.fd)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_opStatus = true && (isSetOpStatus()); - list.add(present_opStatus); - if (present_opStatus) - list.add(opStatus); - - boolean present_fd = true && (isSetFd()); - list.add(present_fd); - if (present_fd) - list.add(fd); - - return list.hashCode(); - } - - @Override - public int compareTo(TBrokerOpenWriterResponse other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetOpStatus()).compareTo(other.isSetOpStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOpStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.opStatus, other.opStatus); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFd()).compareTo(other.isSetFd()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFd()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fd, other.fd); - 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("TBrokerOpenWriterResponse("); - boolean first = true; - - sb.append("opStatus:"); - if (this.opStatus == null) { - sb.append("null"); - } else { - sb.append(this.opStatus); - } - first = false; - if (isSetFd()) { - if (!first) sb.append(", "); - sb.append("fd:"); - if (this.fd == null) { - sb.append("null"); - } else { - sb.append(this.fd); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (opStatus == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'opStatus' was not present! Struct: " + toString()); - } - // check for sub-struct validity - if (opStatus != null) { - opStatus.validate(); - } - if (fd != null) { - fd.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 TBrokerOpenWriterResponseStandardSchemeFactory implements SchemeFactory { - public TBrokerOpenWriterResponseStandardScheme getScheme() { - return new TBrokerOpenWriterResponseStandardScheme(); - } - } - - private static class TBrokerOpenWriterResponseStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBrokerOpenWriterResponse struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // OP_STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.opStatus = new TBrokerOperationStatus(); - struct.opStatus.read(iprot); - struct.setOpStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // FD - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.fd = new TBrokerFD(); - struct.fd.read(iprot); - struct.setFdIsSet(true); - } else { - 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, TBrokerOpenWriterResponse struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.opStatus != null) { - oprot.writeFieldBegin(OP_STATUS_FIELD_DESC); - struct.opStatus.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.fd != null) { - if (struct.isSetFd()) { - oprot.writeFieldBegin(FD_FIELD_DESC); - struct.fd.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBrokerOpenWriterResponseTupleSchemeFactory implements SchemeFactory { - public TBrokerOpenWriterResponseTupleScheme getScheme() { - return new TBrokerOpenWriterResponseTupleScheme(); - } - } - - private static class TBrokerOpenWriterResponseTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBrokerOpenWriterResponse struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.opStatus.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetFd()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetFd()) { - struct.fd.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBrokerOpenWriterResponse struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.opStatus = new TBrokerOperationStatus(); - struct.opStatus.read(iprot); - struct.setOpStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.fd = new TBrokerFD(); - struct.fd.read(iprot); - struct.setFdIsSet(true); - } - } - } - -} - diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerOperationStatus.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerOperationStatus.java deleted file mode 100644 index 82ee9205f2..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerOperationStatus.java +++ /dev/null @@ -1,518 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-10-27") -public class TBrokerOperationStatus implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBrokerOperationStatus"); - - 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 MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBrokerOperationStatusStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBrokerOperationStatusTupleSchemeFactory()); - } - - /** - * - * @see TBrokerOperationStatusCode - */ - public TBrokerOperationStatusCode statusCode; // required - public String message; // 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 TBrokerOperationStatusCode - */ - STATUS_CODE((short)1, "statusCode"), - MESSAGE((short)2, "message"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS_CODE - return STATUS_CODE; - case 2: // MESSAGE - return MESSAGE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.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, TBrokerOperationStatusCode.class))); - tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", 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(TBrokerOperationStatus.class, metaDataMap); - } - - public TBrokerOperationStatus() { - } - - public TBrokerOperationStatus( - TBrokerOperationStatusCode statusCode) - { - this(); - this.statusCode = statusCode; - } - - /** - * Performs a deep copy on other. - */ - public TBrokerOperationStatus(TBrokerOperationStatus other) { - if (other.isSetStatusCode()) { - this.statusCode = other.statusCode; - } - if (other.isSetMessage()) { - this.message = other.message; - } - } - - public TBrokerOperationStatus deepCopy() { - return new TBrokerOperationStatus(this); - } - - @Override - public void clear() { - this.statusCode = null; - this.message = null; - } - - /** - * - * @see TBrokerOperationStatusCode - */ - public TBrokerOperationStatusCode getStatusCode() { - return this.statusCode; - } - - /** - * - * @see TBrokerOperationStatusCode - */ - public TBrokerOperationStatus setStatusCode(TBrokerOperationStatusCode 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 String getMessage() { - return this.message; - } - - public TBrokerOperationStatus setMessage(String message) { - this.message = message; - return this; - } - - public void unsetMessage() { - this.message = null; - } - - /** Returns true if field message is set (has been assigned a value) and false otherwise */ - public boolean isSetMessage() { - return this.message != null; - } - - public void setMessageIsSet(boolean value) { - if (!value) { - this.message = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS_CODE: - if (value == null) { - unsetStatusCode(); - } else { - setStatusCode((TBrokerOperationStatusCode)value); - } - break; - - case MESSAGE: - if (value == null) { - unsetMessage(); - } else { - setMessage((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS_CODE: - return getStatusCode(); - - case MESSAGE: - return getMessage(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 MESSAGE: - return isSetMessage(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBrokerOperationStatus) - return this.equals((TBrokerOperationStatus)that); - return false; - } - - public boolean equals(TBrokerOperationStatus 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_message = true && this.isSetMessage(); - boolean that_present_message = true && that.isSetMessage(); - if (this_present_message || that_present_message) { - if (!(this_present_message && that_present_message)) - return false; - if (!this.message.equals(that.message)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_statusCode = true && (isSetStatusCode()); - list.add(present_statusCode); - if (present_statusCode) - list.add(statusCode.getValue()); - - boolean present_message = true && (isSetMessage()); - list.add(present_message); - if (present_message) - list.add(message); - - return list.hashCode(); - } - - @Override - public int compareTo(TBrokerOperationStatus 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(isSetMessage()).compareTo(other.isSetMessage()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMessage()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message); - 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("TBrokerOperationStatus("); - boolean first = true; - - sb.append("statusCode:"); - if (this.statusCode == null) { - sb.append("null"); - } else { - sb.append(this.statusCode); - } - first = false; - if (isSetMessage()) { - if (!first) sb.append(", "); - sb.append("message:"); - if (this.message == null) { - sb.append("null"); - } else { - sb.append(this.message); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws 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 { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TBrokerOperationStatusStandardSchemeFactory implements SchemeFactory { - public TBrokerOperationStatusStandardScheme getScheme() { - return new TBrokerOperationStatusStandardScheme(); - } - } - - private static class TBrokerOperationStatusStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBrokerOperationStatus struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.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 = com.baidu.palo.thrift.TBrokerOperationStatusCode.findByValue(iprot.readI32()); - struct.setStatusCodeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // MESSAGE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.message = iprot.readString(); - struct.setMessageIsSet(true); - } else { - 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, TBrokerOperationStatus 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.message != null) { - if (struct.isSetMessage()) { - oprot.writeFieldBegin(MESSAGE_FIELD_DESC); - oprot.writeString(struct.message); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBrokerOperationStatusTupleSchemeFactory implements SchemeFactory { - public TBrokerOperationStatusTupleScheme getScheme() { - return new TBrokerOperationStatusTupleScheme(); - } - } - - private static class TBrokerOperationStatusTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBrokerOperationStatus struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.statusCode.getValue()); - BitSet optionals = new BitSet(); - if (struct.isSetMessage()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetMessage()) { - oprot.writeString(struct.message); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBrokerOperationStatus struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.statusCode = com.baidu.palo.thrift.TBrokerOperationStatusCode.findByValue(iprot.readI32()); - struct.setStatusCodeIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.message = iprot.readString(); - struct.setMessageIsSet(true); - } - } - } - -} - diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerOperationStatusCode.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerOperationStatusCode.java deleted file mode 100644 index d474e82554..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerOperationStatusCode.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.thrift; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum TBrokerOperationStatusCode implements org.apache.thrift.TEnum { - OK(0), - END_OF_FILE(301), - NOT_AUTHORIZED(401), - DUPLICATE_REQUEST(402), - INVALID_INPUT_OFFSET(403), - INVALID_INPUT_FILE_PATH(404), - INVALID_ARGUMENT(405), - FILE_NOT_FOUND(501), - TARGET_STORAGE_SERVICE_ERROR(502), - OPERATION_NOT_SUPPORTED(503); - - private final int value; - - private TBrokerOperationStatusCode(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 TBrokerOperationStatusCode findByValue(int value) { - switch (value) { - case 0: - return OK; - case 301: - return END_OF_FILE; - case 401: - return NOT_AUTHORIZED; - case 402: - return DUPLICATE_REQUEST; - case 403: - return INVALID_INPUT_OFFSET; - case 404: - return INVALID_INPUT_FILE_PATH; - case 405: - return INVALID_ARGUMENT; - case 501: - return FILE_NOT_FOUND; - case 502: - return TARGET_STORAGE_SERVICE_ERROR; - case 503: - return OPERATION_NOT_SUPPORTED; - default: - return null; - } - } -} diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerPReadRequest.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerPReadRequest.java deleted file mode 100644 index 039f3b4c70..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerPReadRequest.java +++ /dev/null @@ -1,709 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-10-27") -public class TBrokerPReadRequest implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBrokerPReadRequest"); - - private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField FD_FIELD_DESC = new org.apache.thrift.protocol.TField("fd", org.apache.thrift.protocol.TType.STRUCT, (short)2); - 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)3); - private static final org.apache.thrift.protocol.TField LENGTH_FIELD_DESC = new org.apache.thrift.protocol.TField("length", org.apache.thrift.protocol.TType.I64, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBrokerPReadRequestStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBrokerPReadRequestTupleSchemeFactory()); - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion version; // required - public TBrokerFD fd; // required - public long offset; // required - public long length; // required - - /** 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 TBrokerVersion - */ - VERSION((short)1, "version"), - FD((short)2, "fd"), - OFFSET((short)3, "offset"), - LENGTH((short)4, "length"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VERSION - return VERSION; - case 2: // FD - return FD; - case 3: // OFFSET - return OFFSET; - case 4: // LENGTH - return LENGTH; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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 __LENGTH_ISSET_ID = 1; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TBrokerVersion.class))); - tmpMap.put(_Fields.FD, new org.apache.thrift.meta_data.FieldMetaData("fd", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerFD.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.LENGTH, new org.apache.thrift.meta_data.FieldMetaData("length", 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(TBrokerPReadRequest.class, metaDataMap); - } - - public TBrokerPReadRequest() { - } - - public TBrokerPReadRequest( - TBrokerVersion version, - TBrokerFD fd, - long offset, - long length) - { - this(); - this.version = version; - this.fd = fd; - this.offset = offset; - setOffsetIsSet(true); - this.length = length; - setLengthIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public TBrokerPReadRequest(TBrokerPReadRequest other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetVersion()) { - this.version = other.version; - } - if (other.isSetFd()) { - this.fd = new TBrokerFD(other.fd); - } - this.offset = other.offset; - this.length = other.length; - } - - public TBrokerPReadRequest deepCopy() { - return new TBrokerPReadRequest(this); - } - - @Override - public void clear() { - this.version = null; - this.fd = null; - setOffsetIsSet(false); - this.offset = 0; - setLengthIsSet(false); - this.length = 0; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion getVersion() { - return this.version; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerPReadRequest setVersion(TBrokerVersion 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 TBrokerFD getFd() { - return this.fd; - } - - public TBrokerPReadRequest setFd(TBrokerFD fd) { - this.fd = fd; - return this; - } - - public void unsetFd() { - this.fd = null; - } - - /** Returns true if field fd is set (has been assigned a value) and false otherwise */ - public boolean isSetFd() { - return this.fd != null; - } - - public void setFdIsSet(boolean value) { - if (!value) { - this.fd = null; - } - } - - public long getOffset() { - return this.offset; - } - - public TBrokerPReadRequest 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); - } - - public long getLength() { - return this.length; - } - - public TBrokerPReadRequest setLength(long length) { - this.length = length; - setLengthIsSet(true); - return this; - } - - public void unsetLength() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LENGTH_ISSET_ID); - } - - /** Returns true if field length is set (has been assigned a value) and false otherwise */ - public boolean isSetLength() { - return EncodingUtils.testBit(__isset_bitfield, __LENGTH_ISSET_ID); - } - - public void setLengthIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LENGTH_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VERSION: - if (value == null) { - unsetVersion(); - } else { - setVersion((TBrokerVersion)value); - } - break; - - case FD: - if (value == null) { - unsetFd(); - } else { - setFd((TBrokerFD)value); - } - break; - - case OFFSET: - if (value == null) { - unsetOffset(); - } else { - setOffset((Long)value); - } - break; - - case LENGTH: - if (value == null) { - unsetLength(); - } else { - setLength((Long)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VERSION: - return getVersion(); - - case FD: - return getFd(); - - case OFFSET: - return getOffset(); - - case LENGTH: - return getLength(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 FD: - return isSetFd(); - case OFFSET: - return isSetOffset(); - case LENGTH: - return isSetLength(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBrokerPReadRequest) - return this.equals((TBrokerPReadRequest)that); - return false; - } - - public boolean equals(TBrokerPReadRequest 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_fd = true && this.isSetFd(); - boolean that_present_fd = true && that.isSetFd(); - if (this_present_fd || that_present_fd) { - if (!(this_present_fd && that_present_fd)) - return false; - if (!this.fd.equals(that.fd)) - 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_length = true; - boolean that_present_length = true; - if (this_present_length || that_present_length) { - if (!(this_present_length && that_present_length)) - return false; - if (this.length != that.length) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_version = true && (isSetVersion()); - list.add(present_version); - if (present_version) - list.add(version.getValue()); - - boolean present_fd = true && (isSetFd()); - list.add(present_fd); - if (present_fd) - list.add(fd); - - boolean present_offset = true; - list.add(present_offset); - if (present_offset) - list.add(offset); - - boolean present_length = true; - list.add(present_length); - if (present_length) - list.add(length); - - return list.hashCode(); - } - - @Override - public int compareTo(TBrokerPReadRequest 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(isSetFd()).compareTo(other.isSetFd()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFd()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fd, other.fd); - if (lastComparison != 0) { - return lastComparison; - } - } - 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(isSetLength()).compareTo(other.isSetLength()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLength()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.length, other.length); - 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("TBrokerPReadRequest("); - 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("fd:"); - if (this.fd == null) { - sb.append("null"); - } else { - sb.append(this.fd); - } - first = false; - if (!first) sb.append(", "); - sb.append("offset:"); - sb.append(this.offset); - first = false; - if (!first) sb.append(", "); - sb.append("length:"); - sb.append(this.length); - 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 (fd == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'fd' was not present! Struct: " + toString()); - } - // alas, we cannot check 'offset' because it's a primitive and you chose the non-beans generator. - // alas, we cannot check 'length' because it's a primitive and you chose the non-beans generator. - // check for sub-struct validity - if (fd != null) { - fd.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 TBrokerPReadRequestStandardSchemeFactory implements SchemeFactory { - public TBrokerPReadRequestStandardScheme getScheme() { - return new TBrokerPReadRequestStandardScheme(); - } - } - - private static class TBrokerPReadRequestStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBrokerPReadRequest struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.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.I32) { - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // FD - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.fd = new TBrokerFD(); - struct.fd.read(iprot); - struct.setFdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // 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 4: // LENGTH - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.length = iprot.readI64(); - struct.setLengthIsSet(true); - } else { - 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.isSetLength()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'length' was not found in serialized data! Struct: " + toString()); - } - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TBrokerPReadRequest struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.version != null) { - oprot.writeFieldBegin(VERSION_FIELD_DESC); - oprot.writeI32(struct.version.getValue()); - oprot.writeFieldEnd(); - } - if (struct.fd != null) { - oprot.writeFieldBegin(FD_FIELD_DESC); - struct.fd.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(OFFSET_FIELD_DESC); - oprot.writeI64(struct.offset); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(LENGTH_FIELD_DESC); - oprot.writeI64(struct.length); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBrokerPReadRequestTupleSchemeFactory implements SchemeFactory { - public TBrokerPReadRequestTupleScheme getScheme() { - return new TBrokerPReadRequestTupleScheme(); - } - } - - private static class TBrokerPReadRequestTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBrokerPReadRequest struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.version.getValue()); - struct.fd.write(oprot); - oprot.writeI64(struct.offset); - oprot.writeI64(struct.length); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBrokerPReadRequest struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - struct.fd = new TBrokerFD(); - struct.fd.read(iprot); - struct.setFdIsSet(true); - struct.offset = iprot.readI64(); - struct.setOffsetIsSet(true); - struct.length = iprot.readI64(); - struct.setLengthIsSet(true); - } - } - -} - diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerPWriteRequest.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerPWriteRequest.java deleted file mode 100644 index 42a4ac2e5c..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerPWriteRequest.java +++ /dev/null @@ -1,724 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-10-27") -public class TBrokerPWriteRequest implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBrokerPWriteRequest"); - - private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField FD_FIELD_DESC = new org.apache.thrift.protocol.TField("fd", org.apache.thrift.protocol.TType.STRUCT, (short)2); - 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)3); - private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.STRING, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBrokerPWriteRequestStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBrokerPWriteRequestTupleSchemeFactory()); - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion version; // required - public TBrokerFD fd; // required - public long offset; // required - public ByteBuffer data; // required - - /** 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 TBrokerVersion - */ - VERSION((short)1, "version"), - FD((short)2, "fd"), - OFFSET((short)3, "offset"), - DATA((short)4, "data"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VERSION - return VERSION; - case 2: // FD - return FD; - case 3: // OFFSET - return OFFSET; - case 4: // DATA - return DATA; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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 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.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TBrokerVersion.class))); - tmpMap.put(_Fields.FD, new org.apache.thrift.meta_data.FieldMetaData("fd", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerFD.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.DATA, new org.apache.thrift.meta_data.FieldMetaData("data", 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(TBrokerPWriteRequest.class, metaDataMap); - } - - public TBrokerPWriteRequest() { - } - - public TBrokerPWriteRequest( - TBrokerVersion version, - TBrokerFD fd, - long offset, - ByteBuffer data) - { - this(); - this.version = version; - this.fd = fd; - this.offset = offset; - setOffsetIsSet(true); - this.data = org.apache.thrift.TBaseHelper.copyBinary(data); - } - - /** - * Performs a deep copy on other. - */ - public TBrokerPWriteRequest(TBrokerPWriteRequest other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetVersion()) { - this.version = other.version; - } - if (other.isSetFd()) { - this.fd = new TBrokerFD(other.fd); - } - this.offset = other.offset; - if (other.isSetData()) { - this.data = org.apache.thrift.TBaseHelper.copyBinary(other.data); - } - } - - public TBrokerPWriteRequest deepCopy() { - return new TBrokerPWriteRequest(this); - } - - @Override - public void clear() { - this.version = null; - this.fd = null; - setOffsetIsSet(false); - this.offset = 0; - this.data = null; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion getVersion() { - return this.version; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerPWriteRequest setVersion(TBrokerVersion 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 TBrokerFD getFd() { - return this.fd; - } - - public TBrokerPWriteRequest setFd(TBrokerFD fd) { - this.fd = fd; - return this; - } - - public void unsetFd() { - this.fd = null; - } - - /** Returns true if field fd is set (has been assigned a value) and false otherwise */ - public boolean isSetFd() { - return this.fd != null; - } - - public void setFdIsSet(boolean value) { - if (!value) { - this.fd = null; - } - } - - public long getOffset() { - return this.offset; - } - - public TBrokerPWriteRequest 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); - } - - public byte[] getData() { - setData(org.apache.thrift.TBaseHelper.rightSize(data)); - return data == null ? null : data.array(); - } - - public ByteBuffer bufferForData() { - return org.apache.thrift.TBaseHelper.copyBinary(data); - } - - public TBrokerPWriteRequest setData(byte[] data) { - this.data = data == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(data, data.length)); - return this; - } - - public TBrokerPWriteRequest setData(ByteBuffer data) { - this.data = org.apache.thrift.TBaseHelper.copyBinary(data); - return this; - } - - public void unsetData() { - this.data = null; - } - - /** Returns true if field data is set (has been assigned a value) and false otherwise */ - public boolean isSetData() { - return this.data != null; - } - - public void setDataIsSet(boolean value) { - if (!value) { - this.data = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VERSION: - if (value == null) { - unsetVersion(); - } else { - setVersion((TBrokerVersion)value); - } - break; - - case FD: - if (value == null) { - unsetFd(); - } else { - setFd((TBrokerFD)value); - } - break; - - case OFFSET: - if (value == null) { - unsetOffset(); - } else { - setOffset((Long)value); - } - break; - - case DATA: - if (value == null) { - unsetData(); - } else { - setData((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VERSION: - return getVersion(); - - case FD: - return getFd(); - - case OFFSET: - return getOffset(); - - case DATA: - return getData(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 FD: - return isSetFd(); - case OFFSET: - return isSetOffset(); - case DATA: - return isSetData(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBrokerPWriteRequest) - return this.equals((TBrokerPWriteRequest)that); - return false; - } - - public boolean equals(TBrokerPWriteRequest 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_fd = true && this.isSetFd(); - boolean that_present_fd = true && that.isSetFd(); - if (this_present_fd || that_present_fd) { - if (!(this_present_fd && that_present_fd)) - return false; - if (!this.fd.equals(that.fd)) - 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_data = true && this.isSetData(); - boolean that_present_data = true && that.isSetData(); - if (this_present_data || that_present_data) { - if (!(this_present_data && that_present_data)) - return false; - if (!this.data.equals(that.data)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_version = true && (isSetVersion()); - list.add(present_version); - if (present_version) - list.add(version.getValue()); - - boolean present_fd = true && (isSetFd()); - list.add(present_fd); - if (present_fd) - list.add(fd); - - boolean present_offset = true; - list.add(present_offset); - if (present_offset) - list.add(offset); - - boolean present_data = true && (isSetData()); - list.add(present_data); - if (present_data) - list.add(data); - - return list.hashCode(); - } - - @Override - public int compareTo(TBrokerPWriteRequest 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(isSetFd()).compareTo(other.isSetFd()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFd()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fd, other.fd); - if (lastComparison != 0) { - return lastComparison; - } - } - 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(isSetData()).compareTo(other.isSetData()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetData()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data, other.data); - 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("TBrokerPWriteRequest("); - 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("fd:"); - if (this.fd == null) { - sb.append("null"); - } else { - sb.append(this.fd); - } - first = false; - if (!first) sb.append(", "); - sb.append("offset:"); - sb.append(this.offset); - first = false; - if (!first) sb.append(", "); - sb.append("data:"); - if (this.data == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.data, sb); - } - 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 (fd == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'fd' was not present! Struct: " + toString()); - } - // alas, we cannot check 'offset' because it's a primitive and you chose the non-beans generator. - if (data == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'data' was not present! Struct: " + toString()); - } - // check for sub-struct validity - if (fd != null) { - fd.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 TBrokerPWriteRequestStandardSchemeFactory implements SchemeFactory { - public TBrokerPWriteRequestStandardScheme getScheme() { - return new TBrokerPWriteRequestStandardScheme(); - } - } - - private static class TBrokerPWriteRequestStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBrokerPWriteRequest struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.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.I32) { - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // FD - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.fd = new TBrokerFD(); - struct.fd.read(iprot); - struct.setFdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // 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 4: // DATA - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.data = iprot.readBinary(); - struct.setDataIsSet(true); - } else { - 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()); - } - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TBrokerPWriteRequest struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.version != null) { - oprot.writeFieldBegin(VERSION_FIELD_DESC); - oprot.writeI32(struct.version.getValue()); - oprot.writeFieldEnd(); - } - if (struct.fd != null) { - oprot.writeFieldBegin(FD_FIELD_DESC); - struct.fd.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(OFFSET_FIELD_DESC); - oprot.writeI64(struct.offset); - oprot.writeFieldEnd(); - if (struct.data != null) { - oprot.writeFieldBegin(DATA_FIELD_DESC); - oprot.writeBinary(struct.data); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBrokerPWriteRequestTupleSchemeFactory implements SchemeFactory { - public TBrokerPWriteRequestTupleScheme getScheme() { - return new TBrokerPWriteRequestTupleScheme(); - } - } - - private static class TBrokerPWriteRequestTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBrokerPWriteRequest struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.version.getValue()); - struct.fd.write(oprot); - oprot.writeI64(struct.offset); - oprot.writeBinary(struct.data); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBrokerPWriteRequest struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - struct.fd = new TBrokerFD(); - struct.fd.read(iprot); - struct.setFdIsSet(true); - struct.offset = iprot.readI64(); - struct.setOffsetIsSet(true); - struct.data = iprot.readBinary(); - struct.setDataIsSet(true); - } - } - -} - diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerPingBrokerRequest.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerPingBrokerRequest.java deleted file mode 100644 index 022d83edb0..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerPingBrokerRequest.java +++ /dev/null @@ -1,508 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-10-27") -public class TBrokerPingBrokerRequest implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBrokerPingBrokerRequest"); - - private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField CLIENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("clientId", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBrokerPingBrokerRequestStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBrokerPingBrokerRequestTupleSchemeFactory()); - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion version; // required - public String clientId; // required - - /** 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 TBrokerVersion - */ - VERSION((short)1, "version"), - CLIENT_ID((short)2, "clientId"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VERSION - return VERSION; - case 2: // CLIENT_ID - return CLIENT_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.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TBrokerVersion.class))); - tmpMap.put(_Fields.CLIENT_ID, new org.apache.thrift.meta_data.FieldMetaData("clientId", 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(TBrokerPingBrokerRequest.class, metaDataMap); - } - - public TBrokerPingBrokerRequest() { - } - - public TBrokerPingBrokerRequest( - TBrokerVersion version, - String clientId) - { - this(); - this.version = version; - this.clientId = clientId; - } - - /** - * Performs a deep copy on other. - */ - public TBrokerPingBrokerRequest(TBrokerPingBrokerRequest other) { - if (other.isSetVersion()) { - this.version = other.version; - } - if (other.isSetClientId()) { - this.clientId = other.clientId; - } - } - - public TBrokerPingBrokerRequest deepCopy() { - return new TBrokerPingBrokerRequest(this); - } - - @Override - public void clear() { - this.version = null; - this.clientId = null; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion getVersion() { - return this.version; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerPingBrokerRequest setVersion(TBrokerVersion 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 String getClientId() { - return this.clientId; - } - - public TBrokerPingBrokerRequest setClientId(String clientId) { - this.clientId = clientId; - return this; - } - - public void unsetClientId() { - this.clientId = null; - } - - /** Returns true if field clientId is set (has been assigned a value) and false otherwise */ - public boolean isSetClientId() { - return this.clientId != null; - } - - public void setClientIdIsSet(boolean value) { - if (!value) { - this.clientId = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VERSION: - if (value == null) { - unsetVersion(); - } else { - setVersion((TBrokerVersion)value); - } - break; - - case CLIENT_ID: - if (value == null) { - unsetClientId(); - } else { - setClientId((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VERSION: - return getVersion(); - - case CLIENT_ID: - return getClientId(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 CLIENT_ID: - return isSetClientId(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBrokerPingBrokerRequest) - return this.equals((TBrokerPingBrokerRequest)that); - return false; - } - - public boolean equals(TBrokerPingBrokerRequest 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_clientId = true && this.isSetClientId(); - boolean that_present_clientId = true && that.isSetClientId(); - if (this_present_clientId || that_present_clientId) { - if (!(this_present_clientId && that_present_clientId)) - return false; - if (!this.clientId.equals(that.clientId)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_version = true && (isSetVersion()); - list.add(present_version); - if (present_version) - list.add(version.getValue()); - - boolean present_clientId = true && (isSetClientId()); - list.add(present_clientId); - if (present_clientId) - list.add(clientId); - - return list.hashCode(); - } - - @Override - public int compareTo(TBrokerPingBrokerRequest 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(isSetClientId()).compareTo(other.isSetClientId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetClientId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clientId, other.clientId); - 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("TBrokerPingBrokerRequest("); - 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("clientId:"); - if (this.clientId == null) { - sb.append("null"); - } else { - sb.append(this.clientId); - } - 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 (clientId == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'clientId' 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 TBrokerPingBrokerRequestStandardSchemeFactory implements SchemeFactory { - public TBrokerPingBrokerRequestStandardScheme getScheme() { - return new TBrokerPingBrokerRequestStandardScheme(); - } - } - - private static class TBrokerPingBrokerRequestStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBrokerPingBrokerRequest struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.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.I32) { - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // CLIENT_ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.clientId = iprot.readString(); - struct.setClientIdIsSet(true); - } else { - 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, TBrokerPingBrokerRequest struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.version != null) { - oprot.writeFieldBegin(VERSION_FIELD_DESC); - oprot.writeI32(struct.version.getValue()); - oprot.writeFieldEnd(); - } - if (struct.clientId != null) { - oprot.writeFieldBegin(CLIENT_ID_FIELD_DESC); - oprot.writeString(struct.clientId); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBrokerPingBrokerRequestTupleSchemeFactory implements SchemeFactory { - public TBrokerPingBrokerRequestTupleScheme getScheme() { - return new TBrokerPingBrokerRequestTupleScheme(); - } - } - - private static class TBrokerPingBrokerRequestTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBrokerPingBrokerRequest struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.version.getValue()); - oprot.writeString(struct.clientId); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBrokerPingBrokerRequest struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - struct.clientId = iprot.readString(); - struct.setClientIdIsSet(true); - } - } - -} - diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerReadResponse.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerReadResponse.java deleted file mode 100644 index b0b7d15edc..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerReadResponse.java +++ /dev/null @@ -1,517 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-10-27") -public class TBrokerReadResponse implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBrokerReadResponse"); - - private static final org.apache.thrift.protocol.TField OP_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("opStatus", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBrokerReadResponseStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBrokerReadResponseTupleSchemeFactory()); - } - - public TBrokerOperationStatus opStatus; // required - public ByteBuffer data; // 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 { - OP_STATUS((short)1, "opStatus"), - DATA((short)2, "data"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OP_STATUS - return OP_STATUS; - case 2: // DATA - return DATA; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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.DATA}; - 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.OP_STATUS, new org.apache.thrift.meta_data.FieldMetaData("opStatus", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerOperationStatus.class))); - tmpMap.put(_Fields.DATA, new org.apache.thrift.meta_data.FieldMetaData("data", org.apache.thrift.TFieldRequirementType.OPTIONAL, - 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(TBrokerReadResponse.class, metaDataMap); - } - - public TBrokerReadResponse() { - } - - public TBrokerReadResponse( - TBrokerOperationStatus opStatus) - { - this(); - this.opStatus = opStatus; - } - - /** - * Performs a deep copy on other. - */ - public TBrokerReadResponse(TBrokerReadResponse other) { - if (other.isSetOpStatus()) { - this.opStatus = new TBrokerOperationStatus(other.opStatus); - } - if (other.isSetData()) { - this.data = org.apache.thrift.TBaseHelper.copyBinary(other.data); - } - } - - public TBrokerReadResponse deepCopy() { - return new TBrokerReadResponse(this); - } - - @Override - public void clear() { - this.opStatus = null; - this.data = null; - } - - public TBrokerOperationStatus getOpStatus() { - return this.opStatus; - } - - public TBrokerReadResponse setOpStatus(TBrokerOperationStatus opStatus) { - this.opStatus = opStatus; - return this; - } - - public void unsetOpStatus() { - this.opStatus = null; - } - - /** Returns true if field opStatus is set (has been assigned a value) and false otherwise */ - public boolean isSetOpStatus() { - return this.opStatus != null; - } - - public void setOpStatusIsSet(boolean value) { - if (!value) { - this.opStatus = null; - } - } - - public byte[] getData() { - setData(org.apache.thrift.TBaseHelper.rightSize(data)); - return data == null ? null : data.array(); - } - - public ByteBuffer bufferForData() { - return org.apache.thrift.TBaseHelper.copyBinary(data); - } - - public TBrokerReadResponse setData(byte[] data) { - this.data = data == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(data, data.length)); - return this; - } - - public TBrokerReadResponse setData(ByteBuffer data) { - this.data = org.apache.thrift.TBaseHelper.copyBinary(data); - return this; - } - - public void unsetData() { - this.data = null; - } - - /** Returns true if field data is set (has been assigned a value) and false otherwise */ - public boolean isSetData() { - return this.data != null; - } - - public void setDataIsSet(boolean value) { - if (!value) { - this.data = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case OP_STATUS: - if (value == null) { - unsetOpStatus(); - } else { - setOpStatus((TBrokerOperationStatus)value); - } - break; - - case DATA: - if (value == null) { - unsetData(); - } else { - setData((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case OP_STATUS: - return getOpStatus(); - - case DATA: - return getData(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 OP_STATUS: - return isSetOpStatus(); - case DATA: - return isSetData(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBrokerReadResponse) - return this.equals((TBrokerReadResponse)that); - return false; - } - - public boolean equals(TBrokerReadResponse that) { - if (that == null) - return false; - - boolean this_present_opStatus = true && this.isSetOpStatus(); - boolean that_present_opStatus = true && that.isSetOpStatus(); - if (this_present_opStatus || that_present_opStatus) { - if (!(this_present_opStatus && that_present_opStatus)) - return false; - if (!this.opStatus.equals(that.opStatus)) - return false; - } - - boolean this_present_data = true && this.isSetData(); - boolean that_present_data = true && that.isSetData(); - if (this_present_data || that_present_data) { - if (!(this_present_data && that_present_data)) - return false; - if (!this.data.equals(that.data)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_opStatus = true && (isSetOpStatus()); - list.add(present_opStatus); - if (present_opStatus) - list.add(opStatus); - - boolean present_data = true && (isSetData()); - list.add(present_data); - if (present_data) - list.add(data); - - return list.hashCode(); - } - - @Override - public int compareTo(TBrokerReadResponse other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetOpStatus()).compareTo(other.isSetOpStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOpStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.opStatus, other.opStatus); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetData()).compareTo(other.isSetData()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetData()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data, other.data); - 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("TBrokerReadResponse("); - boolean first = true; - - sb.append("opStatus:"); - if (this.opStatus == null) { - sb.append("null"); - } else { - sb.append(this.opStatus); - } - first = false; - if (isSetData()) { - if (!first) sb.append(", "); - sb.append("data:"); - if (this.data == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.data, sb); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (opStatus == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'opStatus' was not present! Struct: " + toString()); - } - // check for sub-struct validity - if (opStatus != null) { - opStatus.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 TBrokerReadResponseStandardSchemeFactory implements SchemeFactory { - public TBrokerReadResponseStandardScheme getScheme() { - return new TBrokerReadResponseStandardScheme(); - } - } - - private static class TBrokerReadResponseStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBrokerReadResponse struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // OP_STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.opStatus = new TBrokerOperationStatus(); - struct.opStatus.read(iprot); - struct.setOpStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // DATA - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.data = iprot.readBinary(); - struct.setDataIsSet(true); - } else { - 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, TBrokerReadResponse struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.opStatus != null) { - oprot.writeFieldBegin(OP_STATUS_FIELD_DESC); - struct.opStatus.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.data != null) { - if (struct.isSetData()) { - oprot.writeFieldBegin(DATA_FIELD_DESC); - oprot.writeBinary(struct.data); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBrokerReadResponseTupleSchemeFactory implements SchemeFactory { - public TBrokerReadResponseTupleScheme getScheme() { - return new TBrokerReadResponseTupleScheme(); - } - } - - private static class TBrokerReadResponseTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBrokerReadResponse struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.opStatus.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetData()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetData()) { - oprot.writeBinary(struct.data); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBrokerReadResponse struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.opStatus = new TBrokerOperationStatus(); - struct.opStatus.read(iprot); - struct.setOpStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.data = iprot.readBinary(); - struct.setDataIsSet(true); - } - } - } - -} - diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerRenamePathRequest.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerRenamePathRequest.java deleted file mode 100644 index 9af0a42da9..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerRenamePathRequest.java +++ /dev/null @@ -1,762 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-10-27") -public class TBrokerRenamePathRequest implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBrokerRenamePathRequest"); - - private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField SRC_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("srcPath", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField DEST_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("destPath", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField PROPERTIES_FIELD_DESC = new org.apache.thrift.protocol.TField("properties", org.apache.thrift.protocol.TType.MAP, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBrokerRenamePathRequestStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBrokerRenamePathRequestTupleSchemeFactory()); - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion version; // required - public String srcPath; // required - public String destPath; // required - public Map properties; // required - - /** 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 TBrokerVersion - */ - VERSION((short)1, "version"), - SRC_PATH((short)2, "srcPath"), - DEST_PATH((short)3, "destPath"), - PROPERTIES((short)4, "properties"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VERSION - return VERSION; - case 2: // SRC_PATH - return SRC_PATH; - case 3: // DEST_PATH - return DEST_PATH; - case 4: // PROPERTIES - return PROPERTIES; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TBrokerVersion.class))); - tmpMap.put(_Fields.SRC_PATH, new org.apache.thrift.meta_data.FieldMetaData("srcPath", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.DEST_PATH, new org.apache.thrift.meta_data.FieldMetaData("destPath", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.PROPERTIES, new org.apache.thrift.meta_data.FieldMetaData("properties", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBrokerRenamePathRequest.class, metaDataMap); - } - - public TBrokerRenamePathRequest() { - } - - public TBrokerRenamePathRequest( - TBrokerVersion version, - String srcPath, - String destPath, - Map properties) - { - this(); - this.version = version; - this.srcPath = srcPath; - this.destPath = destPath; - this.properties = properties; - } - - /** - * Performs a deep copy on other. - */ - public TBrokerRenamePathRequest(TBrokerRenamePathRequest other) { - if (other.isSetVersion()) { - this.version = other.version; - } - if (other.isSetSrcPath()) { - this.srcPath = other.srcPath; - } - if (other.isSetDestPath()) { - this.destPath = other.destPath; - } - if (other.isSetProperties()) { - Map __this__properties = new HashMap(other.properties); - this.properties = __this__properties; - } - } - - public TBrokerRenamePathRequest deepCopy() { - return new TBrokerRenamePathRequest(this); - } - - @Override - public void clear() { - this.version = null; - this.srcPath = null; - this.destPath = null; - this.properties = null; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion getVersion() { - return this.version; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerRenamePathRequest setVersion(TBrokerVersion 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 String getSrcPath() { - return this.srcPath; - } - - public TBrokerRenamePathRequest setSrcPath(String srcPath) { - this.srcPath = srcPath; - return this; - } - - public void unsetSrcPath() { - this.srcPath = null; - } - - /** Returns true if field srcPath is set (has been assigned a value) and false otherwise */ - public boolean isSetSrcPath() { - return this.srcPath != null; - } - - public void setSrcPathIsSet(boolean value) { - if (!value) { - this.srcPath = null; - } - } - - public String getDestPath() { - return this.destPath; - } - - public TBrokerRenamePathRequest setDestPath(String destPath) { - this.destPath = destPath; - return this; - } - - public void unsetDestPath() { - this.destPath = null; - } - - /** Returns true if field destPath is set (has been assigned a value) and false otherwise */ - public boolean isSetDestPath() { - return this.destPath != null; - } - - public void setDestPathIsSet(boolean value) { - if (!value) { - this.destPath = null; - } - } - - public int getPropertiesSize() { - return (this.properties == null) ? 0 : this.properties.size(); - } - - public void putToProperties(String key, String val) { - if (this.properties == null) { - this.properties = new HashMap(); - } - this.properties.put(key, val); - } - - public Map getProperties() { - return this.properties; - } - - public TBrokerRenamePathRequest setProperties(Map properties) { - this.properties = properties; - return this; - } - - public void unsetProperties() { - this.properties = null; - } - - /** Returns true if field properties is set (has been assigned a value) and false otherwise */ - public boolean isSetProperties() { - return this.properties != null; - } - - public void setPropertiesIsSet(boolean value) { - if (!value) { - this.properties = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VERSION: - if (value == null) { - unsetVersion(); - } else { - setVersion((TBrokerVersion)value); - } - break; - - case SRC_PATH: - if (value == null) { - unsetSrcPath(); - } else { - setSrcPath((String)value); - } - break; - - case DEST_PATH: - if (value == null) { - unsetDestPath(); - } else { - setDestPath((String)value); - } - break; - - case PROPERTIES: - if (value == null) { - unsetProperties(); - } else { - setProperties((Map)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VERSION: - return getVersion(); - - case SRC_PATH: - return getSrcPath(); - - case DEST_PATH: - return getDestPath(); - - case PROPERTIES: - return getProperties(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 SRC_PATH: - return isSetSrcPath(); - case DEST_PATH: - return isSetDestPath(); - case PROPERTIES: - return isSetProperties(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBrokerRenamePathRequest) - return this.equals((TBrokerRenamePathRequest)that); - return false; - } - - public boolean equals(TBrokerRenamePathRequest 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_srcPath = true && this.isSetSrcPath(); - boolean that_present_srcPath = true && that.isSetSrcPath(); - if (this_present_srcPath || that_present_srcPath) { - if (!(this_present_srcPath && that_present_srcPath)) - return false; - if (!this.srcPath.equals(that.srcPath)) - return false; - } - - boolean this_present_destPath = true && this.isSetDestPath(); - boolean that_present_destPath = true && that.isSetDestPath(); - if (this_present_destPath || that_present_destPath) { - if (!(this_present_destPath && that_present_destPath)) - return false; - if (!this.destPath.equals(that.destPath)) - return false; - } - - boolean this_present_properties = true && this.isSetProperties(); - boolean that_present_properties = true && that.isSetProperties(); - if (this_present_properties || that_present_properties) { - if (!(this_present_properties && that_present_properties)) - return false; - if (!this.properties.equals(that.properties)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_version = true && (isSetVersion()); - list.add(present_version); - if (present_version) - list.add(version.getValue()); - - boolean present_srcPath = true && (isSetSrcPath()); - list.add(present_srcPath); - if (present_srcPath) - list.add(srcPath); - - boolean present_destPath = true && (isSetDestPath()); - list.add(present_destPath); - if (present_destPath) - list.add(destPath); - - boolean present_properties = true && (isSetProperties()); - list.add(present_properties); - if (present_properties) - list.add(properties); - - return list.hashCode(); - } - - @Override - public int compareTo(TBrokerRenamePathRequest 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(isSetSrcPath()).compareTo(other.isSetSrcPath()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSrcPath()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.srcPath, other.srcPath); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDestPath()).compareTo(other.isSetDestPath()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDestPath()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.destPath, other.destPath); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetProperties()).compareTo(other.isSetProperties()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetProperties()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.properties, other.properties); - 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("TBrokerRenamePathRequest("); - 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("srcPath:"); - if (this.srcPath == null) { - sb.append("null"); - } else { - sb.append(this.srcPath); - } - first = false; - if (!first) sb.append(", "); - sb.append("destPath:"); - if (this.destPath == null) { - sb.append("null"); - } else { - sb.append(this.destPath); - } - first = false; - if (!first) sb.append(", "); - sb.append("properties:"); - if (this.properties == null) { - sb.append("null"); - } else { - sb.append(this.properties); - } - 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 (srcPath == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'srcPath' was not present! Struct: " + toString()); - } - if (destPath == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'destPath' was not present! Struct: " + toString()); - } - if (properties == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'properties' 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 TBrokerRenamePathRequestStandardSchemeFactory implements SchemeFactory { - public TBrokerRenamePathRequestStandardScheme getScheme() { - return new TBrokerRenamePathRequestStandardScheme(); - } - } - - private static class TBrokerRenamePathRequestStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBrokerRenamePathRequest struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.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.I32) { - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // SRC_PATH - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.srcPath = iprot.readString(); - struct.setSrcPathIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // DEST_PATH - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.destPath = iprot.readString(); - struct.setDestPathIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // PROPERTIES - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map28 = iprot.readMapBegin(); - struct.properties = new HashMap(2*_map28.size); - String _key29; - String _val30; - for (int _i31 = 0; _i31 < _map28.size; ++_i31) - { - _key29 = iprot.readString(); - _val30 = iprot.readString(); - struct.properties.put(_key29, _val30); - } - iprot.readMapEnd(); - } - struct.setPropertiesIsSet(true); - } else { - 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, TBrokerRenamePathRequest struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.version != null) { - oprot.writeFieldBegin(VERSION_FIELD_DESC); - oprot.writeI32(struct.version.getValue()); - oprot.writeFieldEnd(); - } - if (struct.srcPath != null) { - oprot.writeFieldBegin(SRC_PATH_FIELD_DESC); - oprot.writeString(struct.srcPath); - oprot.writeFieldEnd(); - } - if (struct.destPath != null) { - oprot.writeFieldBegin(DEST_PATH_FIELD_DESC); - oprot.writeString(struct.destPath); - oprot.writeFieldEnd(); - } - if (struct.properties != null) { - oprot.writeFieldBegin(PROPERTIES_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.properties.size())); - for (Map.Entry _iter32 : struct.properties.entrySet()) - { - oprot.writeString(_iter32.getKey()); - oprot.writeString(_iter32.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBrokerRenamePathRequestTupleSchemeFactory implements SchemeFactory { - public TBrokerRenamePathRequestTupleScheme getScheme() { - return new TBrokerRenamePathRequestTupleScheme(); - } - } - - private static class TBrokerRenamePathRequestTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBrokerRenamePathRequest struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.version.getValue()); - oprot.writeString(struct.srcPath); - oprot.writeString(struct.destPath); - { - oprot.writeI32(struct.properties.size()); - for (Map.Entry _iter33 : struct.properties.entrySet()) - { - oprot.writeString(_iter33.getKey()); - oprot.writeString(_iter33.getValue()); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBrokerRenamePathRequest struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - struct.srcPath = iprot.readString(); - struct.setSrcPathIsSet(true); - struct.destPath = iprot.readString(); - struct.setDestPathIsSet(true); - { - org.apache.thrift.protocol.TMap _map34 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.properties = new HashMap(2*_map34.size); - String _key35; - String _val36; - for (int _i37 = 0; _i37 < _map34.size; ++_i37) - { - _key35 = iprot.readString(); - _val36 = iprot.readString(); - struct.properties.put(_key35, _val36); - } - } - struct.setPropertiesIsSet(true); - } - } - -} - diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerSeekRequest.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerSeekRequest.java deleted file mode 100644 index 8a6b0a4386..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerSeekRequest.java +++ /dev/null @@ -1,613 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-10-27") -public class TBrokerSeekRequest implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBrokerSeekRequest"); - - private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField FD_FIELD_DESC = new org.apache.thrift.protocol.TField("fd", org.apache.thrift.protocol.TType.STRUCT, (short)2); - 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)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBrokerSeekRequestStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBrokerSeekRequestTupleSchemeFactory()); - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion version; // required - public TBrokerFD fd; // required - public long offset; // required - - /** 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 TBrokerVersion - */ - VERSION((short)1, "version"), - FD((short)2, "fd"), - OFFSET((short)3, "offset"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VERSION - return VERSION; - case 2: // FD - return FD; - case 3: // OFFSET - return OFFSET; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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 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.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TBrokerVersion.class))); - tmpMap.put(_Fields.FD, new org.apache.thrift.meta_data.FieldMetaData("fd", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerFD.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))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBrokerSeekRequest.class, metaDataMap); - } - - public TBrokerSeekRequest() { - } - - public TBrokerSeekRequest( - TBrokerVersion version, - TBrokerFD fd, - long offset) - { - this(); - this.version = version; - this.fd = fd; - this.offset = offset; - setOffsetIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public TBrokerSeekRequest(TBrokerSeekRequest other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetVersion()) { - this.version = other.version; - } - if (other.isSetFd()) { - this.fd = new TBrokerFD(other.fd); - } - this.offset = other.offset; - } - - public TBrokerSeekRequest deepCopy() { - return new TBrokerSeekRequest(this); - } - - @Override - public void clear() { - this.version = null; - this.fd = null; - setOffsetIsSet(false); - this.offset = 0; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerVersion getVersion() { - return this.version; - } - - /** - * - * @see TBrokerVersion - */ - public TBrokerSeekRequest setVersion(TBrokerVersion 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 TBrokerFD getFd() { - return this.fd; - } - - public TBrokerSeekRequest setFd(TBrokerFD fd) { - this.fd = fd; - return this; - } - - public void unsetFd() { - this.fd = null; - } - - /** Returns true if field fd is set (has been assigned a value) and false otherwise */ - public boolean isSetFd() { - return this.fd != null; - } - - public void setFdIsSet(boolean value) { - if (!value) { - this.fd = null; - } - } - - public long getOffset() { - return this.offset; - } - - public TBrokerSeekRequest 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); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VERSION: - if (value == null) { - unsetVersion(); - } else { - setVersion((TBrokerVersion)value); - } - break; - - case FD: - if (value == null) { - unsetFd(); - } else { - setFd((TBrokerFD)value); - } - break; - - case OFFSET: - if (value == null) { - unsetOffset(); - } else { - setOffset((Long)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VERSION: - return getVersion(); - - case FD: - return getFd(); - - case OFFSET: - return getOffset(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 FD: - return isSetFd(); - case OFFSET: - return isSetOffset(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBrokerSeekRequest) - return this.equals((TBrokerSeekRequest)that); - return false; - } - - public boolean equals(TBrokerSeekRequest 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_fd = true && this.isSetFd(); - boolean that_present_fd = true && that.isSetFd(); - if (this_present_fd || that_present_fd) { - if (!(this_present_fd && that_present_fd)) - return false; - if (!this.fd.equals(that.fd)) - 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; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_version = true && (isSetVersion()); - list.add(present_version); - if (present_version) - list.add(version.getValue()); - - boolean present_fd = true && (isSetFd()); - list.add(present_fd); - if (present_fd) - list.add(fd); - - boolean present_offset = true; - list.add(present_offset); - if (present_offset) - list.add(offset); - - return list.hashCode(); - } - - @Override - public int compareTo(TBrokerSeekRequest 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(isSetFd()).compareTo(other.isSetFd()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFd()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fd, other.fd); - if (lastComparison != 0) { - return lastComparison; - } - } - 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; - } - } - 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("TBrokerSeekRequest("); - 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("fd:"); - if (this.fd == null) { - sb.append("null"); - } else { - sb.append(this.fd); - } - first = false; - if (!first) sb.append(", "); - sb.append("offset:"); - sb.append(this.offset); - 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 (fd == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'fd' was not present! Struct: " + toString()); - } - // alas, we cannot check 'offset' because it's a primitive and you chose the non-beans generator. - // check for sub-struct validity - if (fd != null) { - fd.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 TBrokerSeekRequestStandardSchemeFactory implements SchemeFactory { - public TBrokerSeekRequestStandardScheme getScheme() { - return new TBrokerSeekRequestStandardScheme(); - } - } - - private static class TBrokerSeekRequestStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBrokerSeekRequest struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.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.I32) { - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // FD - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.fd = new TBrokerFD(); - struct.fd.read(iprot); - struct.setFdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // 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; - 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()); - } - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TBrokerSeekRequest struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.version != null) { - oprot.writeFieldBegin(VERSION_FIELD_DESC); - oprot.writeI32(struct.version.getValue()); - oprot.writeFieldEnd(); - } - if (struct.fd != null) { - oprot.writeFieldBegin(FD_FIELD_DESC); - struct.fd.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(OFFSET_FIELD_DESC); - oprot.writeI64(struct.offset); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBrokerSeekRequestTupleSchemeFactory implements SchemeFactory { - public TBrokerSeekRequestTupleScheme getScheme() { - return new TBrokerSeekRequestTupleScheme(); - } - } - - private static class TBrokerSeekRequestTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBrokerSeekRequest struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.version.getValue()); - struct.fd.write(oprot); - oprot.writeI64(struct.offset); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBrokerSeekRequest struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.version = com.baidu.palo.thrift.TBrokerVersion.findByValue(iprot.readI32()); - struct.setVersionIsSet(true); - struct.fd = new TBrokerFD(); - struct.fd.read(iprot); - struct.setFdIsSet(true); - struct.offset = iprot.readI64(); - struct.setOffsetIsSet(true); - } - } - -} - diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerVersion.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerVersion.java deleted file mode 100644 index 0c6e49b407..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TBrokerVersion.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.thrift; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum TBrokerVersion implements org.apache.thrift.TEnum { - VERSION_ONE(1); - - private final int value; - - private TBrokerVersion(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 TBrokerVersion findByValue(int value) { - switch (value) { - case 1: - return VERSION_ONE; - default: - return null; - } - } -} diff --git a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TPaloBrokerService.java b/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TPaloBrokerService.java deleted file mode 100644 index 65c6143082..0000000000 --- a/fs_brokers/apache_hdfs_broker/src/main/thrift/com/baidu/palo/thrift/TPaloBrokerService.java +++ /dev/null @@ -1,10488 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.baidu.palo.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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-10-27") -public class TPaloBrokerService { - - public interface Iface { - - public TBrokerListResponse listPath(TBrokerListPathRequest request) throws org.apache.thrift.TException; - - public TBrokerOperationStatus deletePath(TBrokerDeletePathRequest request) throws org.apache.thrift.TException; - - public TBrokerOperationStatus renamePath(TBrokerRenamePathRequest request) throws org.apache.thrift.TException; - - public TBrokerCheckPathExistResponse checkPathExist(TBrokerCheckPathExistRequest request) throws org.apache.thrift.TException; - - public TBrokerOpenReaderResponse openReader(TBrokerOpenReaderRequest request) throws org.apache.thrift.TException; - - public TBrokerReadResponse pread(TBrokerPReadRequest request) throws org.apache.thrift.TException; - - public TBrokerOperationStatus seek(TBrokerSeekRequest request) throws org.apache.thrift.TException; - - public TBrokerOperationStatus closeReader(TBrokerCloseReaderRequest request) throws org.apache.thrift.TException; - - public TBrokerOpenWriterResponse openWriter(TBrokerOpenWriterRequest request) throws org.apache.thrift.TException; - - public TBrokerOperationStatus pwrite(TBrokerPWriteRequest request) throws org.apache.thrift.TException; - - public TBrokerOperationStatus closeWriter(TBrokerCloseWriterRequest request) throws org.apache.thrift.TException; - - public TBrokerOperationStatus ping(TBrokerPingBrokerRequest request) throws org.apache.thrift.TException; - - } - - public interface AsyncIface { - - public void listPath(TBrokerListPathRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void deletePath(TBrokerDeletePathRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void renamePath(TBrokerRenamePathRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void checkPathExist(TBrokerCheckPathExistRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void openReader(TBrokerOpenReaderRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void pread(TBrokerPReadRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void seek(TBrokerSeekRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void closeReader(TBrokerCloseReaderRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void openWriter(TBrokerOpenWriterRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void pwrite(TBrokerPWriteRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void closeWriter(TBrokerCloseWriterRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void ping(TBrokerPingBrokerRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - } - - public static class Client extends org.apache.thrift.TServiceClient implements Iface { - public static class Factory implements org.apache.thrift.TServiceClientFactory { - public Factory() {} - public Client getClient(org.apache.thrift.protocol.TProtocol prot) { - return new Client(prot); - } - public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { - return new Client(iprot, oprot); - } - } - - public Client(org.apache.thrift.protocol.TProtocol prot) - { - super(prot, prot); - } - - public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { - super(iprot, oprot); - } - - public TBrokerListResponse listPath(TBrokerListPathRequest request) throws org.apache.thrift.TException - { - send_listPath(request); - return recv_listPath(); - } - - public void send_listPath(TBrokerListPathRequest request) throws org.apache.thrift.TException - { - listPath_args args = new listPath_args(); - args.setRequest(request); - sendBase("listPath", args); - } - - public TBrokerListResponse recv_listPath() throws org.apache.thrift.TException - { - listPath_result result = new listPath_result(); - receiveBase(result, "listPath"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "listPath failed: unknown result"); - } - - public TBrokerOperationStatus deletePath(TBrokerDeletePathRequest request) throws org.apache.thrift.TException - { - send_deletePath(request); - return recv_deletePath(); - } - - public void send_deletePath(TBrokerDeletePathRequest request) throws org.apache.thrift.TException - { - deletePath_args args = new deletePath_args(); - args.setRequest(request); - sendBase("deletePath", args); - } - - public TBrokerOperationStatus recv_deletePath() throws org.apache.thrift.TException - { - deletePath_result result = new deletePath_result(); - receiveBase(result, "deletePath"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deletePath failed: unknown result"); - } - - public TBrokerOperationStatus renamePath(TBrokerRenamePathRequest request) throws org.apache.thrift.TException - { - send_renamePath(request); - return recv_renamePath(); - } - - public void send_renamePath(TBrokerRenamePathRequest request) throws org.apache.thrift.TException - { - renamePath_args args = new renamePath_args(); - args.setRequest(request); - sendBase("renamePath", args); - } - - public TBrokerOperationStatus recv_renamePath() throws org.apache.thrift.TException - { - renamePath_result result = new renamePath_result(); - receiveBase(result, "renamePath"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "renamePath failed: unknown result"); - } - - public TBrokerCheckPathExistResponse checkPathExist(TBrokerCheckPathExistRequest request) throws org.apache.thrift.TException - { - send_checkPathExist(request); - return recv_checkPathExist(); - } - - public void send_checkPathExist(TBrokerCheckPathExistRequest request) throws org.apache.thrift.TException - { - checkPathExist_args args = new checkPathExist_args(); - args.setRequest(request); - sendBase("checkPathExist", args); - } - - public TBrokerCheckPathExistResponse recv_checkPathExist() throws org.apache.thrift.TException - { - checkPathExist_result result = new checkPathExist_result(); - receiveBase(result, "checkPathExist"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "checkPathExist failed: unknown result"); - } - - public TBrokerOpenReaderResponse openReader(TBrokerOpenReaderRequest request) throws org.apache.thrift.TException - { - send_openReader(request); - return recv_openReader(); - } - - public void send_openReader(TBrokerOpenReaderRequest request) throws org.apache.thrift.TException - { - openReader_args args = new openReader_args(); - args.setRequest(request); - sendBase("openReader", args); - } - - public TBrokerOpenReaderResponse recv_openReader() throws org.apache.thrift.TException - { - openReader_result result = new openReader_result(); - receiveBase(result, "openReader"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "openReader failed: unknown result"); - } - - public TBrokerReadResponse pread(TBrokerPReadRequest request) throws org.apache.thrift.TException - { - send_pread(request); - return recv_pread(); - } - - public void send_pread(TBrokerPReadRequest request) throws org.apache.thrift.TException - { - pread_args args = new pread_args(); - args.setRequest(request); - sendBase("pread", args); - } - - public TBrokerReadResponse recv_pread() throws org.apache.thrift.TException - { - pread_result result = new pread_result(); - receiveBase(result, "pread"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "pread failed: unknown result"); - } - - public TBrokerOperationStatus seek(TBrokerSeekRequest request) throws org.apache.thrift.TException - { - send_seek(request); - return recv_seek(); - } - - public void send_seek(TBrokerSeekRequest request) throws org.apache.thrift.TException - { - seek_args args = new seek_args(); - args.setRequest(request); - sendBase("seek", args); - } - - public TBrokerOperationStatus recv_seek() throws org.apache.thrift.TException - { - seek_result result = new seek_result(); - receiveBase(result, "seek"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "seek failed: unknown result"); - } - - public TBrokerOperationStatus closeReader(TBrokerCloseReaderRequest request) throws org.apache.thrift.TException - { - send_closeReader(request); - return recv_closeReader(); - } - - public void send_closeReader(TBrokerCloseReaderRequest request) throws org.apache.thrift.TException - { - closeReader_args args = new closeReader_args(); - args.setRequest(request); - sendBase("closeReader", args); - } - - public TBrokerOperationStatus recv_closeReader() throws org.apache.thrift.TException - { - closeReader_result result = new closeReader_result(); - receiveBase(result, "closeReader"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "closeReader failed: unknown result"); - } - - public TBrokerOpenWriterResponse openWriter(TBrokerOpenWriterRequest request) throws org.apache.thrift.TException - { - send_openWriter(request); - return recv_openWriter(); - } - - public void send_openWriter(TBrokerOpenWriterRequest request) throws org.apache.thrift.TException - { - openWriter_args args = new openWriter_args(); - args.setRequest(request); - sendBase("openWriter", args); - } - - public TBrokerOpenWriterResponse recv_openWriter() throws org.apache.thrift.TException - { - openWriter_result result = new openWriter_result(); - receiveBase(result, "openWriter"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "openWriter failed: unknown result"); - } - - public TBrokerOperationStatus pwrite(TBrokerPWriteRequest request) throws org.apache.thrift.TException - { - send_pwrite(request); - return recv_pwrite(); - } - - public void send_pwrite(TBrokerPWriteRequest request) throws org.apache.thrift.TException - { - pwrite_args args = new pwrite_args(); - args.setRequest(request); - sendBase("pwrite", args); - } - - public TBrokerOperationStatus recv_pwrite() throws org.apache.thrift.TException - { - pwrite_result result = new pwrite_result(); - receiveBase(result, "pwrite"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "pwrite failed: unknown result"); - } - - public TBrokerOperationStatus closeWriter(TBrokerCloseWriterRequest request) throws org.apache.thrift.TException - { - send_closeWriter(request); - return recv_closeWriter(); - } - - public void send_closeWriter(TBrokerCloseWriterRequest request) throws org.apache.thrift.TException - { - closeWriter_args args = new closeWriter_args(); - args.setRequest(request); - sendBase("closeWriter", args); - } - - public TBrokerOperationStatus recv_closeWriter() throws org.apache.thrift.TException - { - closeWriter_result result = new closeWriter_result(); - receiveBase(result, "closeWriter"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "closeWriter failed: unknown result"); - } - - public TBrokerOperationStatus ping(TBrokerPingBrokerRequest request) throws org.apache.thrift.TException - { - send_ping(request); - return recv_ping(); - } - - public void send_ping(TBrokerPingBrokerRequest request) throws org.apache.thrift.TException - { - ping_args args = new ping_args(); - args.setRequest(request); - sendBase("ping", args); - } - - public TBrokerOperationStatus recv_ping() throws org.apache.thrift.TException - { - ping_result result = new ping_result(); - receiveBase(result, "ping"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "ping failed: unknown result"); - } - - } - public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { - public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { - private org.apache.thrift.async.TAsyncClientManager clientManager; - private org.apache.thrift.protocol.TProtocolFactory protocolFactory; - public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { - this.clientManager = clientManager; - this.protocolFactory = protocolFactory; - } - public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { - return new AsyncClient(protocolFactory, clientManager, transport); - } - } - - public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { - super(protocolFactory, clientManager, transport); - } - - public void listPath(TBrokerListPathRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - listPath_call method_call = new listPath_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class listPath_call extends org.apache.thrift.async.TAsyncMethodCall { - private TBrokerListPathRequest request; - public listPath_call(TBrokerListPathRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("listPath", org.apache.thrift.protocol.TMessageType.CALL, 0)); - listPath_args args = new listPath_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public TBrokerListResponse getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_listPath(); - } - } - - public void deletePath(TBrokerDeletePathRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - deletePath_call method_call = new deletePath_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class deletePath_call extends org.apache.thrift.async.TAsyncMethodCall { - private TBrokerDeletePathRequest request; - public deletePath_call(TBrokerDeletePathRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deletePath", org.apache.thrift.protocol.TMessageType.CALL, 0)); - deletePath_args args = new deletePath_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public TBrokerOperationStatus getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_deletePath(); - } - } - - public void renamePath(TBrokerRenamePathRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - renamePath_call method_call = new renamePath_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class renamePath_call extends org.apache.thrift.async.TAsyncMethodCall { - private TBrokerRenamePathRequest request; - public renamePath_call(TBrokerRenamePathRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("renamePath", org.apache.thrift.protocol.TMessageType.CALL, 0)); - renamePath_args args = new renamePath_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public TBrokerOperationStatus getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_renamePath(); - } - } - - public void checkPathExist(TBrokerCheckPathExistRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - checkPathExist_call method_call = new checkPathExist_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class checkPathExist_call extends org.apache.thrift.async.TAsyncMethodCall { - private TBrokerCheckPathExistRequest request; - public checkPathExist_call(TBrokerCheckPathExistRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("checkPathExist", org.apache.thrift.protocol.TMessageType.CALL, 0)); - checkPathExist_args args = new checkPathExist_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public TBrokerCheckPathExistResponse getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_checkPathExist(); - } - } - - public void openReader(TBrokerOpenReaderRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - openReader_call method_call = new openReader_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class openReader_call extends org.apache.thrift.async.TAsyncMethodCall { - private TBrokerOpenReaderRequest request; - public openReader_call(TBrokerOpenReaderRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("openReader", org.apache.thrift.protocol.TMessageType.CALL, 0)); - openReader_args args = new openReader_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public TBrokerOpenReaderResponse getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_openReader(); - } - } - - public void pread(TBrokerPReadRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - pread_call method_call = new pread_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class pread_call extends org.apache.thrift.async.TAsyncMethodCall { - private TBrokerPReadRequest request; - public pread_call(TBrokerPReadRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("pread", org.apache.thrift.protocol.TMessageType.CALL, 0)); - pread_args args = new pread_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public TBrokerReadResponse getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_pread(); - } - } - - public void seek(TBrokerSeekRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - seek_call method_call = new seek_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class seek_call extends org.apache.thrift.async.TAsyncMethodCall { - private TBrokerSeekRequest request; - public seek_call(TBrokerSeekRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("seek", org.apache.thrift.protocol.TMessageType.CALL, 0)); - seek_args args = new seek_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public TBrokerOperationStatus getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_seek(); - } - } - - public void closeReader(TBrokerCloseReaderRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - closeReader_call method_call = new closeReader_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class closeReader_call extends org.apache.thrift.async.TAsyncMethodCall { - private TBrokerCloseReaderRequest request; - public closeReader_call(TBrokerCloseReaderRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("closeReader", org.apache.thrift.protocol.TMessageType.CALL, 0)); - closeReader_args args = new closeReader_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public TBrokerOperationStatus getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_closeReader(); - } - } - - public void openWriter(TBrokerOpenWriterRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - openWriter_call method_call = new openWriter_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class openWriter_call extends org.apache.thrift.async.TAsyncMethodCall { - private TBrokerOpenWriterRequest request; - public openWriter_call(TBrokerOpenWriterRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("openWriter", org.apache.thrift.protocol.TMessageType.CALL, 0)); - openWriter_args args = new openWriter_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public TBrokerOpenWriterResponse getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_openWriter(); - } - } - - public void pwrite(TBrokerPWriteRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - pwrite_call method_call = new pwrite_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class pwrite_call extends org.apache.thrift.async.TAsyncMethodCall { - private TBrokerPWriteRequest request; - public pwrite_call(TBrokerPWriteRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("pwrite", org.apache.thrift.protocol.TMessageType.CALL, 0)); - pwrite_args args = new pwrite_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public TBrokerOperationStatus getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_pwrite(); - } - } - - public void closeWriter(TBrokerCloseWriterRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - closeWriter_call method_call = new closeWriter_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class closeWriter_call extends org.apache.thrift.async.TAsyncMethodCall { - private TBrokerCloseWriterRequest request; - public closeWriter_call(TBrokerCloseWriterRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("closeWriter", org.apache.thrift.protocol.TMessageType.CALL, 0)); - closeWriter_args args = new closeWriter_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public TBrokerOperationStatus getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_closeWriter(); - } - } - - public void ping(TBrokerPingBrokerRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - ping_call method_call = new ping_call(request, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class ping_call extends org.apache.thrift.async.TAsyncMethodCall { - private TBrokerPingBrokerRequest request; - public ping_call(TBrokerPingBrokerRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.request = request; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("ping", org.apache.thrift.protocol.TMessageType.CALL, 0)); - ping_args args = new ping_args(); - args.setRequest(request); - args.write(prot); - prot.writeMessageEnd(); - } - - public TBrokerOperationStatus getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_ping(); - } - } - - } - - public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { - private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); - public Processor(I iface) { - super(iface, getProcessMap(new HashMap>())); - } - - protected Processor(I iface, Map> processMap) { - super(iface, getProcessMap(processMap)); - } - - private static Map> getProcessMap(Map> processMap) { - processMap.put("listPath", new listPath()); - processMap.put("deletePath", new deletePath()); - processMap.put("renamePath", new renamePath()); - processMap.put("checkPathExist", new checkPathExist()); - processMap.put("openReader", new openReader()); - processMap.put("pread", new pread()); - processMap.put("seek", new seek()); - processMap.put("closeReader", new closeReader()); - processMap.put("openWriter", new openWriter()); - processMap.put("pwrite", new pwrite()); - processMap.put("closeWriter", new closeWriter()); - processMap.put("ping", new ping()); - return processMap; - } - - public static class listPath extends org.apache.thrift.ProcessFunction { - public listPath() { - super("listPath"); - } - - public listPath_args getEmptyArgsInstance() { - return new listPath_args(); - } - - protected boolean isOneway() { - return false; - } - - public listPath_result getResult(I iface, listPath_args args) throws org.apache.thrift.TException { - listPath_result result = new listPath_result(); - result.success = iface.listPath(args.request); - return result; - } - } - - public static class deletePath extends org.apache.thrift.ProcessFunction { - public deletePath() { - super("deletePath"); - } - - public deletePath_args getEmptyArgsInstance() { - return new deletePath_args(); - } - - protected boolean isOneway() { - return false; - } - - public deletePath_result getResult(I iface, deletePath_args args) throws org.apache.thrift.TException { - deletePath_result result = new deletePath_result(); - result.success = iface.deletePath(args.request); - return result; - } - } - - public static class renamePath extends org.apache.thrift.ProcessFunction { - public renamePath() { - super("renamePath"); - } - - public renamePath_args getEmptyArgsInstance() { - return new renamePath_args(); - } - - protected boolean isOneway() { - return false; - } - - public renamePath_result getResult(I iface, renamePath_args args) throws org.apache.thrift.TException { - renamePath_result result = new renamePath_result(); - result.success = iface.renamePath(args.request); - return result; - } - } - - public static class checkPathExist extends org.apache.thrift.ProcessFunction { - public checkPathExist() { - super("checkPathExist"); - } - - public checkPathExist_args getEmptyArgsInstance() { - return new checkPathExist_args(); - } - - protected boolean isOneway() { - return false; - } - - public checkPathExist_result getResult(I iface, checkPathExist_args args) throws org.apache.thrift.TException { - checkPathExist_result result = new checkPathExist_result(); - result.success = iface.checkPathExist(args.request); - return result; - } - } - - public static class openReader extends org.apache.thrift.ProcessFunction { - public openReader() { - super("openReader"); - } - - public openReader_args getEmptyArgsInstance() { - return new openReader_args(); - } - - protected boolean isOneway() { - return false; - } - - public openReader_result getResult(I iface, openReader_args args) throws org.apache.thrift.TException { - openReader_result result = new openReader_result(); - result.success = iface.openReader(args.request); - return result; - } - } - - public static class pread extends org.apache.thrift.ProcessFunction { - public pread() { - super("pread"); - } - - public pread_args getEmptyArgsInstance() { - return new pread_args(); - } - - protected boolean isOneway() { - return false; - } - - public pread_result getResult(I iface, pread_args args) throws org.apache.thrift.TException { - pread_result result = new pread_result(); - result.success = iface.pread(args.request); - return result; - } - } - - public static class seek extends org.apache.thrift.ProcessFunction { - public seek() { - super("seek"); - } - - public seek_args getEmptyArgsInstance() { - return new seek_args(); - } - - protected boolean isOneway() { - return false; - } - - public seek_result getResult(I iface, seek_args args) throws org.apache.thrift.TException { - seek_result result = new seek_result(); - result.success = iface.seek(args.request); - return result; - } - } - - public static class closeReader extends org.apache.thrift.ProcessFunction { - public closeReader() { - super("closeReader"); - } - - public closeReader_args getEmptyArgsInstance() { - return new closeReader_args(); - } - - protected boolean isOneway() { - return false; - } - - public closeReader_result getResult(I iface, closeReader_args args) throws org.apache.thrift.TException { - closeReader_result result = new closeReader_result(); - result.success = iface.closeReader(args.request); - return result; - } - } - - public static class openWriter extends org.apache.thrift.ProcessFunction { - public openWriter() { - super("openWriter"); - } - - public openWriter_args getEmptyArgsInstance() { - return new openWriter_args(); - } - - protected boolean isOneway() { - return false; - } - - public openWriter_result getResult(I iface, openWriter_args args) throws org.apache.thrift.TException { - openWriter_result result = new openWriter_result(); - result.success = iface.openWriter(args.request); - return result; - } - } - - public static class pwrite extends org.apache.thrift.ProcessFunction { - public pwrite() { - super("pwrite"); - } - - public pwrite_args getEmptyArgsInstance() { - return new pwrite_args(); - } - - protected boolean isOneway() { - return false; - } - - public pwrite_result getResult(I iface, pwrite_args args) throws org.apache.thrift.TException { - pwrite_result result = new pwrite_result(); - result.success = iface.pwrite(args.request); - return result; - } - } - - public static class closeWriter extends org.apache.thrift.ProcessFunction { - public closeWriter() { - super("closeWriter"); - } - - public closeWriter_args getEmptyArgsInstance() { - return new closeWriter_args(); - } - - protected boolean isOneway() { - return false; - } - - public closeWriter_result getResult(I iface, closeWriter_args args) throws org.apache.thrift.TException { - closeWriter_result result = new closeWriter_result(); - result.success = iface.closeWriter(args.request); - return result; - } - } - - public static class ping extends org.apache.thrift.ProcessFunction { - public ping() { - super("ping"); - } - - public ping_args getEmptyArgsInstance() { - return new ping_args(); - } - - protected boolean isOneway() { - return false; - } - - public ping_result getResult(I iface, ping_args args) throws org.apache.thrift.TException { - ping_result result = new ping_result(); - result.success = iface.ping(args.request); - return result; - } - } - - } - - public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { - private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); - public AsyncProcessor(I iface) { - super(iface, getProcessMap(new HashMap>())); - } - - protected AsyncProcessor(I iface, Map> processMap) { - super(iface, getProcessMap(processMap)); - } - - private static Map> getProcessMap(Map> processMap) { - processMap.put("listPath", new listPath()); - processMap.put("deletePath", new deletePath()); - processMap.put("renamePath", new renamePath()); - processMap.put("checkPathExist", new checkPathExist()); - processMap.put("openReader", new openReader()); - processMap.put("pread", new pread()); - processMap.put("seek", new seek()); - processMap.put("closeReader", new closeReader()); - processMap.put("openWriter", new openWriter()); - processMap.put("pwrite", new pwrite()); - processMap.put("closeWriter", new closeWriter()); - processMap.put("ping", new ping()); - return processMap; - } - - public static class listPath extends org.apache.thrift.AsyncProcessFunction { - public listPath() { - super("listPath"); - } - - public listPath_args getEmptyArgsInstance() { - return new listPath_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TBrokerListResponse o) { - listPath_result result = new listPath_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - listPath_result result = new listPath_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, listPath_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.listPath(args.request,resultHandler); - } - } - - public static class deletePath extends org.apache.thrift.AsyncProcessFunction { - public deletePath() { - super("deletePath"); - } - - public deletePath_args getEmptyArgsInstance() { - return new deletePath_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TBrokerOperationStatus o) { - deletePath_result result = new deletePath_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - deletePath_result result = new deletePath_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, deletePath_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.deletePath(args.request,resultHandler); - } - } - - public static class renamePath extends org.apache.thrift.AsyncProcessFunction { - public renamePath() { - super("renamePath"); - } - - public renamePath_args getEmptyArgsInstance() { - return new renamePath_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TBrokerOperationStatus o) { - renamePath_result result = new renamePath_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - renamePath_result result = new renamePath_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, renamePath_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.renamePath(args.request,resultHandler); - } - } - - public static class checkPathExist extends org.apache.thrift.AsyncProcessFunction { - public checkPathExist() { - super("checkPathExist"); - } - - public checkPathExist_args getEmptyArgsInstance() { - return new checkPathExist_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TBrokerCheckPathExistResponse o) { - checkPathExist_result result = new checkPathExist_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - checkPathExist_result result = new checkPathExist_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, checkPathExist_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.checkPathExist(args.request,resultHandler); - } - } - - public static class openReader extends org.apache.thrift.AsyncProcessFunction { - public openReader() { - super("openReader"); - } - - public openReader_args getEmptyArgsInstance() { - return new openReader_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TBrokerOpenReaderResponse o) { - openReader_result result = new openReader_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - openReader_result result = new openReader_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, openReader_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.openReader(args.request,resultHandler); - } - } - - public static class pread extends org.apache.thrift.AsyncProcessFunction { - public pread() { - super("pread"); - } - - public pread_args getEmptyArgsInstance() { - return new pread_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TBrokerReadResponse o) { - pread_result result = new pread_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - pread_result result = new pread_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, pread_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.pread(args.request,resultHandler); - } - } - - public static class seek extends org.apache.thrift.AsyncProcessFunction { - public seek() { - super("seek"); - } - - public seek_args getEmptyArgsInstance() { - return new seek_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TBrokerOperationStatus o) { - seek_result result = new seek_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - seek_result result = new seek_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, seek_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.seek(args.request,resultHandler); - } - } - - public static class closeReader extends org.apache.thrift.AsyncProcessFunction { - public closeReader() { - super("closeReader"); - } - - public closeReader_args getEmptyArgsInstance() { - return new closeReader_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TBrokerOperationStatus o) { - closeReader_result result = new closeReader_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - closeReader_result result = new closeReader_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, closeReader_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.closeReader(args.request,resultHandler); - } - } - - public static class openWriter extends org.apache.thrift.AsyncProcessFunction { - public openWriter() { - super("openWriter"); - } - - public openWriter_args getEmptyArgsInstance() { - return new openWriter_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TBrokerOpenWriterResponse o) { - openWriter_result result = new openWriter_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - openWriter_result result = new openWriter_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, openWriter_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.openWriter(args.request,resultHandler); - } - } - - public static class pwrite extends org.apache.thrift.AsyncProcessFunction { - public pwrite() { - super("pwrite"); - } - - public pwrite_args getEmptyArgsInstance() { - return new pwrite_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TBrokerOperationStatus o) { - pwrite_result result = new pwrite_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - pwrite_result result = new pwrite_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, pwrite_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.pwrite(args.request,resultHandler); - } - } - - public static class closeWriter extends org.apache.thrift.AsyncProcessFunction { - public closeWriter() { - super("closeWriter"); - } - - public closeWriter_args getEmptyArgsInstance() { - return new closeWriter_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TBrokerOperationStatus o) { - closeWriter_result result = new closeWriter_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - closeWriter_result result = new closeWriter_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, closeWriter_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.closeWriter(args.request,resultHandler); - } - } - - public static class ping extends org.apache.thrift.AsyncProcessFunction { - public ping() { - super("ping"); - } - - public ping_args getEmptyArgsInstance() { - return new ping_args(); - } - - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TBrokerOperationStatus o) { - ping_result result = new ping_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - ping_result result = new ping_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, ping_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.ping(args.request,resultHandler); - } - } - - } - - public static class listPath_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("listPath_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("request", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new listPath_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new listPath_argsTupleSchemeFactory()); - } - - public TBrokerListPathRequest request; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQUEST((short)1, "request"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQUEST - return REQUEST; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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.REQUEST, new org.apache.thrift.meta_data.FieldMetaData("request", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerListPathRequest.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(listPath_args.class, metaDataMap); - } - - public listPath_args() { - } - - public listPath_args( - TBrokerListPathRequest request) - { - this(); - this.request = request; - } - - /** - * Performs a deep copy on other. - */ - public listPath_args(listPath_args other) { - if (other.isSetRequest()) { - this.request = new TBrokerListPathRequest(other.request); - } - } - - public listPath_args deepCopy() { - return new listPath_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public TBrokerListPathRequest getRequest() { - return this.request; - } - - public listPath_args setRequest(TBrokerListPathRequest request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((TBrokerListPathRequest)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 REQUEST: - return isSetRequest(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof listPath_args) - return this.equals((listPath_args)that); - return false; - } - - public boolean equals(listPath_args that) { - if (that == null) - return false; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) - return false; - if (!this.request.equals(that.request)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_request = true && (isSetRequest()); - list.add(present_request); - if (present_request) - list.add(request); - - return list.hashCode(); - } - - @Override - public int compareTo(listPath_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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("listPath_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (request != null) { - request.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 listPath_argsStandardSchemeFactory implements SchemeFactory { - public listPath_argsStandardScheme getScheme() { - return new listPath_argsStandardScheme(); - } - } - - private static class listPath_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, listPath_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = new TBrokerListPathRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } else { - 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, listPath_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class listPath_argsTupleSchemeFactory implements SchemeFactory { - public listPath_argsTupleScheme getScheme() { - return new listPath_argsTupleScheme(); - } - } - - private static class listPath_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, listPath_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, listPath_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new TBrokerListPathRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - } - - public static class listPath_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("listPath_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new listPath_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new listPath_resultTupleSchemeFactory()); - } - - public TBrokerListResponse success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerListResponse.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(listPath_result.class, metaDataMap); - } - - public listPath_result() { - } - - public listPath_result( - TBrokerListResponse success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public listPath_result(listPath_result other) { - if (other.isSetSuccess()) { - this.success = new TBrokerListResponse(other.success); - } - } - - public listPath_result deepCopy() { - return new listPath_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TBrokerListResponse getSuccess() { - return this.success; - } - - public listPath_result setSuccess(TBrokerListResponse success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TBrokerListResponse)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof listPath_result) - return this.equals((listPath_result)that); - return false; - } - - public boolean equals(listPath_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(listPath_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("listPath_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class listPath_resultStandardSchemeFactory implements SchemeFactory { - public listPath_resultStandardScheme getScheme() { - return new listPath_resultStandardScheme(); - } - } - - private static class listPath_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, listPath_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TBrokerListResponse(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // 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, listPath_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class listPath_resultTupleSchemeFactory implements SchemeFactory { - public listPath_resultTupleScheme getScheme() { - return new listPath_resultTupleScheme(); - } - } - - private static class listPath_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, listPath_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, listPath_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TBrokerListResponse(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class deletePath_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deletePath_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("request", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new deletePath_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new deletePath_argsTupleSchemeFactory()); - } - - public TBrokerDeletePathRequest request; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQUEST((short)1, "request"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQUEST - return REQUEST; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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.REQUEST, new org.apache.thrift.meta_data.FieldMetaData("request", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerDeletePathRequest.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deletePath_args.class, metaDataMap); - } - - public deletePath_args() { - } - - public deletePath_args( - TBrokerDeletePathRequest request) - { - this(); - this.request = request; - } - - /** - * Performs a deep copy on other. - */ - public deletePath_args(deletePath_args other) { - if (other.isSetRequest()) { - this.request = new TBrokerDeletePathRequest(other.request); - } - } - - public deletePath_args deepCopy() { - return new deletePath_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public TBrokerDeletePathRequest getRequest() { - return this.request; - } - - public deletePath_args setRequest(TBrokerDeletePathRequest request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((TBrokerDeletePathRequest)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 REQUEST: - return isSetRequest(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof deletePath_args) - return this.equals((deletePath_args)that); - return false; - } - - public boolean equals(deletePath_args that) { - if (that == null) - return false; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) - return false; - if (!this.request.equals(that.request)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_request = true && (isSetRequest()); - list.add(present_request); - if (present_request) - list.add(request); - - return list.hashCode(); - } - - @Override - public int compareTo(deletePath_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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("deletePath_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (request != null) { - request.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 deletePath_argsStandardSchemeFactory implements SchemeFactory { - public deletePath_argsStandardScheme getScheme() { - return new deletePath_argsStandardScheme(); - } - } - - private static class deletePath_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, deletePath_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = new TBrokerDeletePathRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } else { - 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, deletePath_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class deletePath_argsTupleSchemeFactory implements SchemeFactory { - public deletePath_argsTupleScheme getScheme() { - return new deletePath_argsTupleScheme(); - } - } - - private static class deletePath_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, deletePath_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, deletePath_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new TBrokerDeletePathRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - } - - public static class deletePath_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deletePath_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new deletePath_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new deletePath_resultTupleSchemeFactory()); - } - - public TBrokerOperationStatus success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerOperationStatus.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deletePath_result.class, metaDataMap); - } - - public deletePath_result() { - } - - public deletePath_result( - TBrokerOperationStatus success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public deletePath_result(deletePath_result other) { - if (other.isSetSuccess()) { - this.success = new TBrokerOperationStatus(other.success); - } - } - - public deletePath_result deepCopy() { - return new deletePath_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TBrokerOperationStatus getSuccess() { - return this.success; - } - - public deletePath_result setSuccess(TBrokerOperationStatus success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TBrokerOperationStatus)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof deletePath_result) - return this.equals((deletePath_result)that); - return false; - } - - public boolean equals(deletePath_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(deletePath_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("deletePath_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class deletePath_resultStandardSchemeFactory implements SchemeFactory { - public deletePath_resultStandardScheme getScheme() { - return new deletePath_resultStandardScheme(); - } - } - - private static class deletePath_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, deletePath_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TBrokerOperationStatus(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // 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, deletePath_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class deletePath_resultTupleSchemeFactory implements SchemeFactory { - public deletePath_resultTupleScheme getScheme() { - return new deletePath_resultTupleScheme(); - } - } - - private static class deletePath_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, deletePath_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, deletePath_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TBrokerOperationStatus(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class renamePath_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("renamePath_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("request", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new renamePath_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new renamePath_argsTupleSchemeFactory()); - } - - public TBrokerRenamePathRequest request; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQUEST((short)1, "request"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQUEST - return REQUEST; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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.REQUEST, new org.apache.thrift.meta_data.FieldMetaData("request", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerRenamePathRequest.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(renamePath_args.class, metaDataMap); - } - - public renamePath_args() { - } - - public renamePath_args( - TBrokerRenamePathRequest request) - { - this(); - this.request = request; - } - - /** - * Performs a deep copy on other. - */ - public renamePath_args(renamePath_args other) { - if (other.isSetRequest()) { - this.request = new TBrokerRenamePathRequest(other.request); - } - } - - public renamePath_args deepCopy() { - return new renamePath_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public TBrokerRenamePathRequest getRequest() { - return this.request; - } - - public renamePath_args setRequest(TBrokerRenamePathRequest request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((TBrokerRenamePathRequest)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 REQUEST: - return isSetRequest(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof renamePath_args) - return this.equals((renamePath_args)that); - return false; - } - - public boolean equals(renamePath_args that) { - if (that == null) - return false; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) - return false; - if (!this.request.equals(that.request)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_request = true && (isSetRequest()); - list.add(present_request); - if (present_request) - list.add(request); - - return list.hashCode(); - } - - @Override - public int compareTo(renamePath_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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("renamePath_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (request != null) { - request.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 renamePath_argsStandardSchemeFactory implements SchemeFactory { - public renamePath_argsStandardScheme getScheme() { - return new renamePath_argsStandardScheme(); - } - } - - private static class renamePath_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, renamePath_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = new TBrokerRenamePathRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } else { - 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, renamePath_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class renamePath_argsTupleSchemeFactory implements SchemeFactory { - public renamePath_argsTupleScheme getScheme() { - return new renamePath_argsTupleScheme(); - } - } - - private static class renamePath_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, renamePath_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, renamePath_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new TBrokerRenamePathRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - } - - public static class renamePath_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("renamePath_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new renamePath_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new renamePath_resultTupleSchemeFactory()); - } - - public TBrokerOperationStatus success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerOperationStatus.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(renamePath_result.class, metaDataMap); - } - - public renamePath_result() { - } - - public renamePath_result( - TBrokerOperationStatus success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public renamePath_result(renamePath_result other) { - if (other.isSetSuccess()) { - this.success = new TBrokerOperationStatus(other.success); - } - } - - public renamePath_result deepCopy() { - return new renamePath_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TBrokerOperationStatus getSuccess() { - return this.success; - } - - public renamePath_result setSuccess(TBrokerOperationStatus success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TBrokerOperationStatus)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof renamePath_result) - return this.equals((renamePath_result)that); - return false; - } - - public boolean equals(renamePath_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(renamePath_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("renamePath_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class renamePath_resultStandardSchemeFactory implements SchemeFactory { - public renamePath_resultStandardScheme getScheme() { - return new renamePath_resultStandardScheme(); - } - } - - private static class renamePath_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, renamePath_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TBrokerOperationStatus(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // 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, renamePath_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class renamePath_resultTupleSchemeFactory implements SchemeFactory { - public renamePath_resultTupleScheme getScheme() { - return new renamePath_resultTupleScheme(); - } - } - - private static class renamePath_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, renamePath_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, renamePath_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TBrokerOperationStatus(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class checkPathExist_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("checkPathExist_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("request", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new checkPathExist_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new checkPathExist_argsTupleSchemeFactory()); - } - - public TBrokerCheckPathExistRequest request; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQUEST((short)1, "request"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQUEST - return REQUEST; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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.REQUEST, new org.apache.thrift.meta_data.FieldMetaData("request", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerCheckPathExistRequest.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkPathExist_args.class, metaDataMap); - } - - public checkPathExist_args() { - } - - public checkPathExist_args( - TBrokerCheckPathExistRequest request) - { - this(); - this.request = request; - } - - /** - * Performs a deep copy on other. - */ - public checkPathExist_args(checkPathExist_args other) { - if (other.isSetRequest()) { - this.request = new TBrokerCheckPathExistRequest(other.request); - } - } - - public checkPathExist_args deepCopy() { - return new checkPathExist_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public TBrokerCheckPathExistRequest getRequest() { - return this.request; - } - - public checkPathExist_args setRequest(TBrokerCheckPathExistRequest request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((TBrokerCheckPathExistRequest)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 REQUEST: - return isSetRequest(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof checkPathExist_args) - return this.equals((checkPathExist_args)that); - return false; - } - - public boolean equals(checkPathExist_args that) { - if (that == null) - return false; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) - return false; - if (!this.request.equals(that.request)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_request = true && (isSetRequest()); - list.add(present_request); - if (present_request) - list.add(request); - - return list.hashCode(); - } - - @Override - public int compareTo(checkPathExist_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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("checkPathExist_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (request != null) { - request.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 checkPathExist_argsStandardSchemeFactory implements SchemeFactory { - public checkPathExist_argsStandardScheme getScheme() { - return new checkPathExist_argsStandardScheme(); - } - } - - private static class checkPathExist_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, checkPathExist_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = new TBrokerCheckPathExistRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } else { - 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, checkPathExist_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class checkPathExist_argsTupleSchemeFactory implements SchemeFactory { - public checkPathExist_argsTupleScheme getScheme() { - return new checkPathExist_argsTupleScheme(); - } - } - - private static class checkPathExist_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, checkPathExist_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, checkPathExist_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new TBrokerCheckPathExistRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - } - - public static class checkPathExist_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("checkPathExist_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new checkPathExist_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new checkPathExist_resultTupleSchemeFactory()); - } - - public TBrokerCheckPathExistResponse success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerCheckPathExistResponse.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkPathExist_result.class, metaDataMap); - } - - public checkPathExist_result() { - } - - public checkPathExist_result( - TBrokerCheckPathExistResponse success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public checkPathExist_result(checkPathExist_result other) { - if (other.isSetSuccess()) { - this.success = new TBrokerCheckPathExistResponse(other.success); - } - } - - public checkPathExist_result deepCopy() { - return new checkPathExist_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TBrokerCheckPathExistResponse getSuccess() { - return this.success; - } - - public checkPathExist_result setSuccess(TBrokerCheckPathExistResponse success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TBrokerCheckPathExistResponse)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof checkPathExist_result) - return this.equals((checkPathExist_result)that); - return false; - } - - public boolean equals(checkPathExist_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(checkPathExist_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("checkPathExist_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class checkPathExist_resultStandardSchemeFactory implements SchemeFactory { - public checkPathExist_resultStandardScheme getScheme() { - return new checkPathExist_resultStandardScheme(); - } - } - - private static class checkPathExist_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, checkPathExist_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TBrokerCheckPathExistResponse(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // 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, checkPathExist_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class checkPathExist_resultTupleSchemeFactory implements SchemeFactory { - public checkPathExist_resultTupleScheme getScheme() { - return new checkPathExist_resultTupleScheme(); - } - } - - private static class checkPathExist_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, checkPathExist_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, checkPathExist_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TBrokerCheckPathExistResponse(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class openReader_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("openReader_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("request", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new openReader_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new openReader_argsTupleSchemeFactory()); - } - - public TBrokerOpenReaderRequest request; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQUEST((short)1, "request"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQUEST - return REQUEST; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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.REQUEST, new org.apache.thrift.meta_data.FieldMetaData("request", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerOpenReaderRequest.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(openReader_args.class, metaDataMap); - } - - public openReader_args() { - } - - public openReader_args( - TBrokerOpenReaderRequest request) - { - this(); - this.request = request; - } - - /** - * Performs a deep copy on other. - */ - public openReader_args(openReader_args other) { - if (other.isSetRequest()) { - this.request = new TBrokerOpenReaderRequest(other.request); - } - } - - public openReader_args deepCopy() { - return new openReader_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public TBrokerOpenReaderRequest getRequest() { - return this.request; - } - - public openReader_args setRequest(TBrokerOpenReaderRequest request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((TBrokerOpenReaderRequest)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 REQUEST: - return isSetRequest(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof openReader_args) - return this.equals((openReader_args)that); - return false; - } - - public boolean equals(openReader_args that) { - if (that == null) - return false; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) - return false; - if (!this.request.equals(that.request)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_request = true && (isSetRequest()); - list.add(present_request); - if (present_request) - list.add(request); - - return list.hashCode(); - } - - @Override - public int compareTo(openReader_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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("openReader_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (request != null) { - request.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 openReader_argsStandardSchemeFactory implements SchemeFactory { - public openReader_argsStandardScheme getScheme() { - return new openReader_argsStandardScheme(); - } - } - - private static class openReader_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, openReader_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = new TBrokerOpenReaderRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } else { - 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, openReader_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class openReader_argsTupleSchemeFactory implements SchemeFactory { - public openReader_argsTupleScheme getScheme() { - return new openReader_argsTupleScheme(); - } - } - - private static class openReader_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, openReader_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, openReader_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new TBrokerOpenReaderRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - } - - public static class openReader_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("openReader_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new openReader_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new openReader_resultTupleSchemeFactory()); - } - - public TBrokerOpenReaderResponse success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerOpenReaderResponse.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(openReader_result.class, metaDataMap); - } - - public openReader_result() { - } - - public openReader_result( - TBrokerOpenReaderResponse success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public openReader_result(openReader_result other) { - if (other.isSetSuccess()) { - this.success = new TBrokerOpenReaderResponse(other.success); - } - } - - public openReader_result deepCopy() { - return new openReader_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TBrokerOpenReaderResponse getSuccess() { - return this.success; - } - - public openReader_result setSuccess(TBrokerOpenReaderResponse success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TBrokerOpenReaderResponse)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof openReader_result) - return this.equals((openReader_result)that); - return false; - } - - public boolean equals(openReader_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(openReader_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("openReader_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class openReader_resultStandardSchemeFactory implements SchemeFactory { - public openReader_resultStandardScheme getScheme() { - return new openReader_resultStandardScheme(); - } - } - - private static class openReader_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, openReader_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TBrokerOpenReaderResponse(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // 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, openReader_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class openReader_resultTupleSchemeFactory implements SchemeFactory { - public openReader_resultTupleScheme getScheme() { - return new openReader_resultTupleScheme(); - } - } - - private static class openReader_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, openReader_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, openReader_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TBrokerOpenReaderResponse(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class pread_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("pread_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("request", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new pread_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new pread_argsTupleSchemeFactory()); - } - - public TBrokerPReadRequest request; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQUEST((short)1, "request"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQUEST - return REQUEST; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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.REQUEST, new org.apache.thrift.meta_data.FieldMetaData("request", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerPReadRequest.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(pread_args.class, metaDataMap); - } - - public pread_args() { - } - - public pread_args( - TBrokerPReadRequest request) - { - this(); - this.request = request; - } - - /** - * Performs a deep copy on other. - */ - public pread_args(pread_args other) { - if (other.isSetRequest()) { - this.request = new TBrokerPReadRequest(other.request); - } - } - - public pread_args deepCopy() { - return new pread_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public TBrokerPReadRequest getRequest() { - return this.request; - } - - public pread_args setRequest(TBrokerPReadRequest request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((TBrokerPReadRequest)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 REQUEST: - return isSetRequest(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof pread_args) - return this.equals((pread_args)that); - return false; - } - - public boolean equals(pread_args that) { - if (that == null) - return false; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) - return false; - if (!this.request.equals(that.request)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_request = true && (isSetRequest()); - list.add(present_request); - if (present_request) - list.add(request); - - return list.hashCode(); - } - - @Override - public int compareTo(pread_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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("pread_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (request != null) { - request.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 pread_argsStandardSchemeFactory implements SchemeFactory { - public pread_argsStandardScheme getScheme() { - return new pread_argsStandardScheme(); - } - } - - private static class pread_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, pread_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = new TBrokerPReadRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } else { - 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, pread_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class pread_argsTupleSchemeFactory implements SchemeFactory { - public pread_argsTupleScheme getScheme() { - return new pread_argsTupleScheme(); - } - } - - private static class pread_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, pread_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, pread_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new TBrokerPReadRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - } - - public static class pread_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("pread_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new pread_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new pread_resultTupleSchemeFactory()); - } - - public TBrokerReadResponse success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerReadResponse.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(pread_result.class, metaDataMap); - } - - public pread_result() { - } - - public pread_result( - TBrokerReadResponse success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public pread_result(pread_result other) { - if (other.isSetSuccess()) { - this.success = new TBrokerReadResponse(other.success); - } - } - - public pread_result deepCopy() { - return new pread_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TBrokerReadResponse getSuccess() { - return this.success; - } - - public pread_result setSuccess(TBrokerReadResponse success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TBrokerReadResponse)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof pread_result) - return this.equals((pread_result)that); - return false; - } - - public boolean equals(pread_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(pread_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("pread_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class pread_resultStandardSchemeFactory implements SchemeFactory { - public pread_resultStandardScheme getScheme() { - return new pread_resultStandardScheme(); - } - } - - private static class pread_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, pread_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TBrokerReadResponse(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // 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, pread_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class pread_resultTupleSchemeFactory implements SchemeFactory { - public pread_resultTupleScheme getScheme() { - return new pread_resultTupleScheme(); - } - } - - private static class pread_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, pread_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, pread_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TBrokerReadResponse(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class seek_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("seek_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("request", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new seek_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new seek_argsTupleSchemeFactory()); - } - - public TBrokerSeekRequest request; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQUEST((short)1, "request"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQUEST - return REQUEST; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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.REQUEST, new org.apache.thrift.meta_data.FieldMetaData("request", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerSeekRequest.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(seek_args.class, metaDataMap); - } - - public seek_args() { - } - - public seek_args( - TBrokerSeekRequest request) - { - this(); - this.request = request; - } - - /** - * Performs a deep copy on other. - */ - public seek_args(seek_args other) { - if (other.isSetRequest()) { - this.request = new TBrokerSeekRequest(other.request); - } - } - - public seek_args deepCopy() { - return new seek_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public TBrokerSeekRequest getRequest() { - return this.request; - } - - public seek_args setRequest(TBrokerSeekRequest request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((TBrokerSeekRequest)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 REQUEST: - return isSetRequest(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof seek_args) - return this.equals((seek_args)that); - return false; - } - - public boolean equals(seek_args that) { - if (that == null) - return false; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) - return false; - if (!this.request.equals(that.request)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_request = true && (isSetRequest()); - list.add(present_request); - if (present_request) - list.add(request); - - return list.hashCode(); - } - - @Override - public int compareTo(seek_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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("seek_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (request != null) { - request.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 seek_argsStandardSchemeFactory implements SchemeFactory { - public seek_argsStandardScheme getScheme() { - return new seek_argsStandardScheme(); - } - } - - private static class seek_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, seek_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = new TBrokerSeekRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } else { - 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, seek_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class seek_argsTupleSchemeFactory implements SchemeFactory { - public seek_argsTupleScheme getScheme() { - return new seek_argsTupleScheme(); - } - } - - private static class seek_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, seek_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, seek_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new TBrokerSeekRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - } - - public static class seek_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("seek_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new seek_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new seek_resultTupleSchemeFactory()); - } - - public TBrokerOperationStatus success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerOperationStatus.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(seek_result.class, metaDataMap); - } - - public seek_result() { - } - - public seek_result( - TBrokerOperationStatus success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public seek_result(seek_result other) { - if (other.isSetSuccess()) { - this.success = new TBrokerOperationStatus(other.success); - } - } - - public seek_result deepCopy() { - return new seek_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TBrokerOperationStatus getSuccess() { - return this.success; - } - - public seek_result setSuccess(TBrokerOperationStatus success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TBrokerOperationStatus)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof seek_result) - return this.equals((seek_result)that); - return false; - } - - public boolean equals(seek_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(seek_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("seek_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class seek_resultStandardSchemeFactory implements SchemeFactory { - public seek_resultStandardScheme getScheme() { - return new seek_resultStandardScheme(); - } - } - - private static class seek_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, seek_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TBrokerOperationStatus(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // 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, seek_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class seek_resultTupleSchemeFactory implements SchemeFactory { - public seek_resultTupleScheme getScheme() { - return new seek_resultTupleScheme(); - } - } - - private static class seek_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, seek_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, seek_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TBrokerOperationStatus(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class closeReader_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeReader_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("request", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new closeReader_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new closeReader_argsTupleSchemeFactory()); - } - - public TBrokerCloseReaderRequest request; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQUEST((short)1, "request"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQUEST - return REQUEST; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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.REQUEST, new org.apache.thrift.meta_data.FieldMetaData("request", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerCloseReaderRequest.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeReader_args.class, metaDataMap); - } - - public closeReader_args() { - } - - public closeReader_args( - TBrokerCloseReaderRequest request) - { - this(); - this.request = request; - } - - /** - * Performs a deep copy on other. - */ - public closeReader_args(closeReader_args other) { - if (other.isSetRequest()) { - this.request = new TBrokerCloseReaderRequest(other.request); - } - } - - public closeReader_args deepCopy() { - return new closeReader_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public TBrokerCloseReaderRequest getRequest() { - return this.request; - } - - public closeReader_args setRequest(TBrokerCloseReaderRequest request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((TBrokerCloseReaderRequest)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 REQUEST: - return isSetRequest(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof closeReader_args) - return this.equals((closeReader_args)that); - return false; - } - - public boolean equals(closeReader_args that) { - if (that == null) - return false; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) - return false; - if (!this.request.equals(that.request)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_request = true && (isSetRequest()); - list.add(present_request); - if (present_request) - list.add(request); - - return list.hashCode(); - } - - @Override - public int compareTo(closeReader_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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("closeReader_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (request != null) { - request.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 closeReader_argsStandardSchemeFactory implements SchemeFactory { - public closeReader_argsStandardScheme getScheme() { - return new closeReader_argsStandardScheme(); - } - } - - private static class closeReader_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, closeReader_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = new TBrokerCloseReaderRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } else { - 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, closeReader_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class closeReader_argsTupleSchemeFactory implements SchemeFactory { - public closeReader_argsTupleScheme getScheme() { - return new closeReader_argsTupleScheme(); - } - } - - private static class closeReader_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, closeReader_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, closeReader_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new TBrokerCloseReaderRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - } - - public static class closeReader_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeReader_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new closeReader_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new closeReader_resultTupleSchemeFactory()); - } - - public TBrokerOperationStatus success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerOperationStatus.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeReader_result.class, metaDataMap); - } - - public closeReader_result() { - } - - public closeReader_result( - TBrokerOperationStatus success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public closeReader_result(closeReader_result other) { - if (other.isSetSuccess()) { - this.success = new TBrokerOperationStatus(other.success); - } - } - - public closeReader_result deepCopy() { - return new closeReader_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TBrokerOperationStatus getSuccess() { - return this.success; - } - - public closeReader_result setSuccess(TBrokerOperationStatus success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TBrokerOperationStatus)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof closeReader_result) - return this.equals((closeReader_result)that); - return false; - } - - public boolean equals(closeReader_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(closeReader_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("closeReader_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class closeReader_resultStandardSchemeFactory implements SchemeFactory { - public closeReader_resultStandardScheme getScheme() { - return new closeReader_resultStandardScheme(); - } - } - - private static class closeReader_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, closeReader_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TBrokerOperationStatus(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // 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, closeReader_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class closeReader_resultTupleSchemeFactory implements SchemeFactory { - public closeReader_resultTupleScheme getScheme() { - return new closeReader_resultTupleScheme(); - } - } - - private static class closeReader_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, closeReader_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, closeReader_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TBrokerOperationStatus(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class openWriter_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("openWriter_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("request", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new openWriter_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new openWriter_argsTupleSchemeFactory()); - } - - public TBrokerOpenWriterRequest request; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQUEST((short)1, "request"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQUEST - return REQUEST; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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.REQUEST, new org.apache.thrift.meta_data.FieldMetaData("request", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerOpenWriterRequest.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(openWriter_args.class, metaDataMap); - } - - public openWriter_args() { - } - - public openWriter_args( - TBrokerOpenWriterRequest request) - { - this(); - this.request = request; - } - - /** - * Performs a deep copy on other. - */ - public openWriter_args(openWriter_args other) { - if (other.isSetRequest()) { - this.request = new TBrokerOpenWriterRequest(other.request); - } - } - - public openWriter_args deepCopy() { - return new openWriter_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public TBrokerOpenWriterRequest getRequest() { - return this.request; - } - - public openWriter_args setRequest(TBrokerOpenWriterRequest request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((TBrokerOpenWriterRequest)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 REQUEST: - return isSetRequest(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof openWriter_args) - return this.equals((openWriter_args)that); - return false; - } - - public boolean equals(openWriter_args that) { - if (that == null) - return false; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) - return false; - if (!this.request.equals(that.request)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_request = true && (isSetRequest()); - list.add(present_request); - if (present_request) - list.add(request); - - return list.hashCode(); - } - - @Override - public int compareTo(openWriter_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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("openWriter_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (request != null) { - request.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 openWriter_argsStandardSchemeFactory implements SchemeFactory { - public openWriter_argsStandardScheme getScheme() { - return new openWriter_argsStandardScheme(); - } - } - - private static class openWriter_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, openWriter_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = new TBrokerOpenWriterRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } else { - 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, openWriter_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class openWriter_argsTupleSchemeFactory implements SchemeFactory { - public openWriter_argsTupleScheme getScheme() { - return new openWriter_argsTupleScheme(); - } - } - - private static class openWriter_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, openWriter_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, openWriter_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new TBrokerOpenWriterRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - } - - public static class openWriter_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("openWriter_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new openWriter_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new openWriter_resultTupleSchemeFactory()); - } - - public TBrokerOpenWriterResponse success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerOpenWriterResponse.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(openWriter_result.class, metaDataMap); - } - - public openWriter_result() { - } - - public openWriter_result( - TBrokerOpenWriterResponse success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public openWriter_result(openWriter_result other) { - if (other.isSetSuccess()) { - this.success = new TBrokerOpenWriterResponse(other.success); - } - } - - public openWriter_result deepCopy() { - return new openWriter_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TBrokerOpenWriterResponse getSuccess() { - return this.success; - } - - public openWriter_result setSuccess(TBrokerOpenWriterResponse success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TBrokerOpenWriterResponse)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof openWriter_result) - return this.equals((openWriter_result)that); - return false; - } - - public boolean equals(openWriter_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(openWriter_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("openWriter_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class openWriter_resultStandardSchemeFactory implements SchemeFactory { - public openWriter_resultStandardScheme getScheme() { - return new openWriter_resultStandardScheme(); - } - } - - private static class openWriter_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, openWriter_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TBrokerOpenWriterResponse(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // 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, openWriter_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class openWriter_resultTupleSchemeFactory implements SchemeFactory { - public openWriter_resultTupleScheme getScheme() { - return new openWriter_resultTupleScheme(); - } - } - - private static class openWriter_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, openWriter_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, openWriter_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TBrokerOpenWriterResponse(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class pwrite_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("pwrite_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("request", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new pwrite_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new pwrite_argsTupleSchemeFactory()); - } - - public TBrokerPWriteRequest request; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQUEST((short)1, "request"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQUEST - return REQUEST; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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.REQUEST, new org.apache.thrift.meta_data.FieldMetaData("request", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerPWriteRequest.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(pwrite_args.class, metaDataMap); - } - - public pwrite_args() { - } - - public pwrite_args( - TBrokerPWriteRequest request) - { - this(); - this.request = request; - } - - /** - * Performs a deep copy on other. - */ - public pwrite_args(pwrite_args other) { - if (other.isSetRequest()) { - this.request = new TBrokerPWriteRequest(other.request); - } - } - - public pwrite_args deepCopy() { - return new pwrite_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public TBrokerPWriteRequest getRequest() { - return this.request; - } - - public pwrite_args setRequest(TBrokerPWriteRequest request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((TBrokerPWriteRequest)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 REQUEST: - return isSetRequest(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof pwrite_args) - return this.equals((pwrite_args)that); - return false; - } - - public boolean equals(pwrite_args that) { - if (that == null) - return false; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) - return false; - if (!this.request.equals(that.request)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_request = true && (isSetRequest()); - list.add(present_request); - if (present_request) - list.add(request); - - return list.hashCode(); - } - - @Override - public int compareTo(pwrite_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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("pwrite_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (request != null) { - request.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 pwrite_argsStandardSchemeFactory implements SchemeFactory { - public pwrite_argsStandardScheme getScheme() { - return new pwrite_argsStandardScheme(); - } - } - - private static class pwrite_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, pwrite_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = new TBrokerPWriteRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } else { - 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, pwrite_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class pwrite_argsTupleSchemeFactory implements SchemeFactory { - public pwrite_argsTupleScheme getScheme() { - return new pwrite_argsTupleScheme(); - } - } - - private static class pwrite_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, pwrite_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, pwrite_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new TBrokerPWriteRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - } - - public static class pwrite_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("pwrite_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new pwrite_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new pwrite_resultTupleSchemeFactory()); - } - - public TBrokerOperationStatus success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerOperationStatus.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(pwrite_result.class, metaDataMap); - } - - public pwrite_result() { - } - - public pwrite_result( - TBrokerOperationStatus success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public pwrite_result(pwrite_result other) { - if (other.isSetSuccess()) { - this.success = new TBrokerOperationStatus(other.success); - } - } - - public pwrite_result deepCopy() { - return new pwrite_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TBrokerOperationStatus getSuccess() { - return this.success; - } - - public pwrite_result setSuccess(TBrokerOperationStatus success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TBrokerOperationStatus)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof pwrite_result) - return this.equals((pwrite_result)that); - return false; - } - - public boolean equals(pwrite_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(pwrite_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("pwrite_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class pwrite_resultStandardSchemeFactory implements SchemeFactory { - public pwrite_resultStandardScheme getScheme() { - return new pwrite_resultStandardScheme(); - } - } - - private static class pwrite_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, pwrite_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TBrokerOperationStatus(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // 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, pwrite_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class pwrite_resultTupleSchemeFactory implements SchemeFactory { - public pwrite_resultTupleScheme getScheme() { - return new pwrite_resultTupleScheme(); - } - } - - private static class pwrite_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, pwrite_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, pwrite_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TBrokerOperationStatus(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class closeWriter_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeWriter_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("request", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new closeWriter_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new closeWriter_argsTupleSchemeFactory()); - } - - public TBrokerCloseWriterRequest request; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQUEST((short)1, "request"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQUEST - return REQUEST; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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.REQUEST, new org.apache.thrift.meta_data.FieldMetaData("request", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerCloseWriterRequest.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeWriter_args.class, metaDataMap); - } - - public closeWriter_args() { - } - - public closeWriter_args( - TBrokerCloseWriterRequest request) - { - this(); - this.request = request; - } - - /** - * Performs a deep copy on other. - */ - public closeWriter_args(closeWriter_args other) { - if (other.isSetRequest()) { - this.request = new TBrokerCloseWriterRequest(other.request); - } - } - - public closeWriter_args deepCopy() { - return new closeWriter_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public TBrokerCloseWriterRequest getRequest() { - return this.request; - } - - public closeWriter_args setRequest(TBrokerCloseWriterRequest request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((TBrokerCloseWriterRequest)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 REQUEST: - return isSetRequest(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof closeWriter_args) - return this.equals((closeWriter_args)that); - return false; - } - - public boolean equals(closeWriter_args that) { - if (that == null) - return false; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) - return false; - if (!this.request.equals(that.request)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_request = true && (isSetRequest()); - list.add(present_request); - if (present_request) - list.add(request); - - return list.hashCode(); - } - - @Override - public int compareTo(closeWriter_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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("closeWriter_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (request != null) { - request.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 closeWriter_argsStandardSchemeFactory implements SchemeFactory { - public closeWriter_argsStandardScheme getScheme() { - return new closeWriter_argsStandardScheme(); - } - } - - private static class closeWriter_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, closeWriter_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = new TBrokerCloseWriterRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } else { - 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, closeWriter_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class closeWriter_argsTupleSchemeFactory implements SchemeFactory { - public closeWriter_argsTupleScheme getScheme() { - return new closeWriter_argsTupleScheme(); - } - } - - private static class closeWriter_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, closeWriter_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, closeWriter_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new TBrokerCloseWriterRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - } - - public static class closeWriter_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeWriter_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new closeWriter_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new closeWriter_resultTupleSchemeFactory()); - } - - public TBrokerOperationStatus success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerOperationStatus.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeWriter_result.class, metaDataMap); - } - - public closeWriter_result() { - } - - public closeWriter_result( - TBrokerOperationStatus success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public closeWriter_result(closeWriter_result other) { - if (other.isSetSuccess()) { - this.success = new TBrokerOperationStatus(other.success); - } - } - - public closeWriter_result deepCopy() { - return new closeWriter_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TBrokerOperationStatus getSuccess() { - return this.success; - } - - public closeWriter_result setSuccess(TBrokerOperationStatus success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TBrokerOperationStatus)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof closeWriter_result) - return this.equals((closeWriter_result)that); - return false; - } - - public boolean equals(closeWriter_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(closeWriter_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("closeWriter_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class closeWriter_resultStandardSchemeFactory implements SchemeFactory { - public closeWriter_resultStandardScheme getScheme() { - return new closeWriter_resultStandardScheme(); - } - } - - private static class closeWriter_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, closeWriter_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TBrokerOperationStatus(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // 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, closeWriter_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class closeWriter_resultTupleSchemeFactory implements SchemeFactory { - public closeWriter_resultTupleScheme getScheme() { - return new closeWriter_resultTupleScheme(); - } - } - - private static class closeWriter_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, closeWriter_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, closeWriter_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TBrokerOperationStatus(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class ping_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ping_args"); - - private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("request", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ping_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ping_argsTupleSchemeFactory()); - } - - public TBrokerPingBrokerRequest request; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQUEST((short)1, "request"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQUEST - return REQUEST; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches 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.REQUEST, new org.apache.thrift.meta_data.FieldMetaData("request", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerPingBrokerRequest.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ping_args.class, metaDataMap); - } - - public ping_args() { - } - - public ping_args( - TBrokerPingBrokerRequest request) - { - this(); - this.request = request; - } - - /** - * Performs a deep copy on other. - */ - public ping_args(ping_args other) { - if (other.isSetRequest()) { - this.request = new TBrokerPingBrokerRequest(other.request); - } - } - - public ping_args deepCopy() { - return new ping_args(this); - } - - @Override - public void clear() { - this.request = null; - } - - public TBrokerPingBrokerRequest getRequest() { - return this.request; - } - - public ping_args setRequest(TBrokerPingBrokerRequest request) { - this.request = request; - return this; - } - - public void unsetRequest() { - this.request = null; - } - - /** Returns true if field request is set (has been assigned a value) and false otherwise */ - public boolean isSetRequest() { - return this.request != null; - } - - public void setRequestIsSet(boolean value) { - if (!value) { - this.request = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQUEST: - if (value == null) { - unsetRequest(); - } else { - setRequest((TBrokerPingBrokerRequest)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQUEST: - return getRequest(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field 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 REQUEST: - return isSetRequest(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof ping_args) - return this.equals((ping_args)that); - return false; - } - - public boolean equals(ping_args that) { - if (that == null) - return false; - - boolean this_present_request = true && this.isSetRequest(); - boolean that_present_request = true && that.isSetRequest(); - if (this_present_request || that_present_request) { - if (!(this_present_request && that_present_request)) - return false; - if (!this.request.equals(that.request)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_request = true && (isSetRequest()); - list.add(present_request); - if (present_request) - list.add(request); - - return list.hashCode(); - } - - @Override - public int compareTo(ping_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRequest()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); - 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("ping_args("); - boolean first = true; - - sb.append("request:"); - if (this.request == null) { - sb.append("null"); - } else { - sb.append(this.request); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (request != null) { - request.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(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 ping_argsStandardSchemeFactory implements SchemeFactory { - public ping_argsStandardScheme getScheme() { - return new ping_argsStandardScheme(); - } - } - - private static class ping_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, ping_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQUEST - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.request = new TBrokerPingBrokerRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } else { - 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, ping_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.request != null) { - oprot.writeFieldBegin(REQUEST_FIELD_DESC); - struct.request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class ping_argsTupleSchemeFactory implements SchemeFactory { - public ping_argsTupleScheme getScheme() { - return new ping_argsTupleScheme(); - } - } - - private static class ping_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ping_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetRequest()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetRequest()) { - struct.request.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ping_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.request = new TBrokerPingBrokerRequest(); - struct.request.read(iprot); - struct.setRequestIsSet(true); - } - } - } - - } - - public static class ping_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ping_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ping_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ping_resultTupleSchemeFactory()); - } - - public TBrokerOperationStatus success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBrokerOperationStatus.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ping_result.class, metaDataMap); - } - - public ping_result() { - } - - public ping_result( - TBrokerOperationStatus success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public ping_result(ping_result other) { - if (other.isSetSuccess()) { - this.success = new TBrokerOperationStatus(other.success); - } - } - - public ping_result deepCopy() { - return new ping_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TBrokerOperationStatus getSuccess() { - return this.success; - } - - public ping_result setSuccess(TBrokerOperationStatus success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TBrokerOperationStatus)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof ping_result) - return this.equals((ping_result)that); - return false; - } - - public boolean equals(ping_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(ping_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("ping_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class ping_resultStandardSchemeFactory implements SchemeFactory { - public ping_resultStandardScheme getScheme() { - return new ping_resultStandardScheme(); - } - } - - private static class ping_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, ping_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TBrokerOperationStatus(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // 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, ping_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class ping_resultTupleSchemeFactory implements SchemeFactory { - public ping_resultTupleScheme getScheme() { - return new ping_resultTupleScheme(); - } - } - - private static class ping_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ping_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ping_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TBrokerOperationStatus(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - -}