Removed generated thrift files in apache hdfs broker.

Internal commit id: Ief3bb767165dbd9c2a4640ad8407967d92b1c8ba
This commit is contained in:
morningman
2018-10-27 16:27:12 +08:00
parent 68d663fe7a
commit e453fca39a
25 changed files with 0 additions and 23423 deletions

View File

@ -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<TBrokerFileStatus> 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<string,string> properties;
5: optional bool fileNameOnly;
}
struct TBrokerDeletePathRequest {
1: required TBrokerVersion version;
2: required string path;
3: required map<string,string> properties;
}
struct TBrokerRenamePathRequest {
1: required TBrokerVersion version;
2: required string srcPath;
3: required string destPath;
4: required map<string,string> properties;
}
struct TBrokerCheckPathExistRequest {
1: required TBrokerVersion version;
2: required string path;
3: required map<string,string> properties;
}
struct TBrokerOpenReaderRequest {
1: required TBrokerVersion version;
2: required string path;
3: required i64 startOffset;
4: required string clientId;
5: required map<string,string> 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<string,string> 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);
}

View File

@ -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<TBrokerCheckPathExistRequest, TBrokerCheckPathExistRequest._Fields>, java.io.Serializable, Cloneable, Comparable<TBrokerCheckPathExistRequest> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String,String> 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // VERSION
return VERSION;
case 2: // 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<String,String> properties)
{
this();
this.version = version;
this.path = path;
this.properties = properties;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public TBrokerCheckPathExistRequest(TBrokerCheckPathExistRequest other) {
if (other.isSetVersion()) {
this.version = other.version;
}
if (other.isSetPath()) {
this.path = other.path;
}
if (other.isSetProperties()) {
Map<String,String> __this__properties = new HashMap<String,String>(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<String,String>();
}
this.properties.put(key, val);
}
public Map<String,String> getProperties() {
return this.properties;
}
public TBrokerCheckPathExistRequest setProperties(Map<String,String> 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<String,String>)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<Object> list = new ArrayList<Object>();
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<TBrokerCheckPathExistRequest> {
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<String,String>(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<String, String> _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<TBrokerCheckPathExistRequest> {
@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<String, String> _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<String,String>(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);
}
}
}

View File

@ -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<TBrokerCheckPathExistResponse, TBrokerCheckPathExistResponse._Fields>, java.io.Serializable, Cloneable, Comparable<TBrokerCheckPathExistResponse> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // 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 <i>other</i>.
*/
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<Object> list = new ArrayList<Object>();
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<TBrokerCheckPathExistResponse> {
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<TBrokerCheckPathExistResponse> {
@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);
}
}
}

View File

@ -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<TBrokerCloseReaderRequest, TBrokerCloseReaderRequest._Fields>, java.io.Serializable, Cloneable, Comparable<TBrokerCloseReaderRequest> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // VERSION
return VERSION;
case 2: // 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 <i>other</i>.
*/
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<Object> list = new ArrayList<Object>();
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<TBrokerCloseReaderRequest> {
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<TBrokerCloseReaderRequest> {
@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);
}
}
}

View File

@ -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<TBrokerCloseWriterRequest, TBrokerCloseWriterRequest._Fields>, java.io.Serializable, Cloneable, Comparable<TBrokerCloseWriterRequest> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // VERSION
return VERSION;
case 2: // 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 <i>other</i>.
*/
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<Object> list = new ArrayList<Object>();
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<TBrokerCloseWriterRequest> {
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<TBrokerCloseWriterRequest> {
@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);
}
}
}

View File

@ -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<TBrokerDeletePathRequest, TBrokerDeletePathRequest._Fields>, java.io.Serializable, Cloneable, Comparable<TBrokerDeletePathRequest> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String,String> 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // VERSION
return VERSION;
case 2: // 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<String,String> properties)
{
this();
this.version = version;
this.path = path;
this.properties = properties;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public TBrokerDeletePathRequest(TBrokerDeletePathRequest other) {
if (other.isSetVersion()) {
this.version = other.version;
}
if (other.isSetPath()) {
this.path = other.path;
}
if (other.isSetProperties()) {
Map<String,String> __this__properties = new HashMap<String,String>(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<String,String>();
}
this.properties.put(key, val);
}
public Map<String,String> getProperties() {
return this.properties;
}
public TBrokerDeletePathRequest setProperties(Map<String,String> 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<String,String>)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<Object> list = new ArrayList<Object>();
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<TBrokerDeletePathRequest> {
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<String,String>(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<String, String> _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<TBrokerDeletePathRequest> {
@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<String, String> _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<String,String>(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);
}
}
}

View File

@ -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<TBrokerFD, TBrokerFD._Fields>, java.io.Serializable, Cloneable, Comparable<TBrokerFD> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // 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 <i>other</i>.
*/
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<Object> list = new ArrayList<Object>();
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<TBrokerFD> {
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<TBrokerFD> {
@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);
}
}
}

View File

@ -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<TBrokerFileStatus, TBrokerFileStatus._Fields>, java.io.Serializable, Cloneable, Comparable<TBrokerFileStatus> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // 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 <i>other</i>.
*/
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<Object> list = new ArrayList<Object>();
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<TBrokerFileStatus> {
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<TBrokerFileStatus> {
@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);
}
}
}

View File

@ -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<TBrokerListPathRequest, TBrokerListPathRequest._Fields>, java.io.Serializable, Cloneable, Comparable<TBrokerListPathRequest> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String,String> 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // VERSION
return VERSION;
case 2: // 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<String,String> properties)
{
this();
this.version = version;
this.path = path;
this.isRecursive = isRecursive;
setIsRecursiveIsSet(true);
this.properties = properties;
}
/**
* Performs a deep copy on <i>other</i>.
*/
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<String,String> __this__properties = new HashMap<String,String>(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<String,String>();
}
this.properties.put(key, val);
}
public Map<String,String> getProperties() {
return this.properties;
}
public TBrokerListPathRequest setProperties(Map<String,String> 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<String,String>)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<Object> list = new ArrayList<Object>();
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<TBrokerListPathRequest> {
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<String,String>(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<String, String> _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<TBrokerListPathRequest> {
@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<String, String> _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<String,String>(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);
}
}
}
}

View File

@ -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<TBrokerListResponse, TBrokerListResponse._Fields>, java.io.Serializable, Cloneable, Comparable<TBrokerListResponse> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new TBrokerListResponseStandardSchemeFactory());
schemes.put(TupleScheme.class, new TBrokerListResponseTupleSchemeFactory());
}
public TBrokerOperationStatus opStatus; // required
public List<TBrokerFileStatus> 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // 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 <i>other</i>.
*/
public TBrokerListResponse(TBrokerListResponse other) {
if (other.isSetOpStatus()) {
this.opStatus = new TBrokerOperationStatus(other.opStatus);
}
if (other.isSetFiles()) {
List<TBrokerFileStatus> __this__files = new ArrayList<TBrokerFileStatus>(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<TBrokerFileStatus> getFilesIterator() {
return (this.files == null) ? null : this.files.iterator();
}
public void addToFiles(TBrokerFileStatus elem) {
if (this.files == null) {
this.files = new ArrayList<TBrokerFileStatus>();
}
this.files.add(elem);
}
public List<TBrokerFileStatus> getFiles() {
return this.files;
}
public TBrokerListResponse setFiles(List<TBrokerFileStatus> 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<TBrokerFileStatus>)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<Object> list = new ArrayList<Object>();
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<TBrokerListResponse> {
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<TBrokerFileStatus>(_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<TBrokerListResponse> {
@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<TBrokerFileStatus>(_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);
}
}
}
}

View File

@ -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;
}
}
}

View File

@ -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<TBrokerOpenReaderRequest, TBrokerOpenReaderRequest._Fields>, java.io.Serializable, Cloneable, Comparable<TBrokerOpenReaderRequest> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String,String> 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // VERSION
return VERSION;
case 2: // 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<String,String> properties)
{
this();
this.version = version;
this.path = path;
this.startOffset = startOffset;
setStartOffsetIsSet(true);
this.clientId = clientId;
this.properties = properties;
}
/**
* Performs a deep copy on <i>other</i>.
*/
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<String,String> __this__properties = new HashMap<String,String>(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<String,String>();
}
this.properties.put(key, val);
}
public Map<String,String> getProperties() {
return this.properties;
}
public TBrokerOpenReaderRequest setProperties(Map<String,String> 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<String,String>)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<Object> list = new ArrayList<Object>();
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<TBrokerOpenReaderRequest> {
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<String,String>(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<String, String> _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<TBrokerOpenReaderRequest> {
@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<String, String> _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<String,String>(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);
}
}
}

View File

@ -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<TBrokerOpenReaderResponse, TBrokerOpenReaderResponse._Fields>, java.io.Serializable, Cloneable, Comparable<TBrokerOpenReaderResponse> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // 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 <i>other</i>.
*/
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<Object> list = new ArrayList<Object>();
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<TBrokerOpenReaderResponse> {
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<TBrokerOpenReaderResponse> {
@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);
}
}
}
}

View File

@ -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<TBrokerOpenWriterRequest, TBrokerOpenWriterRequest._Fields>, java.io.Serializable, Cloneable, Comparable<TBrokerOpenWriterRequest> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String,String> 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // VERSION
return VERSION;
case 2: // 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<String,String> properties)
{
this();
this.version = version;
this.path = path;
this.openMode = openMode;
this.clientId = clientId;
this.properties = properties;
}
/**
* Performs a deep copy on <i>other</i>.
*/
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<String,String> __this__properties = new HashMap<String,String>(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<String,String>();
}
this.properties.put(key, val);
}
public Map<String,String> getProperties() {
return this.properties;
}
public TBrokerOpenWriterRequest setProperties(Map<String,String> 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<String,String>)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<Object> list = new ArrayList<Object>();
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<TBrokerOpenWriterRequest> {
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<String,String>(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<String, String> _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<TBrokerOpenWriterRequest> {
@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<String, String> _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<String,String>(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);
}
}
}

View File

@ -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<TBrokerOpenWriterResponse, TBrokerOpenWriterResponse._Fields>, java.io.Serializable, Cloneable, Comparable<TBrokerOpenWriterResponse> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // 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 <i>other</i>.
*/
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<Object> list = new ArrayList<Object>();
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<TBrokerOpenWriterResponse> {
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<TBrokerOpenWriterResponse> {
@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);
}
}
}
}

View File

@ -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<TBrokerOperationStatus, TBrokerOperationStatus._Fields>, java.io.Serializable, Cloneable, Comparable<TBrokerOperationStatus> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // STATUS_CODE
return STATUS_CODE;
case 2: // 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 <i>other</i>.
*/
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<Object> list = new ArrayList<Object>();
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<TBrokerOperationStatus> {
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<TBrokerOperationStatus> {
@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);
}
}
}
}

View File

@ -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;
}
}
}

View File

@ -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<TBrokerPReadRequest, TBrokerPReadRequest._Fields>, java.io.Serializable, Cloneable, Comparable<TBrokerPReadRequest> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // VERSION
return VERSION;
case 2: // 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 <i>other</i>.
*/
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<Object> list = new ArrayList<Object>();
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<TBrokerPReadRequest> {
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<TBrokerPReadRequest> {
@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);
}
}
}

View File

@ -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<TBrokerPWriteRequest, TBrokerPWriteRequest._Fields>, java.io.Serializable, Cloneable, Comparable<TBrokerPWriteRequest> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // VERSION
return VERSION;
case 2: // 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 <i>other</i>.
*/
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<Object> list = new ArrayList<Object>();
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<TBrokerPWriteRequest> {
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<TBrokerPWriteRequest> {
@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);
}
}
}

View File

@ -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<TBrokerPingBrokerRequest, TBrokerPingBrokerRequest._Fields>, java.io.Serializable, Cloneable, Comparable<TBrokerPingBrokerRequest> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // VERSION
return VERSION;
case 2: // 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 <i>other</i>.
*/
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<Object> list = new ArrayList<Object>();
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<TBrokerPingBrokerRequest> {
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<TBrokerPingBrokerRequest> {
@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);
}
}
}

View File

@ -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<TBrokerReadResponse, TBrokerReadResponse._Fields>, java.io.Serializable, Cloneable, Comparable<TBrokerReadResponse> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // 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 <i>other</i>.
*/
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<Object> list = new ArrayList<Object>();
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<TBrokerReadResponse> {
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<TBrokerReadResponse> {
@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);
}
}
}
}

View File

@ -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<TBrokerRenamePathRequest, TBrokerRenamePathRequest._Fields>, java.io.Serializable, Cloneable, Comparable<TBrokerRenamePathRequest> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String,String> 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // VERSION
return VERSION;
case 2: // 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<String,String> properties)
{
this();
this.version = version;
this.srcPath = srcPath;
this.destPath = destPath;
this.properties = properties;
}
/**
* Performs a deep copy on <i>other</i>.
*/
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<String,String> __this__properties = new HashMap<String,String>(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<String,String>();
}
this.properties.put(key, val);
}
public Map<String,String> getProperties() {
return this.properties;
}
public TBrokerRenamePathRequest setProperties(Map<String,String> 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<String,String>)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<Object> list = new ArrayList<Object>();
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<TBrokerRenamePathRequest> {
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<String,String>(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<String, String> _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<TBrokerRenamePathRequest> {
@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<String, String> _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<String,String>(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);
}
}
}

View File

@ -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<TBrokerSeekRequest, TBrokerSeekRequest._Fields>, java.io.Serializable, Cloneable, Comparable<TBrokerSeekRequest> {
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // VERSION
return VERSION;
case 2: // 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 <i>other</i>.
*/
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<Object> list = new ArrayList<Object>();
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<TBrokerSeekRequest> {
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<TBrokerSeekRequest> {
@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);
}
}
}

View File

@ -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;
}
}
}