package com.cloudera.flume.reporter.server.thrift;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.thrift.*;
import org.apache.thrift.async.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.transport.*;
import org.apache.thrift.protocol.*;
public Map<String,ThriftFlumeReport>
getAllReports()
throws TException;
public ThriftFlumeReport
getReportByName(String reportName)
throws TException;
}
public void getAllReports(AsyncMethodCallback<AsyncClient.getAllReports_call> resultHandler)
throws TException;
public void getReportByName(String reportName, AsyncMethodCallback<AsyncClient.getReportByName_call> resultHandler)
throws TException;
}
public static class Client implements TServiceClient, Iface {
public static class Factory implements TServiceClientFactory<Client> {
return new Client(prot);
}
public Client
getClient(TProtocol iprot, TProtocol oprot) {
return new Client(iprot, oprot);
}
}
{
this(prot, prot);
}
public Client(TProtocol iprot, TProtocol oprot)
{
iprot_ = iprot;
oprot_ = oprot;
}
protected TProtocol iprot_;
protected TProtocol oprot_;
protected int seqid_;
{
return this.iprot_;
}
{
return this.oprot_;
}
public Map<String,ThriftFlumeReport>
getAllReports()
throws TException
{
send_getAllReports();
return recv_getAllReports();
}
{
oprot_.writeMessageBegin(new TMessage("getAllReports", TMessageType.CALL, ++seqid_));
getAllReports_args args = new getAllReports_args();
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
}
{
TMessage msg = iprot_.readMessageBegin();
if (msg.type == TMessageType.EXCEPTION) {
TApplicationException x = TApplicationException.read(iprot_);
iprot_.readMessageEnd();
throw x;
}
if (msg.seqid != seqid_) {
throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "getAllReports failed: out of sequence response");
}
getAllReports_result result = new getAllReports_result();
result.read(iprot_);
iprot_.readMessageEnd();
if (result.isSetSuccess()) {
return result.success;
}
throw new TApplicationException(TApplicationException.MISSING_RESULT, "getAllReports failed: unknown result");
}
public ThriftFlumeReport
getReportByName(String reportName)
throws TException
{
send_getReportByName(reportName);
return recv_getReportByName();
}
{
oprot_.writeMessageBegin(new TMessage("getReportByName", TMessageType.CALL, ++seqid_));
getReportByName_args args = new getReportByName_args();
args.setReportName(reportName);
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
}
{
TMessage msg = iprot_.readMessageBegin();
if (msg.type == TMessageType.EXCEPTION) {
TApplicationException x = TApplicationException.read(iprot_);
iprot_.readMessageEnd();
throw x;
}
if (msg.seqid != seqid_) {
throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "getReportByName failed: out of sequence response");
}
getReportByName_result result = new getReportByName_result();
result.read(iprot_);
iprot_.readMessageEnd();
if (result.isSetSuccess()) {
return result.success;
}
throw new TApplicationException(TApplicationException.MISSING_RESULT, "getReportByName failed: unknown result");
}
}
public static class AsyncClient extends TAsyncClient
implements AsyncIface {
public static class Factory implements TAsyncClientFactory<AsyncClient> {
private TAsyncClientManager clientManager;
private TProtocolFactory protocolFactory;
public Factory(TAsyncClientManager clientManager, TProtocolFactory protocolFactory) {
this.clientManager = clientManager;
this.protocolFactory = protocolFactory;
}
return new AsyncClient(protocolFactory, clientManager, transport);
}
}
public AsyncClient(TProtocolFactory protocolFactory, TAsyncClientManager clientManager, TNonblockingTransport transport) {
super(protocolFactory, clientManager, transport);
}
public void getAllReports(AsyncMethodCallback<getAllReports_call> resultHandler)
throws TException {
checkReady();
getAllReports_call method_call = new getAllReports_call(resultHandler, this, protocolFactory, transport);
manager.call(method_call);
}
public getAllReports_call(AsyncMethodCallback<getAllReports_call> resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport)
throws TException {
super(client, protocolFactory, transport, resultHandler, false);
}
public void write_args(TProtocol prot)
throws TException {
prot.writeMessageBegin(new TMessage("getAllReports", TMessageType.CALL, 0));
getAllReports_args args = new getAllReports_args();
args.write(prot);
prot.writeMessageEnd();
}
public Map<String,ThriftFlumeReport>
getResult()
throws TException {
if (getState() != State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array());
TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getAllReports();
}
}
public void getReportByName(String reportName, AsyncMethodCallback<getReportByName_call> resultHandler)
throws TException {
checkReady();
getReportByName_call method_call = new getReportByName_call(reportName, resultHandler, this, protocolFactory, transport);
manager.call(method_call);
}
private String reportName;
public getReportByName_call(String reportName, AsyncMethodCallback<getReportByName_call> resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport)
throws TException {
super(client, protocolFactory, transport, resultHandler, false);
this.reportName = reportName;
}
public void write_args(TProtocol prot)
throws TException {
prot.writeMessageBegin(new TMessage("getReportByName", TMessageType.CALL, 0));
getReportByName_args args = new getReportByName_args();
args.setReportName(reportName);
args.write(prot);
prot.writeMessageEnd();
}
public ThriftFlumeReport
getResult()
throws TException {
if (getState() != State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array());
TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getReportByName();
}
}
}
public static class Processor implements TProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
{
iface_ = iface;
processMap_.put("getAllReports", new getAllReports());
processMap_.put("getReportByName", new getReportByName());
}
public void process(
int seqid, TProtocol iprot, TProtocol oprot)
throws TException;
}
private Iface iface_;
protected final HashMap<String,ProcessFunction> processMap_ = new HashMap<String,ProcessFunction>();
public boolean process(TProtocol iprot, TProtocol oprot)
throws TException
{
TMessage msg = iprot.readMessageBegin();
ProcessFunction fn = processMap_.get(msg.name);
if (fn == null) {
TProtocolUtil.skip(iprot, TType.STRUCT);
iprot.readMessageEnd();
TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'");
oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid));
x.write(oprot);
oprot.writeMessageEnd();
oprot.getTransport().flush();
return true;
}
fn.process(msg.seqid, iprot, oprot);
return true;
}
public void process(
int seqid, TProtocol iprot, TProtocol oprot)
throws TException
{
getAllReports_args args = new getAllReports_args();
try {
args.read(iprot);
} catch (TProtocolException e) {
iprot.readMessageEnd();
TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage());
oprot.writeMessageBegin(new TMessage("getAllReports", TMessageType.EXCEPTION, seqid));
x.write(oprot);
oprot.writeMessageEnd();
oprot.getTransport().flush();
return;
}
iprot.readMessageEnd();
getAllReports_result result = new getAllReports_result();
result.success = iface_.getAllReports();
oprot.writeMessageBegin(new TMessage("getAllReports", TMessageType.REPLY, seqid));
result.write(oprot);
oprot.writeMessageEnd();
oprot.getTransport().flush();
}
}
public void process(
int seqid, TProtocol iprot, TProtocol oprot)
throws TException
{
getReportByName_args args = new getReportByName_args();
try {
args.read(iprot);
} catch (TProtocolException e) {
iprot.readMessageEnd();
TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage());
oprot.writeMessageBegin(new TMessage("getReportByName", TMessageType.EXCEPTION, seqid));
x.write(oprot);
oprot.writeMessageEnd();
oprot.getTransport().flush();
return;
}
iprot.readMessageEnd();
getReportByName_result result = new getReportByName_result();
result.success = iface_.getReportByName(args.reportName);
oprot.writeMessageBegin(new TMessage("getReportByName", TMessageType.REPLY, seqid));
result.write(oprot);
oprot.writeMessageEnd();
oprot.getTransport().flush();
}
}
}
public static class getAllReports_args implements TBase<getAllReports_args, getAllReports_args._Fields>, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("getAllReports_args");
public enum _Fields implements TFieldIdEnum {
;
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
switch(fieldId) {
default:
return null;
}
}
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(
short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
return _thriftId;
}
return _fieldName;
}
}
public static final Map<_Fields, FieldMetaData> metaDataMap;
static {
Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class);
metaDataMap = Collections.unmodifiableMap(tmpMap);
FieldMetaData.addStructMetaDataMap(getAllReports_args.class, metaDataMap);
}
}
}
return new getAllReports_args(this);
}
@Deprecated
public getAllReports_args
clone() {
return new getAllReports_args(this);
}
@Override
}
switch (field) {
}
}
setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
}
switch (field) {
}
throw new IllegalStateException();
}
return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
}
public boolean isSet(_Fields field) {
switch (field) {
}
throw new IllegalStateException();
}
public boolean isSet(
int fieldID) {
return isSet(_Fields.findByThriftIdOrThrow(fieldID));
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof getAllReports_args)
return this.equals((getAllReports_args)that);
return false;
}
public boolean equals(getAllReports_args that) {
if (that == null)
return false;
return true;
}
@Override
return 0;
}
public int compareTo(getAllReports_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
getAllReports_args typedOther = (getAllReports_args)other;
return 0;
}
public void read(TProtocol iprot)
throws TException {
TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
if (field.type == TType.STOP) {
break;
}
switch (field.id) {
default:
TProtocolUtil.skip(iprot, field.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
validate();
}
public void write(TProtocol oprot)
throws TException {
validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
StringBuilder sb = new StringBuilder("getAllReports_args(");
boolean first = true;
sb.append(")");
return sb.toString();
}
public void validate()
throws TException {
}
}
public static class getAllReports_result implements TBase<getAllReports_result, getAllReports_result._Fields>, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("getAllReports_result");
private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.MAP, (short)0);
public Map<String,ThriftFlumeReport> success;
public enum _Fields implements TFieldIdEnum {
SUCCESS((short)0, "success");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
switch(fieldId) {
case 0:
return SUCCESS;
default:
return null;
}
}
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(
short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
return _thriftId;
}
return _fieldName;
}
}
public static final Map<_Fields, FieldMetaData> metaDataMap;
static {
Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT,
new MapMetaData(TType.MAP,
new FieldValueMetaData(TType.STRING),
new StructMetaData(TType.STRUCT, ThriftFlumeReport.class))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
FieldMetaData.addStructMetaDataMap(getAllReports_result.class, metaDataMap);
}
}
Map<String,ThriftFlumeReport> success)
{
this();
this.success = success;
}
if (other.isSetSuccess()) {
Map<String,ThriftFlumeReport> __this__success = new HashMap<String,ThriftFlumeReport>();
for (Map.Entry<String, ThriftFlumeReport> other_element : other.success.entrySet()) {
String other_element_key = other_element.getKey();
ThriftFlumeReport other_element_value = other_element.getValue();
String __this__success_copy_key = other_element_key;
ThriftFlumeReport __this__success_copy_value = new ThriftFlumeReport(other_element_value);
__this__success.put(__this__success_copy_key, __this__success_copy_value);
}
this.success = __this__success;
}
}
public getAllReports_result
deepCopy() {
return new getAllReports_result(this);
}
@Deprecated
public getAllReports_result
clone() {
return new getAllReports_result(this);
}
@Override
this.success = null;
}
return (this.success == null) ? 0 : this.success.size();
}
public void putToSuccess(String key, ThriftFlumeReport val) {
if (this.success == null) {
this.success = new HashMap<String,ThriftFlumeReport>();
}
this.success.put(key, val);
}
public Map<String,ThriftFlumeReport>
getSuccess() {
return this.success;
}
public getAllReports_result
setSuccess(Map<String,ThriftFlumeReport> success) {
this.success = success;
return this;
}
this.success = null;
}
return this.success != null;
}
if (!value) {
this.success = null;
}
}
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((Map<String,ThriftFlumeReport>)value);
}
break;
}
}
setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
}
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new IllegalStateException();
}
return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
}
public boolean isSet(_Fields field) {
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new IllegalStateException();
}
public boolean isSet(
int fieldID) {
return isSet(_Fields.findByThriftIdOrThrow(fieldID));
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof getAllReports_result)
return this.equals((getAllReports_result)that);
return false;
}
public boolean equals(getAllReports_result that) {
if (that == null)
return false;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
return 0;
}
public int compareTo(getAllReports_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
getAllReports_result typedOther = (getAllReports_result)other;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) { lastComparison = TBaseHelper.compareTo(this.success, typedOther.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public void read(TProtocol iprot)
throws TException {
TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
if (field.type == TType.STOP) {
break;
}
switch (field.id) {
case 0:
if (field.type == TType.MAP) {
{
TMap _map15 = iprot.readMapBegin();
this.success = new HashMap<String,ThriftFlumeReport>(2*_map15.size);
for (int _i16 = 0; _i16 < _map15.size; ++_i16)
{
String _key17;
ThriftFlumeReport _val18;
_key17 = iprot.readString();
_val18 = new ThriftFlumeReport();
_val18.read(iprot);
this.success.put(_key17, _val18);
}
iprot.readMapEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
default:
TProtocolUtil.skip(iprot, field.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
validate();
}
public void write(TProtocol oprot)
throws TException {
oprot.writeStructBegin(STRUCT_DESC);
if (this.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeMapBegin(new TMap(TType.STRING, TType.STRUCT, this.success.size()));
for (Map.Entry<String, ThriftFlumeReport> _iter19 : this.success.entrySet())
{
oprot.writeString(_iter19.getKey());
_iter19.getValue().write(oprot);
}
oprot.writeMapEnd();
}
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
StringBuilder sb = new StringBuilder("getAllReports_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate()
throws TException {
}
}
public static class getReportByName_args implements TBase<getReportByName_args, getReportByName_args._Fields>, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("getReportByName_args");
private static final TField REPORT_NAME_FIELD_DESC = new TField("reportName", TType.STRING, (short)1);
public String reportName;
public enum _Fields implements TFieldIdEnum {
REPORT_NAME((short)1, "reportName");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
switch(fieldId) {
case 1:
return REPORT_NAME;
default:
return null;
}
}
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(
short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
return _thriftId;
}
return _fieldName;
}
}
public static final Map<_Fields, FieldMetaData> metaDataMap;
static {
Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.REPORT_NAME, new FieldMetaData("reportName", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
FieldMetaData.addStructMetaDataMap(getReportByName_args.class, metaDataMap);
}
}
String reportName)
{
this();
this.reportName = reportName;
}
if (other.isSetReportName()) {
this.reportName = other.reportName;
}
}
public getReportByName_args
deepCopy() {
return new getReportByName_args(this);
}
@Deprecated
public getReportByName_args
clone() {
return new getReportByName_args(this);
}
@Override
this.reportName = null;
}
return this.reportName;
}
this.reportName = reportName;
return this;
}
this.reportName = null;
}
return this.reportName != null;
}
if (!value) {
this.reportName = null;
}
}
switch (field) {
case REPORT_NAME:
if (value == null) {
unsetReportName();
} else {
setReportName((String)value);
}
break;
}
}
setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
}
switch (field) {
case REPORT_NAME:
return getReportName();
}
throw new IllegalStateException();
}
return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
}
public boolean isSet(_Fields field) {
switch (field) {
case REPORT_NAME:
return isSetReportName();
}
throw new IllegalStateException();
}
public boolean isSet(
int fieldID) {
return isSet(_Fields.findByThriftIdOrThrow(fieldID));
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof getReportByName_args)
return this.equals((getReportByName_args)that);
return false;
}
public boolean equals(getReportByName_args that) {
if (that == null)
return false;
boolean this_present_reportName = true && this.isSetReportName();
boolean that_present_reportName = true && that.isSetReportName();
if (this_present_reportName || that_present_reportName) {
if (!(this_present_reportName && that_present_reportName))
return false;
if (!this.reportName.equals(that.reportName))
return false;
}
return true;
}
@Override
return 0;
}
public int compareTo(getReportByName_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
getReportByName_args typedOther = (getReportByName_args)other;
lastComparison = Boolean.valueOf(isSetReportName()).compareTo(typedOther.isSetReportName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetReportName()) { lastComparison = TBaseHelper.compareTo(this.reportName, typedOther.reportName);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public void read(TProtocol iprot)
throws TException {
TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
if (field.type == TType.STOP) {
break;
}
switch (field.id) {
case 1:
if (field.type == TType.STRING) {
this.reportName = iprot.readString();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
default:
TProtocolUtil.skip(iprot, field.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
validate();
}
public void write(TProtocol oprot)
throws TException {
validate();
oprot.writeStructBegin(STRUCT_DESC);
if (this.reportName != null) {
oprot.writeFieldBegin(REPORT_NAME_FIELD_DESC);
oprot.writeString(this.reportName);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
StringBuilder sb = new StringBuilder("getReportByName_args(");
boolean first = true;
sb.append("reportName:");
if (this.reportName == null) {
sb.append("null");
} else {
sb.append(this.reportName);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate()
throws TException {
}
}
public static class getReportByName_result implements TBase<getReportByName_result, getReportByName_result._Fields>, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("getReportByName_result");
private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
public ThriftFlumeReport success;
public enum _Fields implements TFieldIdEnum {
SUCCESS((short)0, "success");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
switch(fieldId) {
case 0:
return SUCCESS;
default:
return null;
}
}
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(
short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
return _thriftId;
}
return _fieldName;
}
}
public static final Map<_Fields, FieldMetaData> metaDataMap;
static {
Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT,
new StructMetaData(TType.STRUCT, ThriftFlumeReport.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
FieldMetaData.addStructMetaDataMap(getReportByName_result.class, metaDataMap);
}
}
ThriftFlumeReport success)
{
this();
this.success = success;
}
if (other.isSetSuccess()) {
this.success = new ThriftFlumeReport(other.success);
}
}
public getReportByName_result
deepCopy() {
return new getReportByName_result(this);
}
@Deprecated
public getReportByName_result
clone() {
return new getReportByName_result(this);
}
@Override
this.success = null;
}
return this.success;
}
public getReportByName_result
setSuccess(ThriftFlumeReport success) {
this.success = success;
return this;
}
this.success = null;
}
return this.success != null;
}
if (!value) {
this.success = null;
}
}
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((ThriftFlumeReport)value);
}
break;
}
}
setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
}
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new IllegalStateException();
}
return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
}
public boolean isSet(_Fields field) {
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new IllegalStateException();
}
public boolean isSet(
int fieldID) {
return isSet(_Fields.findByThriftIdOrThrow(fieldID));
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof getReportByName_result)
return this.equals((getReportByName_result)that);
return false;
}
public boolean equals(getReportByName_result that) {
if (that == null)
return false;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
return 0;
}
public int compareTo(getReportByName_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
getReportByName_result typedOther = (getReportByName_result)other;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) { lastComparison = TBaseHelper.compareTo(this.success, typedOther.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public void read(TProtocol iprot)
throws TException {
TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
if (field.type == TType.STOP) {
break;
}
switch (field.id) {
case 0:
if (field.type == TType.STRUCT) {
this.success = new ThriftFlumeReport();
this.success.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
default:
TProtocolUtil.skip(iprot, field.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
validate();
}
public void write(TProtocol oprot)
throws TException {
oprot.writeStructBegin(STRUCT_DESC);
if (this.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
this.success.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
StringBuilder sb = new StringBuilder("getReportByName_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate()
throws TException {
}
}
}