/**
* Autogenerated by Thrift
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package com.cloudera.flume.handlers.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 class ThriftFlumeEventServer {
public interface Iface {
public void append(ThriftFlumeEvent evt) throws TException;
public void rawAppend(RawEvent evt) throws TException;
public EventStatus ackedAppend(ThriftFlumeEvent evt) throws TException;
public void close() throws TException;
}
public interface AsyncIface {
public void append(ThriftFlumeEvent evt, AsyncMethodCallback<AsyncClient.append_call> resultHandler) throws TException;
public void rawAppend(RawEvent evt, AsyncMethodCallback<AsyncClient.rawAppend_call> resultHandler) throws TException;
public void ackedAppend(ThriftFlumeEvent evt, AsyncMethodCallback<AsyncClient.ackedAppend_call> resultHandler) throws TException;
public void close(AsyncMethodCallback<AsyncClient.close_call> resultHandler) throws TException;
}
public static class Client implements TServiceClient, Iface {
public static class Factory implements TServiceClientFactory<Client> {
public Factory() {}
public Client getClient(TProtocol prot) {
return new Client(prot);
}
public Client getClient(TProtocol iprot, TProtocol oprot) {
return new Client(iprot, oprot);
}
}
public Client(TProtocol prot)
{
this(prot, prot);
}
public Client(TProtocol iprot, TProtocol oprot)
{
iprot_ = iprot;
oprot_ = oprot;
}
protected TProtocol iprot_;
protected TProtocol oprot_;
protected int seqid_;
public TProtocol getInputProtocol()
{
return this.iprot_;
}
public TProtocol getOutputProtocol()
{
return this.oprot_;
}
public void append(ThriftFlumeEvent evt) throws TException
{
send_append(evt);
}
public void send_append(ThriftFlumeEvent evt) throws TException
{
oprot_.writeMessageBegin(new TMessage("append", TMessageType.CALL, ++seqid_));
append_args args = new append_args();
args.setEvt(evt);
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
}
public void rawAppend(RawEvent evt) throws TException
{
send_rawAppend(evt);
}
public void send_rawAppend(RawEvent evt) throws TException
{
oprot_.writeMessageBegin(new TMessage("rawAppend", TMessageType.CALL, ++seqid_));
rawAppend_args args = new rawAppend_args();
args.setEvt(evt);
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
}
public EventStatus ackedAppend(ThriftFlumeEvent evt) throws TException
{
send_ackedAppend(evt);
return recv_ackedAppend();
}
public void send_ackedAppend(ThriftFlumeEvent evt) throws TException
{
oprot_.writeMessageBegin(new TMessage("ackedAppend", TMessageType.CALL, ++seqid_));
ackedAppend_args args = new ackedAppend_args();
args.setEvt(evt);
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
}
public EventStatus recv_ackedAppend() throws TException
{
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, "ackedAppend failed: out of sequence response");
}
ackedAppend_result result = new ackedAppend_result();
result.read(iprot_);
iprot_.readMessageEnd();
if (result.isSetSuccess()) {
return result.success;
}
throw new TApplicationException(TApplicationException.MISSING_RESULT, "ackedAppend failed: unknown result");
}
public void close() throws TException
{
send_close();
recv_close();
}
public void send_close() throws TException
{
oprot_.writeMessageBegin(new TMessage("close", TMessageType.CALL, ++seqid_));
close_args args = new close_args();
args.write(oprot_);
oprot_.writeMessageEnd();
oprot_.getTransport().flush();
}
public void recv_close() throws TException
{
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, "close failed: out of sequence response");
}
close_result result = new close_result();
result.read(iprot_);
iprot_.readMessageEnd();
return;
}
}
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;
}
public AsyncClient getAsyncClient(TNonblockingTransport transport) {
return new AsyncClient(protocolFactory, clientManager, transport);
}
}
public AsyncClient(TProtocolFactory protocolFactory, TAsyncClientManager clientManager, TNonblockingTransport transport) {
super(protocolFactory, clientManager, transport);
}
public void append(ThriftFlumeEvent evt, AsyncMethodCallback<append_call> resultHandler) throws TException {
checkReady();
append_call method_call = new append_call(evt, resultHandler, this, protocolFactory, transport);
manager.call(method_call);
}
public static class append_call extends TAsyncMethodCall {
private ThriftFlumeEvent evt;
public append_call(ThriftFlumeEvent evt, AsyncMethodCallback<append_call> resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException {
super(client, protocolFactory, transport, resultHandler, true);
this.evt = evt;
}
public void write_args(TProtocol prot) throws TException {
prot.writeMessageBegin(new TMessage("append", TMessageType.CALL, 0));
append_args args = new append_args();
args.setEvt(evt);
args.write(prot);
prot.writeMessageEnd();
}
public void 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);
}
}
public void rawAppend(RawEvent evt, AsyncMethodCallback<rawAppend_call> resultHandler) throws TException {
checkReady();
rawAppend_call method_call = new rawAppend_call(evt, resultHandler, this, protocolFactory, transport);
manager.call(method_call);
}
public static class rawAppend_call extends TAsyncMethodCall {
private RawEvent evt;
public rawAppend_call(RawEvent evt, AsyncMethodCallback<rawAppend_call> resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException {
super(client, protocolFactory, transport, resultHandler, true);
this.evt = evt;
}
public void write_args(TProtocol prot) throws TException {
prot.writeMessageBegin(new TMessage("rawAppend", TMessageType.CALL, 0));
rawAppend_args args = new rawAppend_args();
args.setEvt(evt);
args.write(prot);
prot.writeMessageEnd();
}
public void 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);
}
}
public void ackedAppend(ThriftFlumeEvent evt, AsyncMethodCallback<ackedAppend_call> resultHandler) throws TException {
checkReady();
ackedAppend_call method_call = new ackedAppend_call(evt, resultHandler, this, protocolFactory, transport);
manager.call(method_call);
}
public static class ackedAppend_call extends TAsyncMethodCall {
private ThriftFlumeEvent evt;
public ackedAppend_call(ThriftFlumeEvent evt, AsyncMethodCallback<ackedAppend_call> resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException {
super(client, protocolFactory, transport, resultHandler, false);
this.evt = evt;
}
public void write_args(TProtocol prot) throws TException {
prot.writeMessageBegin(new TMessage("ackedAppend", TMessageType.CALL, 0));
ackedAppend_args args = new ackedAppend_args();
args.setEvt(evt);
args.write(prot);
prot.writeMessageEnd();
}
public EventStatus 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_ackedAppend();
}
}
public void close(AsyncMethodCallback<close_call> resultHandler) throws TException {
checkReady();
close_call method_call = new close_call(resultHandler, this, protocolFactory, transport);
manager.call(method_call);
}
public static class close_call extends TAsyncMethodCall {
public close_call(AsyncMethodCallback<close_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("close", TMessageType.CALL, 0));
close_args args = new close_args();
args.write(prot);
prot.writeMessageEnd();
}
public void 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);
(new Client(prot)).recv_close();
}
}
}
public static class Processor implements TProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
public Processor(Iface iface)
{
iface_ = iface;
processMap_.put("append", new append());
processMap_.put("rawAppend", new rawAppend());
processMap_.put("ackedAppend", new ackedAppend());
processMap_.put("close", new close());
}
protected static interface ProcessFunction {
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;
}
private class append implements ProcessFunction {
public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
{
append_args args = new append_args();
try {
args.read(iprot);
} catch (TProtocolException e) {
iprot.readMessageEnd();
TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage());
oprot.writeMessageBegin(new TMessage("append", TMessageType.EXCEPTION, seqid));
x.write(oprot);
oprot.writeMessageEnd();
oprot.getTransport().flush();
return;
}
iprot.readMessageEnd();
iface_.append(args.evt);
return;
}
}
private class rawAppend implements ProcessFunction {
public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
{
rawAppend_args args = new rawAppend_args();
try {
args.read(iprot);
} catch (TProtocolException e) {
iprot.readMessageEnd();
TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage());
oprot.writeMessageBegin(new TMessage("rawAppend", TMessageType.EXCEPTION, seqid));
x.write(oprot);
oprot.writeMessageEnd();
oprot.getTransport().flush();
return;
}
iprot.readMessageEnd();
iface_.rawAppend(args.evt);
return;
}
}
private class ackedAppend implements ProcessFunction {
public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
{
ackedAppend_args args = new ackedAppend_args();
try {
args.read(iprot);
} catch (TProtocolException e) {
iprot.readMessageEnd();
TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage());
oprot.writeMessageBegin(new TMessage("ackedAppend", TMessageType.EXCEPTION, seqid));
x.write(oprot);
oprot.writeMessageEnd();
oprot.getTransport().flush();
return;
}
iprot.readMessageEnd();
ackedAppend_result result = new ackedAppend_result();
result.success = iface_.ackedAppend(args.evt);
oprot.writeMessageBegin(new TMessage("ackedAppend", TMessageType.REPLY, seqid));
result.write(oprot);
oprot.writeMessageEnd();
oprot.getTransport().flush();
}
}
private class close implements ProcessFunction {
public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
{
close_args args = new close_args();
try {
args.read(iprot);
} catch (TProtocolException e) {
iprot.readMessageEnd();
TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage());
oprot.writeMessageBegin(new TMessage("close", TMessageType.EXCEPTION, seqid));
x.write(oprot);
oprot.writeMessageEnd();
oprot.getTransport().flush();
return;
}
iprot.readMessageEnd();
close_result result = new close_result();
iface_.close();
oprot.writeMessageBegin(new TMessage("close", TMessageType.REPLY, seqid));
result.write(oprot);
oprot.writeMessageEnd();
oprot.getTransport().flush();
}
}
}
public static class append_args implements TBase<append_args, append_args._Fields>, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("append_args");
private static final TField EVT_FIELD_DESC = new TField("evt", TType.STRUCT, (short)1);
public ThriftFlumeEvent evt;
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements TFieldIdEnum {
EVT((short)1, "evt");
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: // EVT
return EVT;
default:
return null;
}
}
/**
* Find the _Fields constant that matches 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, FieldMetaData> metaDataMap;
static {
Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.EVT, new FieldMetaData("evt", TFieldRequirementType.DEFAULT,
new StructMetaData(TType.STRUCT, ThriftFlumeEvent.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
FieldMetaData.addStructMetaDataMap(append_args.class, metaDataMap);
}
public append_args() {
}
public append_args(
ThriftFlumeEvent evt)
{
this();
this.evt = evt;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public append_args(append_args other) {
if (other.isSetEvt()) {
this.evt = new ThriftFlumeEvent(other.evt);
}
}
public append_args deepCopy() {
return new append_args(this);
}
@Override
public void clear() {
this.evt = null;
}
public ThriftFlumeEvent getEvt() {
return this.evt;
}
public append_args setEvt(ThriftFlumeEvent evt) {
this.evt = evt;
return this;
}
public void unsetEvt() {
this.evt = null;
}
/** Returns true if field evt is set (has been asigned a value) and false otherwise */
public boolean isSetEvt() {
return this.evt != null;
}
public void setEvtIsSet(boolean value) {
if (!value) {
this.evt = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case EVT:
if (value == null) {
unsetEvt();
} else {
setEvt((ThriftFlumeEvent)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case EVT:
return getEvt();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case EVT:
return isSetEvt();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof append_args)
return this.equals((append_args)that);
return false;
}
public boolean equals(append_args that) {
if (that == null)
return false;
boolean this_present_evt = true && this.isSetEvt();
boolean that_present_evt = true && that.isSetEvt();
if (this_present_evt || that_present_evt) {
if (!(this_present_evt && that_present_evt))
return false;
if (!this.evt.equals(that.evt))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(append_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
append_args typedOther = (append_args)other;
lastComparison = Boolean.valueOf(isSetEvt()).compareTo(typedOther.isSetEvt());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetEvt()) {
lastComparison = TBaseHelper.compareTo(this.evt, typedOther.evt);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
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: // EVT
if (field.type == TType.STRUCT) {
this.evt = new ThriftFlumeEvent();
this.evt.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
default:
TProtocolUtil.skip(iprot, field.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
validate();
}
public void write(TProtocol oprot) throws TException {
validate();
oprot.writeStructBegin(STRUCT_DESC);
if (this.evt != null) {
oprot.writeFieldBegin(EVT_FIELD_DESC);
this.evt.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("append_args(");
boolean first = true;
sb.append("evt:");
if (this.evt == null) {
sb.append("null");
} else {
sb.append(this.evt);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws TException {
// check for required fields
}
}
public static class rawAppend_args implements TBase<rawAppend_args, rawAppend_args._Fields>, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("rawAppend_args");
private static final TField EVT_FIELD_DESC = new TField("evt", TType.STRUCT, (short)1);
public RawEvent evt;
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements TFieldIdEnum {
EVT((short)1, "evt");
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: // EVT
return EVT;
default:
return null;
}
}
/**
* Find the _Fields constant that matches 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, FieldMetaData> metaDataMap;
static {
Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.EVT, new FieldMetaData("evt", TFieldRequirementType.DEFAULT,
new StructMetaData(TType.STRUCT, RawEvent.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
FieldMetaData.addStructMetaDataMap(rawAppend_args.class, metaDataMap);
}
public rawAppend_args() {
}
public rawAppend_args(
RawEvent evt)
{
this();
this.evt = evt;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public rawAppend_args(rawAppend_args other) {
if (other.isSetEvt()) {
this.evt = new RawEvent(other.evt);
}
}
public rawAppend_args deepCopy() {
return new rawAppend_args(this);
}
@Override
public void clear() {
this.evt = null;
}
public RawEvent getEvt() {
return this.evt;
}
public rawAppend_args setEvt(RawEvent evt) {
this.evt = evt;
return this;
}
public void unsetEvt() {
this.evt = null;
}
/** Returns true if field evt is set (has been asigned a value) and false otherwise */
public boolean isSetEvt() {
return this.evt != null;
}
public void setEvtIsSet(boolean value) {
if (!value) {
this.evt = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case EVT:
if (value == null) {
unsetEvt();
} else {
setEvt((RawEvent)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case EVT:
return getEvt();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case EVT:
return isSetEvt();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof rawAppend_args)
return this.equals((rawAppend_args)that);
return false;
}
public boolean equals(rawAppend_args that) {
if (that == null)
return false;
boolean this_present_evt = true && this.isSetEvt();
boolean that_present_evt = true && that.isSetEvt();
if (this_present_evt || that_present_evt) {
if (!(this_present_evt && that_present_evt))
return false;
if (!this.evt.equals(that.evt))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(rawAppend_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
rawAppend_args typedOther = (rawAppend_args)other;
lastComparison = Boolean.valueOf(isSetEvt()).compareTo(typedOther.isSetEvt());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetEvt()) {
lastComparison = TBaseHelper.compareTo(this.evt, typedOther.evt);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
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: // EVT
if (field.type == TType.STRUCT) {
this.evt = new RawEvent();
this.evt.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
default:
TProtocolUtil.skip(iprot, field.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
validate();
}
public void write(TProtocol oprot) throws TException {
validate();
oprot.writeStructBegin(STRUCT_DESC);
if (this.evt != null) {
oprot.writeFieldBegin(EVT_FIELD_DESC);
this.evt.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("rawAppend_args(");
boolean first = true;
sb.append("evt:");
if (this.evt == null) {
sb.append("null");
} else {
sb.append(this.evt);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws TException {
// check for required fields
}
}
public static class ackedAppend_args implements TBase<ackedAppend_args, ackedAppend_args._Fields>, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("ackedAppend_args");
private static final TField EVT_FIELD_DESC = new TField("evt", TType.STRUCT, (short)1);
public ThriftFlumeEvent evt;
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements TFieldIdEnum {
EVT((short)1, "evt");
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: // EVT
return EVT;
default:
return null;
}
}
/**
* Find the _Fields constant that matches 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, FieldMetaData> metaDataMap;
static {
Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.EVT, new FieldMetaData("evt", TFieldRequirementType.DEFAULT,
new StructMetaData(TType.STRUCT, ThriftFlumeEvent.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
FieldMetaData.addStructMetaDataMap(ackedAppend_args.class, metaDataMap);
}
public ackedAppend_args() {
}
public ackedAppend_args(
ThriftFlumeEvent evt)
{
this();
this.evt = evt;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public ackedAppend_args(ackedAppend_args other) {
if (other.isSetEvt()) {
this.evt = new ThriftFlumeEvent(other.evt);
}
}
public ackedAppend_args deepCopy() {
return new ackedAppend_args(this);
}
@Override
public void clear() {
this.evt = null;
}
public ThriftFlumeEvent getEvt() {
return this.evt;
}
public ackedAppend_args setEvt(ThriftFlumeEvent evt) {
this.evt = evt;
return this;
}
public void unsetEvt() {
this.evt = null;
}
/** Returns true if field evt is set (has been asigned a value) and false otherwise */
public boolean isSetEvt() {
return this.evt != null;
}
public void setEvtIsSet(boolean value) {
if (!value) {
this.evt = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case EVT:
if (value == null) {
unsetEvt();
} else {
setEvt((ThriftFlumeEvent)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case EVT:
return getEvt();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case EVT:
return isSetEvt();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof ackedAppend_args)
return this.equals((ackedAppend_args)that);
return false;
}
public boolean equals(ackedAppend_args that) {
if (that == null)
return false;
boolean this_present_evt = true && this.isSetEvt();
boolean that_present_evt = true && that.isSetEvt();
if (this_present_evt || that_present_evt) {
if (!(this_present_evt && that_present_evt))
return false;
if (!this.evt.equals(that.evt))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(ackedAppend_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
ackedAppend_args typedOther = (ackedAppend_args)other;
lastComparison = Boolean.valueOf(isSetEvt()).compareTo(typedOther.isSetEvt());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetEvt()) {
lastComparison = TBaseHelper.compareTo(this.evt, typedOther.evt);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
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: // EVT
if (field.type == TType.STRUCT) {
this.evt = new ThriftFlumeEvent();
this.evt.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
default:
TProtocolUtil.skip(iprot, field.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
validate();
}
public void write(TProtocol oprot) throws TException {
validate();
oprot.writeStructBegin(STRUCT_DESC);
if (this.evt != null) {
oprot.writeFieldBegin(EVT_FIELD_DESC);
this.evt.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("ackedAppend_args(");
boolean first = true;
sb.append("evt:");
if (this.evt == null) {
sb.append("null");
} else {
sb.append(this.evt);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws TException {
// check for required fields
}
}
public static class ackedAppend_result implements TBase<ackedAppend_result, ackedAppend_result._Fields>, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("ackedAppend_result");
private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I32, (short)0);
/**
*
* @see EventStatus
*/
public EventStatus success;
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements TFieldIdEnum {
/**
*
* @see EventStatus
*/
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);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, FieldMetaData> metaDataMap;
static {
Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT,
new EnumMetaData(TType.ENUM, EventStatus.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
FieldMetaData.addStructMetaDataMap(ackedAppend_result.class, metaDataMap);
}
public ackedAppend_result() {
}
public ackedAppend_result(
EventStatus success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public ackedAppend_result(ackedAppend_result other) {
if (other.isSetSuccess()) {
this.success = other.success;
}
}
public ackedAppend_result deepCopy() {
return new ackedAppend_result(this);
}
@Override
public void clear() {
this.success = null;
}
/**
*
* @see EventStatus
*/
public EventStatus getSuccess() {
return this.success;
}
/**
*
* @see EventStatus
*/
public ackedAppend_result setSuccess(EventStatus success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been asigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((EventStatus)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof ackedAppend_result)
return this.equals((ackedAppend_result)that);
return false;
}
public boolean equals(ackedAppend_result that) {
if (that == null)
return false;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(ackedAppend_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
ackedAppend_result typedOther = (ackedAppend_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 _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
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: // SUCCESS
if (field.type == TType.I32) {
this.success = EventStatus.findByValue(iprot.readI32());
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
default:
TProtocolUtil.skip(iprot, field.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
validate();
}
public void write(TProtocol oprot) throws TException {
oprot.writeStructBegin(STRUCT_DESC);
if (this.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeI32(this.success.getValue());
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("ackedAppend_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 {
// check for required fields
}
}
public static class close_args implements TBase<close_args, close_args._Fields>, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("close_args");
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
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);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
public static final Map<_Fields, FieldMetaData> metaDataMap;
static {
Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class);
metaDataMap = Collections.unmodifiableMap(tmpMap);
FieldMetaData.addStructMetaDataMap(close_args.class, metaDataMap);
}
public close_args() {
}
/**
* Performs a deep copy on <i>other</i>.
*/
public close_args(close_args other) {
}
public close_args deepCopy() {
return new close_args(this);
}
@Override
public void clear() {
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof close_args)
return this.equals((close_args)that);
return false;
}
public boolean equals(close_args that) {
if (that == null)
return false;
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(close_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
close_args typedOther = (close_args)other;
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
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();
// check for required fields of primitive type, which can't be checked in the validate method
validate();
}
public void write(TProtocol oprot) throws TException {
validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("close_args(");
boolean first = true;
sb.append(")");
return sb.toString();
}
public void validate() throws TException {
// check for required fields
}
}
public static class close_result implements TBase<close_result, close_result._Fields>, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("close_result");
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
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);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
public static final Map<_Fields, FieldMetaData> metaDataMap;
static {
Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class);
metaDataMap = Collections.unmodifiableMap(tmpMap);
FieldMetaData.addStructMetaDataMap(close_result.class, metaDataMap);
}
public close_result() {
}
/**
* Performs a deep copy on <i>other</i>.
*/
public close_result(close_result other) {
}
public close_result deepCopy() {
return new close_result(this);
}
@Override
public void clear() {
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof close_result)
return this.equals((close_result)that);
return false;
}
public boolean equals(close_result that) {
if (that == null)
return false;
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(close_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
close_result typedOther = (close_result)other;
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
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();
// check for required fields of primitive type, which can't be checked in the validate method
validate();
}
public void write(TProtocol oprot) throws TException {
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("close_result(");
boolean first = true;
sb.append(")");
return sb.toString();
}
public void validate() throws TException {
// check for required fields
}
}
}