/**
* Autogenerated by Thrift Compiler (0.7.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.hadoop.thriftdatanode.api;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ThriftHadoopDatanode {
public interface Iface {
public ThdfsBlock recoverBlock(TDatanodeID datanode, ThdfsNamespaceId namespaceId, ThdfsBlock block, boolean keepLength, List<TDatanodeID> targets, long deadline) throws ThriftIOException, org.apache.thrift.TException;
public ThdfsBlock getBlockInfo(TDatanodeID datanode, ThdfsNamespaceId namespaceid, ThdfsBlock block) throws ThriftIOException, org.apache.thrift.TException;
public void copyBlock(TDatanodeID datanode, ThdfsNamespaceId srcNamespaceId, ThdfsBlock srcblock, ThdfsNamespaceId dstNamespaceId, ThdfsBlock destBlock, TDatanodeID target, boolean asynchronous) throws ThriftIOException, org.apache.thrift.TException;
public ThdfsBlockPath getBlockPathInfo(TDatanodeID datanode, ThdfsNamespaceId namespaceId, ThdfsBlock block) throws ThriftIOException, org.apache.thrift.TException;
}
public interface AsyncIface {
public void recoverBlock(TDatanodeID datanode, ThdfsNamespaceId namespaceId, ThdfsBlock block, boolean keepLength, List<TDatanodeID> targets, long deadline, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.recoverBlock_call> resultHandler) throws org.apache.thrift.TException;
public void getBlockInfo(TDatanodeID datanode, ThdfsNamespaceId namespaceid, ThdfsBlock block, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getBlockInfo_call> resultHandler) throws org.apache.thrift.TException;
public void copyBlock(TDatanodeID datanode, ThdfsNamespaceId srcNamespaceId, ThdfsBlock srcblock, ThdfsNamespaceId dstNamespaceId, ThdfsBlock destBlock, TDatanodeID target, boolean asynchronous, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.copyBlock_call> resultHandler) throws org.apache.thrift.TException;
public void getBlockPathInfo(TDatanodeID datanode, ThdfsNamespaceId namespaceId, ThdfsBlock block, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getBlockPathInfo_call> resultHandler) throws org.apache.thrift.TException;
}
public static class Client extends org.apache.thrift.TServiceClient implements Iface {
public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
public Factory() {}
public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
return new Client(prot);
}
public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
return new Client(iprot, oprot);
}
}
public Client(org.apache.thrift.protocol.TProtocol prot)
{
super(prot, prot);
}
public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
super(iprot, oprot);
}
public ThdfsBlock recoverBlock(TDatanodeID datanode, ThdfsNamespaceId namespaceId, ThdfsBlock block, boolean keepLength, List<TDatanodeID> targets, long deadline) throws ThriftIOException, org.apache.thrift.TException
{
send_recoverBlock(datanode, namespaceId, block, keepLength, targets, deadline);
return recv_recoverBlock();
}
public void send_recoverBlock(TDatanodeID datanode, ThdfsNamespaceId namespaceId, ThdfsBlock block, boolean keepLength, List<TDatanodeID> targets, long deadline) throws org.apache.thrift.TException
{
recoverBlock_args args = new recoverBlock_args();
args.setDatanode(datanode);
args.setNamespaceId(namespaceId);
args.setBlock(block);
args.setKeepLength(keepLength);
args.setTargets(targets);
args.setDeadline(deadline);
sendBase("recoverBlock", args);
}
public ThdfsBlock recv_recoverBlock() throws ThriftIOException, org.apache.thrift.TException
{
recoverBlock_result result = new recoverBlock_result();
receiveBase(result, "recoverBlock");
if (result.isSetSuccess()) {
return result.success;
}
if (result.ouch != null) {
throw result.ouch;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "recoverBlock failed: unknown result");
}
public ThdfsBlock getBlockInfo(TDatanodeID datanode, ThdfsNamespaceId namespaceid, ThdfsBlock block) throws ThriftIOException, org.apache.thrift.TException
{
send_getBlockInfo(datanode, namespaceid, block);
return recv_getBlockInfo();
}
public void send_getBlockInfo(TDatanodeID datanode, ThdfsNamespaceId namespaceid, ThdfsBlock block) throws org.apache.thrift.TException
{
getBlockInfo_args args = new getBlockInfo_args();
args.setDatanode(datanode);
args.setNamespaceid(namespaceid);
args.setBlock(block);
sendBase("getBlockInfo", args);
}
public ThdfsBlock recv_getBlockInfo() throws ThriftIOException, org.apache.thrift.TException
{
getBlockInfo_result result = new getBlockInfo_result();
receiveBase(result, "getBlockInfo");
if (result.isSetSuccess()) {
return result.success;
}
if (result.ouch != null) {
throw result.ouch;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getBlockInfo failed: unknown result");
}
public void copyBlock(TDatanodeID datanode, ThdfsNamespaceId srcNamespaceId, ThdfsBlock srcblock, ThdfsNamespaceId dstNamespaceId, ThdfsBlock destBlock, TDatanodeID target, boolean asynchronous) throws ThriftIOException, org.apache.thrift.TException
{
send_copyBlock(datanode, srcNamespaceId, srcblock, dstNamespaceId, destBlock, target, asynchronous);
recv_copyBlock();
}
public void send_copyBlock(TDatanodeID datanode, ThdfsNamespaceId srcNamespaceId, ThdfsBlock srcblock, ThdfsNamespaceId dstNamespaceId, ThdfsBlock destBlock, TDatanodeID target, boolean asynchronous) throws org.apache.thrift.TException
{
copyBlock_args args = new copyBlock_args();
args.setDatanode(datanode);
args.setSrcNamespaceId(srcNamespaceId);
args.setSrcblock(srcblock);
args.setDstNamespaceId(dstNamespaceId);
args.setDestBlock(destBlock);
args.setTarget(target);
args.setAsynchronous(asynchronous);
sendBase("copyBlock", args);
}
public void recv_copyBlock() throws ThriftIOException, org.apache.thrift.TException
{
copyBlock_result result = new copyBlock_result();
receiveBase(result, "copyBlock");
if (result.ouch != null) {
throw result.ouch;
}
return;
}
public ThdfsBlockPath getBlockPathInfo(TDatanodeID datanode, ThdfsNamespaceId namespaceId, ThdfsBlock block) throws ThriftIOException, org.apache.thrift.TException
{
send_getBlockPathInfo(datanode, namespaceId, block);
return recv_getBlockPathInfo();
}
public void send_getBlockPathInfo(TDatanodeID datanode, ThdfsNamespaceId namespaceId, ThdfsBlock block) throws org.apache.thrift.TException
{
getBlockPathInfo_args args = new getBlockPathInfo_args();
args.setDatanode(datanode);
args.setNamespaceId(namespaceId);
args.setBlock(block);
sendBase("getBlockPathInfo", args);
}
public ThdfsBlockPath recv_getBlockPathInfo() throws ThriftIOException, org.apache.thrift.TException
{
getBlockPathInfo_result result = new getBlockPathInfo_result();
receiveBase(result, "getBlockPathInfo");
if (result.isSetSuccess()) {
return result.success;
}
if (result.ouch != null) {
throw result.ouch;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getBlockPathInfo failed: unknown result");
}
}
public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
private org.apache.thrift.async.TAsyncClientManager clientManager;
private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
this.clientManager = clientManager;
this.protocolFactory = protocolFactory;
}
public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
return new AsyncClient(protocolFactory, clientManager, transport);
}
}
public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
super(protocolFactory, clientManager, transport);
}
public void recoverBlock(TDatanodeID datanode, ThdfsNamespaceId namespaceId, ThdfsBlock block, boolean keepLength, List<TDatanodeID> targets, long deadline, org.apache.thrift.async.AsyncMethodCallback<recoverBlock_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
recoverBlock_call method_call = new recoverBlock_call(datanode, namespaceId, block, keepLength, targets, deadline, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class recoverBlock_call extends org.apache.thrift.async.TAsyncMethodCall {
private TDatanodeID datanode;
private ThdfsNamespaceId namespaceId;
private ThdfsBlock block;
private boolean keepLength;
private List<TDatanodeID> targets;
private long deadline;
public recoverBlock_call(TDatanodeID datanode, ThdfsNamespaceId namespaceId, ThdfsBlock block, boolean keepLength, List<TDatanodeID> targets, long deadline, org.apache.thrift.async.AsyncMethodCallback<recoverBlock_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.datanode = datanode;
this.namespaceId = namespaceId;
this.block = block;
this.keepLength = keepLength;
this.targets = targets;
this.deadline = deadline;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("recoverBlock", org.apache.thrift.protocol.TMessageType.CALL, 0));
recoverBlock_args args = new recoverBlock_args();
args.setDatanode(datanode);
args.setNamespaceId(namespaceId);
args.setBlock(block);
args.setKeepLength(keepLength);
args.setTargets(targets);
args.setDeadline(deadline);
args.write(prot);
prot.writeMessageEnd();
}
public ThdfsBlock getResult() throws ThriftIOException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_recoverBlock();
}
}
public void getBlockInfo(TDatanodeID datanode, ThdfsNamespaceId namespaceid, ThdfsBlock block, org.apache.thrift.async.AsyncMethodCallback<getBlockInfo_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
getBlockInfo_call method_call = new getBlockInfo_call(datanode, namespaceid, block, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getBlockInfo_call extends org.apache.thrift.async.TAsyncMethodCall {
private TDatanodeID datanode;
private ThdfsNamespaceId namespaceid;
private ThdfsBlock block;
public getBlockInfo_call(TDatanodeID datanode, ThdfsNamespaceId namespaceid, ThdfsBlock block, org.apache.thrift.async.AsyncMethodCallback<getBlockInfo_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.datanode = datanode;
this.namespaceid = namespaceid;
this.block = block;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getBlockInfo", org.apache.thrift.protocol.TMessageType.CALL, 0));
getBlockInfo_args args = new getBlockInfo_args();
args.setDatanode(datanode);
args.setNamespaceid(namespaceid);
args.setBlock(block);
args.write(prot);
prot.writeMessageEnd();
}
public ThdfsBlock getResult() throws ThriftIOException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getBlockInfo();
}
}
public void copyBlock(TDatanodeID datanode, ThdfsNamespaceId srcNamespaceId, ThdfsBlock srcblock, ThdfsNamespaceId dstNamespaceId, ThdfsBlock destBlock, TDatanodeID target, boolean asynchronous, org.apache.thrift.async.AsyncMethodCallback<copyBlock_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
copyBlock_call method_call = new copyBlock_call(datanode, srcNamespaceId, srcblock, dstNamespaceId, destBlock, target, asynchronous, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class copyBlock_call extends org.apache.thrift.async.TAsyncMethodCall {
private TDatanodeID datanode;
private ThdfsNamespaceId srcNamespaceId;
private ThdfsBlock srcblock;
private ThdfsNamespaceId dstNamespaceId;
private ThdfsBlock destBlock;
private TDatanodeID target;
private boolean asynchronous;
public copyBlock_call(TDatanodeID datanode, ThdfsNamespaceId srcNamespaceId, ThdfsBlock srcblock, ThdfsNamespaceId dstNamespaceId, ThdfsBlock destBlock, TDatanodeID target, boolean asynchronous, org.apache.thrift.async.AsyncMethodCallback<copyBlock_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.datanode = datanode;
this.srcNamespaceId = srcNamespaceId;
this.srcblock = srcblock;
this.dstNamespaceId = dstNamespaceId;
this.destBlock = destBlock;
this.target = target;
this.asynchronous = asynchronous;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("copyBlock", org.apache.thrift.protocol.TMessageType.CALL, 0));
copyBlock_args args = new copyBlock_args();
args.setDatanode(datanode);
args.setSrcNamespaceId(srcNamespaceId);
args.setSrcblock(srcblock);
args.setDstNamespaceId(dstNamespaceId);
args.setDestBlock(destBlock);
args.setTarget(target);
args.setAsynchronous(asynchronous);
args.write(prot);
prot.writeMessageEnd();
}
public void getResult() throws ThriftIOException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
(new Client(prot)).recv_copyBlock();
}
}
public void getBlockPathInfo(TDatanodeID datanode, ThdfsNamespaceId namespaceId, ThdfsBlock block, org.apache.thrift.async.AsyncMethodCallback<getBlockPathInfo_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
getBlockPathInfo_call method_call = new getBlockPathInfo_call(datanode, namespaceId, block, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getBlockPathInfo_call extends org.apache.thrift.async.TAsyncMethodCall {
private TDatanodeID datanode;
private ThdfsNamespaceId namespaceId;
private ThdfsBlock block;
public getBlockPathInfo_call(TDatanodeID datanode, ThdfsNamespaceId namespaceId, ThdfsBlock block, org.apache.thrift.async.AsyncMethodCallback<getBlockPathInfo_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.datanode = datanode;
this.namespaceId = namespaceId;
this.block = block;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getBlockPathInfo", org.apache.thrift.protocol.TMessageType.CALL, 0));
getBlockPathInfo_args args = new getBlockPathInfo_args();
args.setDatanode(datanode);
args.setNamespaceId(namespaceId);
args.setBlock(block);
args.write(prot);
prot.writeMessageEnd();
}
public ThdfsBlockPath getResult() throws ThriftIOException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getBlockPathInfo();
}
}
}
public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
public Processor(I iface) {
super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
}
protected Processor(I iface, Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
super(iface, getProcessMap(processMap));
}
private static <I extends Iface> Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
processMap.put("recoverBlock", new recoverBlock());
processMap.put("getBlockInfo", new getBlockInfo());
processMap.put("copyBlock", new copyBlock());
processMap.put("getBlockPathInfo", new getBlockPathInfo());
return processMap;
}
private static class recoverBlock<I extends Iface> extends org.apache.thrift.ProcessFunction<I, recoverBlock_args> {
public recoverBlock() {
super("recoverBlock");
}
protected recoverBlock_args getEmptyArgsInstance() {
return new recoverBlock_args();
}
protected recoverBlock_result getResult(I iface, recoverBlock_args args) throws org.apache.thrift.TException {
recoverBlock_result result = new recoverBlock_result();
try {
result.success = iface.recoverBlock(args.datanode, args.namespaceId, args.block, args.keepLength, args.targets, args.deadline);
} catch (ThriftIOException ouch) {
result.ouch = ouch;
}
return result;
}
}
private static class getBlockInfo<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getBlockInfo_args> {
public getBlockInfo() {
super("getBlockInfo");
}
protected getBlockInfo_args getEmptyArgsInstance() {
return new getBlockInfo_args();
}
protected getBlockInfo_result getResult(I iface, getBlockInfo_args args) throws org.apache.thrift.TException {
getBlockInfo_result result = new getBlockInfo_result();
try {
result.success = iface.getBlockInfo(args.datanode, args.namespaceid, args.block);
} catch (ThriftIOException ouch) {
result.ouch = ouch;
}
return result;
}
}
private static class copyBlock<I extends Iface> extends org.apache.thrift.ProcessFunction<I, copyBlock_args> {
public copyBlock() {
super("copyBlock");
}
protected copyBlock_args getEmptyArgsInstance() {
return new copyBlock_args();
}
protected copyBlock_result getResult(I iface, copyBlock_args args) throws org.apache.thrift.TException {
copyBlock_result result = new copyBlock_result();
try {
iface.copyBlock(args.datanode, args.srcNamespaceId, args.srcblock, args.dstNamespaceId, args.destBlock, args.target, args.asynchronous);
} catch (ThriftIOException ouch) {
result.ouch = ouch;
}
return result;
}
}
private static class getBlockPathInfo<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getBlockPathInfo_args> {
public getBlockPathInfo() {
super("getBlockPathInfo");
}
protected getBlockPathInfo_args getEmptyArgsInstance() {
return new getBlockPathInfo_args();
}
protected getBlockPathInfo_result getResult(I iface, getBlockPathInfo_args args) throws org.apache.thrift.TException {
getBlockPathInfo_result result = new getBlockPathInfo_result();
try {
result.success = iface.getBlockPathInfo(args.datanode, args.namespaceId, args.block);
} catch (ThriftIOException ouch) {
result.ouch = ouch;
}
return result;
}
}
}
public static class recoverBlock_args implements org.apache.thrift.TBase<recoverBlock_args, recoverBlock_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("recoverBlock_args");
private static final org.apache.thrift.protocol.TField DATANODE_FIELD_DESC = new org.apache.thrift.protocol.TField("datanode", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField NAMESPACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("namespaceId", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final org.apache.thrift.protocol.TField BLOCK_FIELD_DESC = new org.apache.thrift.protocol.TField("block", org.apache.thrift.protocol.TType.STRUCT, (short)3);
private static final org.apache.thrift.protocol.TField KEEP_LENGTH_FIELD_DESC = new org.apache.thrift.protocol.TField("keepLength", org.apache.thrift.protocol.TType.BOOL, (short)4);
private static final org.apache.thrift.protocol.TField TARGETS_FIELD_DESC = new org.apache.thrift.protocol.TField("targets", org.apache.thrift.protocol.TType.LIST, (short)5);
private static final org.apache.thrift.protocol.TField DEADLINE_FIELD_DESC = new org.apache.thrift.protocol.TField("deadline", org.apache.thrift.protocol.TType.I64, (short)6);
public TDatanodeID datanode; // required
public ThdfsNamespaceId namespaceId; // required
public ThdfsBlock block; // required
public boolean keepLength; // required
public List<TDatanodeID> targets; // required
public long deadline; // 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 {
DATANODE((short)1, "datanode"),
NAMESPACE_ID((short)2, "namespaceId"),
BLOCK((short)3, "block"),
KEEP_LENGTH((short)4, "keepLength"),
TARGETS((short)5, "targets"),
DEADLINE((short)6, "deadline");
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: // DATANODE
return DATANODE;
case 2: // NAMESPACE_ID
return NAMESPACE_ID;
case 3: // BLOCK
return BLOCK;
case 4: // KEEP_LENGTH
return KEEP_LENGTH;
case 5: // TARGETS
return TARGETS;
case 6: // DEADLINE
return DEADLINE;
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 __KEEPLENGTH_ISSET_ID = 0;
private static final int __DEADLINE_ISSET_ID = 1;
private BitSet __isset_bit_vector = new BitSet(2);
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.DATANODE, new org.apache.thrift.meta_data.FieldMetaData("datanode", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDatanodeID.class)));
tmpMap.put(_Fields.NAMESPACE_ID, new org.apache.thrift.meta_data.FieldMetaData("namespaceId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ThdfsNamespaceId.class)));
tmpMap.put(_Fields.BLOCK, new org.apache.thrift.meta_data.FieldMetaData("block", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ThdfsBlock.class)));
tmpMap.put(_Fields.KEEP_LENGTH, new org.apache.thrift.meta_data.FieldMetaData("keepLength", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
tmpMap.put(_Fields.TARGETS, new org.apache.thrift.meta_data.FieldMetaData("targets", org.apache.thrift.TFieldRequirementType.DEFAULT,
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, TDatanodeID.class))));
tmpMap.put(_Fields.DEADLINE, new org.apache.thrift.meta_data.FieldMetaData("deadline", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(recoverBlock_args.class, metaDataMap);
}
public recoverBlock_args() {
}
public recoverBlock_args(
TDatanodeID datanode,
ThdfsNamespaceId namespaceId,
ThdfsBlock block,
boolean keepLength,
List<TDatanodeID> targets,
long deadline)
{
this();
this.datanode = datanode;
this.namespaceId = namespaceId;
this.block = block;
this.keepLength = keepLength;
setKeepLengthIsSet(true);
this.targets = targets;
this.deadline = deadline;
setDeadlineIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public recoverBlock_args(recoverBlock_args other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
if (other.isSetDatanode()) {
this.datanode = new TDatanodeID(other.datanode);
}
if (other.isSetNamespaceId()) {
this.namespaceId = new ThdfsNamespaceId(other.namespaceId);
}
if (other.isSetBlock()) {
this.block = new ThdfsBlock(other.block);
}
this.keepLength = other.keepLength;
if (other.isSetTargets()) {
List<TDatanodeID> __this__targets = new ArrayList<TDatanodeID>();
for (TDatanodeID other_element : other.targets) {
__this__targets.add(new TDatanodeID(other_element));
}
this.targets = __this__targets;
}
this.deadline = other.deadline;
}
public recoverBlock_args deepCopy() {
return new recoverBlock_args(this);
}
@Override
public void clear() {
this.datanode = null;
this.namespaceId = null;
this.block = null;
setKeepLengthIsSet(false);
this.keepLength = false;
this.targets = null;
setDeadlineIsSet(false);
this.deadline = 0;
}
public TDatanodeID getDatanode() {
return this.datanode;
}
public recoverBlock_args setDatanode(TDatanodeID datanode) {
this.datanode = datanode;
return this;
}
public void unsetDatanode() {
this.datanode = null;
}
/** Returns true if field datanode is set (has been assigned a value) and false otherwise */
public boolean isSetDatanode() {
return this.datanode != null;
}
public void setDatanodeIsSet(boolean value) {
if (!value) {
this.datanode = null;
}
}
public ThdfsNamespaceId getNamespaceId() {
return this.namespaceId;
}
public recoverBlock_args setNamespaceId(ThdfsNamespaceId namespaceId) {
this.namespaceId = namespaceId;
return this;
}
public void unsetNamespaceId() {
this.namespaceId = null;
}
/** Returns true if field namespaceId is set (has been assigned a value) and false otherwise */
public boolean isSetNamespaceId() {
return this.namespaceId != null;
}
public void setNamespaceIdIsSet(boolean value) {
if (!value) {
this.namespaceId = null;
}
}
public ThdfsBlock getBlock() {
return this.block;
}
public recoverBlock_args setBlock(ThdfsBlock block) {
this.block = block;
return this;
}
public void unsetBlock() {
this.block = null;
}
/** Returns true if field block is set (has been assigned a value) and false otherwise */
public boolean isSetBlock() {
return this.block != null;
}
public void setBlockIsSet(boolean value) {
if (!value) {
this.block = null;
}
}
public boolean isKeepLength() {
return this.keepLength;
}
public recoverBlock_args setKeepLength(boolean keepLength) {
this.keepLength = keepLength;
setKeepLengthIsSet(true);
return this;
}
public void unsetKeepLength() {
__isset_bit_vector.clear(__KEEPLENGTH_ISSET_ID);
}
/** Returns true if field keepLength is set (has been assigned a value) and false otherwise */
public boolean isSetKeepLength() {
return __isset_bit_vector.get(__KEEPLENGTH_ISSET_ID);
}
public void setKeepLengthIsSet(boolean value) {
__isset_bit_vector.set(__KEEPLENGTH_ISSET_ID, value);
}
public int getTargetsSize() {
return (this.targets == null) ? 0 : this.targets.size();
}
public java.util.Iterator<TDatanodeID> getTargetsIterator() {
return (this.targets == null) ? null : this.targets.iterator();
}
public void addToTargets(TDatanodeID elem) {
if (this.targets == null) {
this.targets = new ArrayList<TDatanodeID>();
}
this.targets.add(elem);
}
public List<TDatanodeID> getTargets() {
return this.targets;
}
public recoverBlock_args setTargets(List<TDatanodeID> targets) {
this.targets = targets;
return this;
}
public void unsetTargets() {
this.targets = null;
}
/** Returns true if field targets is set (has been assigned a value) and false otherwise */
public boolean isSetTargets() {
return this.targets != null;
}
public void setTargetsIsSet(boolean value) {
if (!value) {
this.targets = null;
}
}
public long getDeadline() {
return this.deadline;
}
public recoverBlock_args setDeadline(long deadline) {
this.deadline = deadline;
setDeadlineIsSet(true);
return this;
}
public void unsetDeadline() {
__isset_bit_vector.clear(__DEADLINE_ISSET_ID);
}
/** Returns true if field deadline is set (has been assigned a value) and false otherwise */
public boolean isSetDeadline() {
return __isset_bit_vector.get(__DEADLINE_ISSET_ID);
}
public void setDeadlineIsSet(boolean value) {
__isset_bit_vector.set(__DEADLINE_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case DATANODE:
if (value == null) {
unsetDatanode();
} else {
setDatanode((TDatanodeID)value);
}
break;
case NAMESPACE_ID:
if (value == null) {
unsetNamespaceId();
} else {
setNamespaceId((ThdfsNamespaceId)value);
}
break;
case BLOCK:
if (value == null) {
unsetBlock();
} else {
setBlock((ThdfsBlock)value);
}
break;
case KEEP_LENGTH:
if (value == null) {
unsetKeepLength();
} else {
setKeepLength((Boolean)value);
}
break;
case TARGETS:
if (value == null) {
unsetTargets();
} else {
setTargets((List<TDatanodeID>)value);
}
break;
case DEADLINE:
if (value == null) {
unsetDeadline();
} else {
setDeadline((Long)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case DATANODE:
return getDatanode();
case NAMESPACE_ID:
return getNamespaceId();
case BLOCK:
return getBlock();
case KEEP_LENGTH:
return Boolean.valueOf(isKeepLength());
case TARGETS:
return getTargets();
case DEADLINE:
return Long.valueOf(getDeadline());
}
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 DATANODE:
return isSetDatanode();
case NAMESPACE_ID:
return isSetNamespaceId();
case BLOCK:
return isSetBlock();
case KEEP_LENGTH:
return isSetKeepLength();
case TARGETS:
return isSetTargets();
case DEADLINE:
return isSetDeadline();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof recoverBlock_args)
return this.equals((recoverBlock_args)that);
return false;
}
public boolean equals(recoverBlock_args that) {
if (that == null)
return false;
boolean this_present_datanode = true && this.isSetDatanode();
boolean that_present_datanode = true && that.isSetDatanode();
if (this_present_datanode || that_present_datanode) {
if (!(this_present_datanode && that_present_datanode))
return false;
if (!this.datanode.equals(that.datanode))
return false;
}
boolean this_present_namespaceId = true && this.isSetNamespaceId();
boolean that_present_namespaceId = true && that.isSetNamespaceId();
if (this_present_namespaceId || that_present_namespaceId) {
if (!(this_present_namespaceId && that_present_namespaceId))
return false;
if (!this.namespaceId.equals(that.namespaceId))
return false;
}
boolean this_present_block = true && this.isSetBlock();
boolean that_present_block = true && that.isSetBlock();
if (this_present_block || that_present_block) {
if (!(this_present_block && that_present_block))
return false;
if (!this.block.equals(that.block))
return false;
}
boolean this_present_keepLength = true;
boolean that_present_keepLength = true;
if (this_present_keepLength || that_present_keepLength) {
if (!(this_present_keepLength && that_present_keepLength))
return false;
if (this.keepLength != that.keepLength)
return false;
}
boolean this_present_targets = true && this.isSetTargets();
boolean that_present_targets = true && that.isSetTargets();
if (this_present_targets || that_present_targets) {
if (!(this_present_targets && that_present_targets))
return false;
if (!this.targets.equals(that.targets))
return false;
}
boolean this_present_deadline = true;
boolean that_present_deadline = true;
if (this_present_deadline || that_present_deadline) {
if (!(this_present_deadline && that_present_deadline))
return false;
if (this.deadline != that.deadline)
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(recoverBlock_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
recoverBlock_args typedOther = (recoverBlock_args)other;
lastComparison = Boolean.valueOf(isSetDatanode()).compareTo(typedOther.isSetDatanode());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDatanode()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.datanode, typedOther.datanode);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetNamespaceId()).compareTo(typedOther.isSetNamespaceId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetNamespaceId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.namespaceId, typedOther.namespaceId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetBlock()).compareTo(typedOther.isSetBlock());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetBlock()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.block, typedOther.block);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetKeepLength()).compareTo(typedOther.isSetKeepLength());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetKeepLength()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keepLength, typedOther.keepLength);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetTargets()).compareTo(typedOther.isSetTargets());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTargets()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.targets, typedOther.targets);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetDeadline()).compareTo(typedOther.isSetDeadline());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDeadline()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.deadline, typedOther.deadline);
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 {
org.apache.thrift.protocol.TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
if (field.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (field.id) {
case 1: // DATANODE
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.datanode = new TDatanodeID();
this.datanode.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 2: // NAMESPACE_ID
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.namespaceId = new ThdfsNamespaceId();
this.namespaceId.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 3: // BLOCK
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.block = new ThdfsBlock();
this.block.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 4: // KEEP_LENGTH
if (field.type == org.apache.thrift.protocol.TType.BOOL) {
this.keepLength = iprot.readBool();
setKeepLengthIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 5: // TARGETS
if (field.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
this.targets = new ArrayList<TDatanodeID>(_list0.size);
for (int _i1 = 0; _i1 < _list0.size; ++_i1)
{
TDatanodeID _elem2; // required
_elem2 = new TDatanodeID();
_elem2.read(iprot);
this.targets.add(_elem2);
}
iprot.readListEnd();
}
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 6: // DEADLINE
if (field.type == org.apache.thrift.protocol.TType.I64) {
this.deadline = iprot.readI64();
setDeadlineIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
default:
org.apache.thrift.protocol.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(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
validate();
oprot.writeStructBegin(STRUCT_DESC);
if (this.datanode != null) {
oprot.writeFieldBegin(DATANODE_FIELD_DESC);
this.datanode.write(oprot);
oprot.writeFieldEnd();
}
if (this.namespaceId != null) {
oprot.writeFieldBegin(NAMESPACE_ID_FIELD_DESC);
this.namespaceId.write(oprot);
oprot.writeFieldEnd();
}
if (this.block != null) {
oprot.writeFieldBegin(BLOCK_FIELD_DESC);
this.block.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(KEEP_LENGTH_FIELD_DESC);
oprot.writeBool(this.keepLength);
oprot.writeFieldEnd();
if (this.targets != null) {
oprot.writeFieldBegin(TARGETS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.targets.size()));
for (TDatanodeID _iter3 : this.targets)
{
_iter3.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(DEADLINE_FIELD_DESC);
oprot.writeI64(this.deadline);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("recoverBlock_args(");
boolean first = true;
sb.append("datanode:");
if (this.datanode == null) {
sb.append("null");
} else {
sb.append(this.datanode);
}
first = false;
if (!first) sb.append(", ");
sb.append("namespaceId:");
if (this.namespaceId == null) {
sb.append("null");
} else {
sb.append(this.namespaceId);
}
first = false;
if (!first) sb.append(", ");
sb.append("block:");
if (this.block == null) {
sb.append("null");
} else {
sb.append(this.block);
}
first = false;
if (!first) sb.append(", ");
sb.append("keepLength:");
sb.append(this.keepLength);
first = false;
if (!first) sb.append(", ");
sb.append("targets:");
if (this.targets == null) {
sb.append("null");
} else {
sb.append(this.targets);
}
first = false;
if (!first) sb.append(", ");
sb.append("deadline:");
sb.append(this.deadline);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
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_bit_vector = new BitSet(1);
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);
}
}
}
public static class recoverBlock_result implements org.apache.thrift.TBase<recoverBlock_result, recoverBlock_result._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("recoverBlock_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final org.apache.thrift.protocol.TField OUCH_FIELD_DESC = new org.apache.thrift.protocol.TField("ouch", org.apache.thrift.protocol.TType.STRUCT, (short)1);
public ThdfsBlock success; // required
public ThriftIOException ouch; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
OUCH((short)1, "ouch");
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;
case 1: // OUCH
return OUCH;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ThdfsBlock.class)));
tmpMap.put(_Fields.OUCH, new org.apache.thrift.meta_data.FieldMetaData("ouch", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(recoverBlock_result.class, metaDataMap);
}
public recoverBlock_result() {
}
public recoverBlock_result(
ThdfsBlock success,
ThriftIOException ouch)
{
this();
this.success = success;
this.ouch = ouch;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public recoverBlock_result(recoverBlock_result other) {
if (other.isSetSuccess()) {
this.success = new ThdfsBlock(other.success);
}
if (other.isSetOuch()) {
this.ouch = new ThriftIOException(other.ouch);
}
}
public recoverBlock_result deepCopy() {
return new recoverBlock_result(this);
}
@Override
public void clear() {
this.success = null;
this.ouch = null;
}
public ThdfsBlock getSuccess() {
return this.success;
}
public recoverBlock_result setSuccess(ThdfsBlock success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public ThriftIOException getOuch() {
return this.ouch;
}
public recoverBlock_result setOuch(ThriftIOException ouch) {
this.ouch = ouch;
return this;
}
public void unsetOuch() {
this.ouch = null;
}
/** Returns true if field ouch is set (has been assigned a value) and false otherwise */
public boolean isSetOuch() {
return this.ouch != null;
}
public void setOuchIsSet(boolean value) {
if (!value) {
this.ouch = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((ThdfsBlock)value);
}
break;
case OUCH:
if (value == null) {
unsetOuch();
} else {
setOuch((ThriftIOException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case OUCH:
return getOuch();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
case OUCH:
return isSetOuch();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof recoverBlock_result)
return this.equals((recoverBlock_result)that);
return false;
}
public boolean equals(recoverBlock_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;
}
boolean this_present_ouch = true && this.isSetOuch();
boolean that_present_ouch = true && that.isSetOuch();
if (this_present_ouch || that_present_ouch) {
if (!(this_present_ouch && that_present_ouch))
return false;
if (!this.ouch.equals(that.ouch))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(recoverBlock_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
recoverBlock_result typedOther = (recoverBlock_result)other;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetOuch()).compareTo(typedOther.isSetOuch());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOuch()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ouch, typedOther.ouch);
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 {
org.apache.thrift.protocol.TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
if (field.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (field.id) {
case 0: // SUCCESS
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.success = new ThdfsBlock();
this.success.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 1: // OUCH
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.ouch = new ThriftIOException();
this.ouch.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
default:
org.apache.thrift.protocol.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(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
oprot.writeStructBegin(STRUCT_DESC);
if (this.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
this.success.write(oprot);
oprot.writeFieldEnd();
} else if (this.isSetOuch()) {
oprot.writeFieldBegin(OUCH_FIELD_DESC);
this.ouch.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("recoverBlock_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
if (!first) sb.append(", ");
sb.append("ouch:");
if (this.ouch == null) {
sb.append("null");
} else {
sb.append(this.ouch);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
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);
}
}
}
public static class getBlockInfo_args implements org.apache.thrift.TBase<getBlockInfo_args, getBlockInfo_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBlockInfo_args");
private static final org.apache.thrift.protocol.TField DATANODE_FIELD_DESC = new org.apache.thrift.protocol.TField("datanode", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField NAMESPACEID_FIELD_DESC = new org.apache.thrift.protocol.TField("namespaceid", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final org.apache.thrift.protocol.TField BLOCK_FIELD_DESC = new org.apache.thrift.protocol.TField("block", org.apache.thrift.protocol.TType.STRUCT, (short)3);
public TDatanodeID datanode; // required
public ThdfsNamespaceId namespaceid; // required
public ThdfsBlock block; // 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 {
DATANODE((short)1, "datanode"),
NAMESPACEID((short)2, "namespaceid"),
BLOCK((short)3, "block");
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: // DATANODE
return DATANODE;
case 2: // NAMESPACEID
return NAMESPACEID;
case 3: // BLOCK
return BLOCK;
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.DATANODE, new org.apache.thrift.meta_data.FieldMetaData("datanode", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDatanodeID.class)));
tmpMap.put(_Fields.NAMESPACEID, new org.apache.thrift.meta_data.FieldMetaData("namespaceid", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ThdfsNamespaceId.class)));
tmpMap.put(_Fields.BLOCK, new org.apache.thrift.meta_data.FieldMetaData("block", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ThdfsBlock.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getBlockInfo_args.class, metaDataMap);
}
public getBlockInfo_args() {
}
public getBlockInfo_args(
TDatanodeID datanode,
ThdfsNamespaceId namespaceid,
ThdfsBlock block)
{
this();
this.datanode = datanode;
this.namespaceid = namespaceid;
this.block = block;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getBlockInfo_args(getBlockInfo_args other) {
if (other.isSetDatanode()) {
this.datanode = new TDatanodeID(other.datanode);
}
if (other.isSetNamespaceid()) {
this.namespaceid = new ThdfsNamespaceId(other.namespaceid);
}
if (other.isSetBlock()) {
this.block = new ThdfsBlock(other.block);
}
}
public getBlockInfo_args deepCopy() {
return new getBlockInfo_args(this);
}
@Override
public void clear() {
this.datanode = null;
this.namespaceid = null;
this.block = null;
}
public TDatanodeID getDatanode() {
return this.datanode;
}
public getBlockInfo_args setDatanode(TDatanodeID datanode) {
this.datanode = datanode;
return this;
}
public void unsetDatanode() {
this.datanode = null;
}
/** Returns true if field datanode is set (has been assigned a value) and false otherwise */
public boolean isSetDatanode() {
return this.datanode != null;
}
public void setDatanodeIsSet(boolean value) {
if (!value) {
this.datanode = null;
}
}
public ThdfsNamespaceId getNamespaceid() {
return this.namespaceid;
}
public getBlockInfo_args setNamespaceid(ThdfsNamespaceId namespaceid) {
this.namespaceid = namespaceid;
return this;
}
public void unsetNamespaceid() {
this.namespaceid = null;
}
/** Returns true if field namespaceid is set (has been assigned a value) and false otherwise */
public boolean isSetNamespaceid() {
return this.namespaceid != null;
}
public void setNamespaceidIsSet(boolean value) {
if (!value) {
this.namespaceid = null;
}
}
public ThdfsBlock getBlock() {
return this.block;
}
public getBlockInfo_args setBlock(ThdfsBlock block) {
this.block = block;
return this;
}
public void unsetBlock() {
this.block = null;
}
/** Returns true if field block is set (has been assigned a value) and false otherwise */
public boolean isSetBlock() {
return this.block != null;
}
public void setBlockIsSet(boolean value) {
if (!value) {
this.block = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case DATANODE:
if (value == null) {
unsetDatanode();
} else {
setDatanode((TDatanodeID)value);
}
break;
case NAMESPACEID:
if (value == null) {
unsetNamespaceid();
} else {
setNamespaceid((ThdfsNamespaceId)value);
}
break;
case BLOCK:
if (value == null) {
unsetBlock();
} else {
setBlock((ThdfsBlock)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case DATANODE:
return getDatanode();
case NAMESPACEID:
return getNamespaceid();
case BLOCK:
return getBlock();
}
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 DATANODE:
return isSetDatanode();
case NAMESPACEID:
return isSetNamespaceid();
case BLOCK:
return isSetBlock();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof getBlockInfo_args)
return this.equals((getBlockInfo_args)that);
return false;
}
public boolean equals(getBlockInfo_args that) {
if (that == null)
return false;
boolean this_present_datanode = true && this.isSetDatanode();
boolean that_present_datanode = true && that.isSetDatanode();
if (this_present_datanode || that_present_datanode) {
if (!(this_present_datanode && that_present_datanode))
return false;
if (!this.datanode.equals(that.datanode))
return false;
}
boolean this_present_namespaceid = true && this.isSetNamespaceid();
boolean that_present_namespaceid = true && that.isSetNamespaceid();
if (this_present_namespaceid || that_present_namespaceid) {
if (!(this_present_namespaceid && that_present_namespaceid))
return false;
if (!this.namespaceid.equals(that.namespaceid))
return false;
}
boolean this_present_block = true && this.isSetBlock();
boolean that_present_block = true && that.isSetBlock();
if (this_present_block || that_present_block) {
if (!(this_present_block && that_present_block))
return false;
if (!this.block.equals(that.block))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(getBlockInfo_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
getBlockInfo_args typedOther = (getBlockInfo_args)other;
lastComparison = Boolean.valueOf(isSetDatanode()).compareTo(typedOther.isSetDatanode());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDatanode()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.datanode, typedOther.datanode);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetNamespaceid()).compareTo(typedOther.isSetNamespaceid());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetNamespaceid()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.namespaceid, typedOther.namespaceid);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetBlock()).compareTo(typedOther.isSetBlock());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetBlock()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.block, typedOther.block);
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 {
org.apache.thrift.protocol.TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
if (field.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (field.id) {
case 1: // DATANODE
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.datanode = new TDatanodeID();
this.datanode.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 2: // NAMESPACEID
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.namespaceid = new ThdfsNamespaceId();
this.namespaceid.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 3: // BLOCK
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.block = new ThdfsBlock();
this.block.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
default:
org.apache.thrift.protocol.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(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
validate();
oprot.writeStructBegin(STRUCT_DESC);
if (this.datanode != null) {
oprot.writeFieldBegin(DATANODE_FIELD_DESC);
this.datanode.write(oprot);
oprot.writeFieldEnd();
}
if (this.namespaceid != null) {
oprot.writeFieldBegin(NAMESPACEID_FIELD_DESC);
this.namespaceid.write(oprot);
oprot.writeFieldEnd();
}
if (this.block != null) {
oprot.writeFieldBegin(BLOCK_FIELD_DESC);
this.block.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("getBlockInfo_args(");
boolean first = true;
sb.append("datanode:");
if (this.datanode == null) {
sb.append("null");
} else {
sb.append(this.datanode);
}
first = false;
if (!first) sb.append(", ");
sb.append("namespaceid:");
if (this.namespaceid == null) {
sb.append("null");
} else {
sb.append(this.namespaceid);
}
first = false;
if (!first) sb.append(", ");
sb.append("block:");
if (this.block == null) {
sb.append("null");
} else {
sb.append(this.block);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
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);
}
}
}
public static class getBlockInfo_result implements org.apache.thrift.TBase<getBlockInfo_result, getBlockInfo_result._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBlockInfo_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final org.apache.thrift.protocol.TField OUCH_FIELD_DESC = new org.apache.thrift.protocol.TField("ouch", org.apache.thrift.protocol.TType.STRUCT, (short)1);
public ThdfsBlock success; // required
public ThriftIOException ouch; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
OUCH((short)1, "ouch");
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;
case 1: // OUCH
return OUCH;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ThdfsBlock.class)));
tmpMap.put(_Fields.OUCH, new org.apache.thrift.meta_data.FieldMetaData("ouch", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getBlockInfo_result.class, metaDataMap);
}
public getBlockInfo_result() {
}
public getBlockInfo_result(
ThdfsBlock success,
ThriftIOException ouch)
{
this();
this.success = success;
this.ouch = ouch;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getBlockInfo_result(getBlockInfo_result other) {
if (other.isSetSuccess()) {
this.success = new ThdfsBlock(other.success);
}
if (other.isSetOuch()) {
this.ouch = new ThriftIOException(other.ouch);
}
}
public getBlockInfo_result deepCopy() {
return new getBlockInfo_result(this);
}
@Override
public void clear() {
this.success = null;
this.ouch = null;
}
public ThdfsBlock getSuccess() {
return this.success;
}
public getBlockInfo_result setSuccess(ThdfsBlock success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public ThriftIOException getOuch() {
return this.ouch;
}
public getBlockInfo_result setOuch(ThriftIOException ouch) {
this.ouch = ouch;
return this;
}
public void unsetOuch() {
this.ouch = null;
}
/** Returns true if field ouch is set (has been assigned a value) and false otherwise */
public boolean isSetOuch() {
return this.ouch != null;
}
public void setOuchIsSet(boolean value) {
if (!value) {
this.ouch = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((ThdfsBlock)value);
}
break;
case OUCH:
if (value == null) {
unsetOuch();
} else {
setOuch((ThriftIOException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case OUCH:
return getOuch();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
case OUCH:
return isSetOuch();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof getBlockInfo_result)
return this.equals((getBlockInfo_result)that);
return false;
}
public boolean equals(getBlockInfo_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;
}
boolean this_present_ouch = true && this.isSetOuch();
boolean that_present_ouch = true && that.isSetOuch();
if (this_present_ouch || that_present_ouch) {
if (!(this_present_ouch && that_present_ouch))
return false;
if (!this.ouch.equals(that.ouch))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(getBlockInfo_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
getBlockInfo_result typedOther = (getBlockInfo_result)other;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetOuch()).compareTo(typedOther.isSetOuch());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOuch()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ouch, typedOther.ouch);
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 {
org.apache.thrift.protocol.TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
if (field.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (field.id) {
case 0: // SUCCESS
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.success = new ThdfsBlock();
this.success.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 1: // OUCH
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.ouch = new ThriftIOException();
this.ouch.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
default:
org.apache.thrift.protocol.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(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
oprot.writeStructBegin(STRUCT_DESC);
if (this.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
this.success.write(oprot);
oprot.writeFieldEnd();
} else if (this.isSetOuch()) {
oprot.writeFieldBegin(OUCH_FIELD_DESC);
this.ouch.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("getBlockInfo_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
if (!first) sb.append(", ");
sb.append("ouch:");
if (this.ouch == null) {
sb.append("null");
} else {
sb.append(this.ouch);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
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);
}
}
}
public static class copyBlock_args implements org.apache.thrift.TBase<copyBlock_args, copyBlock_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("copyBlock_args");
private static final org.apache.thrift.protocol.TField DATANODE_FIELD_DESC = new org.apache.thrift.protocol.TField("datanode", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField SRC_NAMESPACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("srcNamespaceId", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final org.apache.thrift.protocol.TField SRCBLOCK_FIELD_DESC = new org.apache.thrift.protocol.TField("srcblock", org.apache.thrift.protocol.TType.STRUCT, (short)3);
private static final org.apache.thrift.protocol.TField DST_NAMESPACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("dstNamespaceId", org.apache.thrift.protocol.TType.STRUCT, (short)4);
private static final org.apache.thrift.protocol.TField DEST_BLOCK_FIELD_DESC = new org.apache.thrift.protocol.TField("destBlock", org.apache.thrift.protocol.TType.STRUCT, (short)5);
private static final org.apache.thrift.protocol.TField TARGET_FIELD_DESC = new org.apache.thrift.protocol.TField("target", org.apache.thrift.protocol.TType.STRUCT, (short)6);
private static final org.apache.thrift.protocol.TField ASYNCHRONOUS_FIELD_DESC = new org.apache.thrift.protocol.TField("asynchronous", org.apache.thrift.protocol.TType.BOOL, (short)7);
public TDatanodeID datanode; // required
public ThdfsNamespaceId srcNamespaceId; // required
public ThdfsBlock srcblock; // required
public ThdfsNamespaceId dstNamespaceId; // required
public ThdfsBlock destBlock; // required
public TDatanodeID target; // required
public boolean asynchronous; // 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 {
DATANODE((short)1, "datanode"),
SRC_NAMESPACE_ID((short)2, "srcNamespaceId"),
SRCBLOCK((short)3, "srcblock"),
DST_NAMESPACE_ID((short)4, "dstNamespaceId"),
DEST_BLOCK((short)5, "destBlock"),
TARGET((short)6, "target"),
ASYNCHRONOUS((short)7, "asynchronous");
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: // DATANODE
return DATANODE;
case 2: // SRC_NAMESPACE_ID
return SRC_NAMESPACE_ID;
case 3: // SRCBLOCK
return SRCBLOCK;
case 4: // DST_NAMESPACE_ID
return DST_NAMESPACE_ID;
case 5: // DEST_BLOCK
return DEST_BLOCK;
case 6: // TARGET
return TARGET;
case 7: // ASYNCHRONOUS
return ASYNCHRONOUS;
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 __ASYNCHRONOUS_ISSET_ID = 0;
private BitSet __isset_bit_vector = new BitSet(1);
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.DATANODE, new org.apache.thrift.meta_data.FieldMetaData("datanode", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDatanodeID.class)));
tmpMap.put(_Fields.SRC_NAMESPACE_ID, new org.apache.thrift.meta_data.FieldMetaData("srcNamespaceId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ThdfsNamespaceId.class)));
tmpMap.put(_Fields.SRCBLOCK, new org.apache.thrift.meta_data.FieldMetaData("srcblock", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ThdfsBlock.class)));
tmpMap.put(_Fields.DST_NAMESPACE_ID, new org.apache.thrift.meta_data.FieldMetaData("dstNamespaceId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ThdfsNamespaceId.class)));
tmpMap.put(_Fields.DEST_BLOCK, new org.apache.thrift.meta_data.FieldMetaData("destBlock", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ThdfsBlock.class)));
tmpMap.put(_Fields.TARGET, new org.apache.thrift.meta_data.FieldMetaData("target", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDatanodeID.class)));
tmpMap.put(_Fields.ASYNCHRONOUS, new org.apache.thrift.meta_data.FieldMetaData("asynchronous", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(copyBlock_args.class, metaDataMap);
}
public copyBlock_args() {
}
public copyBlock_args(
TDatanodeID datanode,
ThdfsNamespaceId srcNamespaceId,
ThdfsBlock srcblock,
ThdfsNamespaceId dstNamespaceId,
ThdfsBlock destBlock,
TDatanodeID target,
boolean asynchronous)
{
this();
this.datanode = datanode;
this.srcNamespaceId = srcNamespaceId;
this.srcblock = srcblock;
this.dstNamespaceId = dstNamespaceId;
this.destBlock = destBlock;
this.target = target;
this.asynchronous = asynchronous;
setAsynchronousIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public copyBlock_args(copyBlock_args other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
if (other.isSetDatanode()) {
this.datanode = new TDatanodeID(other.datanode);
}
if (other.isSetSrcNamespaceId()) {
this.srcNamespaceId = new ThdfsNamespaceId(other.srcNamespaceId);
}
if (other.isSetSrcblock()) {
this.srcblock = new ThdfsBlock(other.srcblock);
}
if (other.isSetDstNamespaceId()) {
this.dstNamespaceId = new ThdfsNamespaceId(other.dstNamespaceId);
}
if (other.isSetDestBlock()) {
this.destBlock = new ThdfsBlock(other.destBlock);
}
if (other.isSetTarget()) {
this.target = new TDatanodeID(other.target);
}
this.asynchronous = other.asynchronous;
}
public copyBlock_args deepCopy() {
return new copyBlock_args(this);
}
@Override
public void clear() {
this.datanode = null;
this.srcNamespaceId = null;
this.srcblock = null;
this.dstNamespaceId = null;
this.destBlock = null;
this.target = null;
setAsynchronousIsSet(false);
this.asynchronous = false;
}
public TDatanodeID getDatanode() {
return this.datanode;
}
public copyBlock_args setDatanode(TDatanodeID datanode) {
this.datanode = datanode;
return this;
}
public void unsetDatanode() {
this.datanode = null;
}
/** Returns true if field datanode is set (has been assigned a value) and false otherwise */
public boolean isSetDatanode() {
return this.datanode != null;
}
public void setDatanodeIsSet(boolean value) {
if (!value) {
this.datanode = null;
}
}
public ThdfsNamespaceId getSrcNamespaceId() {
return this.srcNamespaceId;
}
public copyBlock_args setSrcNamespaceId(ThdfsNamespaceId srcNamespaceId) {
this.srcNamespaceId = srcNamespaceId;
return this;
}
public void unsetSrcNamespaceId() {
this.srcNamespaceId = null;
}
/** Returns true if field srcNamespaceId is set (has been assigned a value) and false otherwise */
public boolean isSetSrcNamespaceId() {
return this.srcNamespaceId != null;
}
public void setSrcNamespaceIdIsSet(boolean value) {
if (!value) {
this.srcNamespaceId = null;
}
}
public ThdfsBlock getSrcblock() {
return this.srcblock;
}
public copyBlock_args setSrcblock(ThdfsBlock srcblock) {
this.srcblock = srcblock;
return this;
}
public void unsetSrcblock() {
this.srcblock = null;
}
/** Returns true if field srcblock is set (has been assigned a value) and false otherwise */
public boolean isSetSrcblock() {
return this.srcblock != null;
}
public void setSrcblockIsSet(boolean value) {
if (!value) {
this.srcblock = null;
}
}
public ThdfsNamespaceId getDstNamespaceId() {
return this.dstNamespaceId;
}
public copyBlock_args setDstNamespaceId(ThdfsNamespaceId dstNamespaceId) {
this.dstNamespaceId = dstNamespaceId;
return this;
}
public void unsetDstNamespaceId() {
this.dstNamespaceId = null;
}
/** Returns true if field dstNamespaceId is set (has been assigned a value) and false otherwise */
public boolean isSetDstNamespaceId() {
return this.dstNamespaceId != null;
}
public void setDstNamespaceIdIsSet(boolean value) {
if (!value) {
this.dstNamespaceId = null;
}
}
public ThdfsBlock getDestBlock() {
return this.destBlock;
}
public copyBlock_args setDestBlock(ThdfsBlock destBlock) {
this.destBlock = destBlock;
return this;
}
public void unsetDestBlock() {
this.destBlock = null;
}
/** Returns true if field destBlock is set (has been assigned a value) and false otherwise */
public boolean isSetDestBlock() {
return this.destBlock != null;
}
public void setDestBlockIsSet(boolean value) {
if (!value) {
this.destBlock = null;
}
}
public TDatanodeID getTarget() {
return this.target;
}
public copyBlock_args setTarget(TDatanodeID target) {
this.target = target;
return this;
}
public void unsetTarget() {
this.target = null;
}
/** Returns true if field target is set (has been assigned a value) and false otherwise */
public boolean isSetTarget() {
return this.target != null;
}
public void setTargetIsSet(boolean value) {
if (!value) {
this.target = null;
}
}
public boolean isAsynchronous() {
return this.asynchronous;
}
public copyBlock_args setAsynchronous(boolean asynchronous) {
this.asynchronous = asynchronous;
setAsynchronousIsSet(true);
return this;
}
public void unsetAsynchronous() {
__isset_bit_vector.clear(__ASYNCHRONOUS_ISSET_ID);
}
/** Returns true if field asynchronous is set (has been assigned a value) and false otherwise */
public boolean isSetAsynchronous() {
return __isset_bit_vector.get(__ASYNCHRONOUS_ISSET_ID);
}
public void setAsynchronousIsSet(boolean value) {
__isset_bit_vector.set(__ASYNCHRONOUS_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case DATANODE:
if (value == null) {
unsetDatanode();
} else {
setDatanode((TDatanodeID)value);
}
break;
case SRC_NAMESPACE_ID:
if (value == null) {
unsetSrcNamespaceId();
} else {
setSrcNamespaceId((ThdfsNamespaceId)value);
}
break;
case SRCBLOCK:
if (value == null) {
unsetSrcblock();
} else {
setSrcblock((ThdfsBlock)value);
}
break;
case DST_NAMESPACE_ID:
if (value == null) {
unsetDstNamespaceId();
} else {
setDstNamespaceId((ThdfsNamespaceId)value);
}
break;
case DEST_BLOCK:
if (value == null) {
unsetDestBlock();
} else {
setDestBlock((ThdfsBlock)value);
}
break;
case TARGET:
if (value == null) {
unsetTarget();
} else {
setTarget((TDatanodeID)value);
}
break;
case ASYNCHRONOUS:
if (value == null) {
unsetAsynchronous();
} else {
setAsynchronous((Boolean)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case DATANODE:
return getDatanode();
case SRC_NAMESPACE_ID:
return getSrcNamespaceId();
case SRCBLOCK:
return getSrcblock();
case DST_NAMESPACE_ID:
return getDstNamespaceId();
case DEST_BLOCK:
return getDestBlock();
case TARGET:
return getTarget();
case ASYNCHRONOUS:
return Boolean.valueOf(isAsynchronous());
}
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 DATANODE:
return isSetDatanode();
case SRC_NAMESPACE_ID:
return isSetSrcNamespaceId();
case SRCBLOCK:
return isSetSrcblock();
case DST_NAMESPACE_ID:
return isSetDstNamespaceId();
case DEST_BLOCK:
return isSetDestBlock();
case TARGET:
return isSetTarget();
case ASYNCHRONOUS:
return isSetAsynchronous();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof copyBlock_args)
return this.equals((copyBlock_args)that);
return false;
}
public boolean equals(copyBlock_args that) {
if (that == null)
return false;
boolean this_present_datanode = true && this.isSetDatanode();
boolean that_present_datanode = true && that.isSetDatanode();
if (this_present_datanode || that_present_datanode) {
if (!(this_present_datanode && that_present_datanode))
return false;
if (!this.datanode.equals(that.datanode))
return false;
}
boolean this_present_srcNamespaceId = true && this.isSetSrcNamespaceId();
boolean that_present_srcNamespaceId = true && that.isSetSrcNamespaceId();
if (this_present_srcNamespaceId || that_present_srcNamespaceId) {
if (!(this_present_srcNamespaceId && that_present_srcNamespaceId))
return false;
if (!this.srcNamespaceId.equals(that.srcNamespaceId))
return false;
}
boolean this_present_srcblock = true && this.isSetSrcblock();
boolean that_present_srcblock = true && that.isSetSrcblock();
if (this_present_srcblock || that_present_srcblock) {
if (!(this_present_srcblock && that_present_srcblock))
return false;
if (!this.srcblock.equals(that.srcblock))
return false;
}
boolean this_present_dstNamespaceId = true && this.isSetDstNamespaceId();
boolean that_present_dstNamespaceId = true && that.isSetDstNamespaceId();
if (this_present_dstNamespaceId || that_present_dstNamespaceId) {
if (!(this_present_dstNamespaceId && that_present_dstNamespaceId))
return false;
if (!this.dstNamespaceId.equals(that.dstNamespaceId))
return false;
}
boolean this_present_destBlock = true && this.isSetDestBlock();
boolean that_present_destBlock = true && that.isSetDestBlock();
if (this_present_destBlock || that_present_destBlock) {
if (!(this_present_destBlock && that_present_destBlock))
return false;
if (!this.destBlock.equals(that.destBlock))
return false;
}
boolean this_present_target = true && this.isSetTarget();
boolean that_present_target = true && that.isSetTarget();
if (this_present_target || that_present_target) {
if (!(this_present_target && that_present_target))
return false;
if (!this.target.equals(that.target))
return false;
}
boolean this_present_asynchronous = true;
boolean that_present_asynchronous = true;
if (this_present_asynchronous || that_present_asynchronous) {
if (!(this_present_asynchronous && that_present_asynchronous))
return false;
if (this.asynchronous != that.asynchronous)
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(copyBlock_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
copyBlock_args typedOther = (copyBlock_args)other;
lastComparison = Boolean.valueOf(isSetDatanode()).compareTo(typedOther.isSetDatanode());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDatanode()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.datanode, typedOther.datanode);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetSrcNamespaceId()).compareTo(typedOther.isSetSrcNamespaceId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSrcNamespaceId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.srcNamespaceId, typedOther.srcNamespaceId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetSrcblock()).compareTo(typedOther.isSetSrcblock());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSrcblock()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.srcblock, typedOther.srcblock);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetDstNamespaceId()).compareTo(typedOther.isSetDstNamespaceId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDstNamespaceId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dstNamespaceId, typedOther.dstNamespaceId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetDestBlock()).compareTo(typedOther.isSetDestBlock());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDestBlock()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.destBlock, typedOther.destBlock);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetTarget()).compareTo(typedOther.isSetTarget());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTarget()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.target, typedOther.target);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetAsynchronous()).compareTo(typedOther.isSetAsynchronous());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetAsynchronous()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.asynchronous, typedOther.asynchronous);
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 {
org.apache.thrift.protocol.TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
if (field.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (field.id) {
case 1: // DATANODE
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.datanode = new TDatanodeID();
this.datanode.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 2: // SRC_NAMESPACE_ID
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.srcNamespaceId = new ThdfsNamespaceId();
this.srcNamespaceId.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 3: // SRCBLOCK
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.srcblock = new ThdfsBlock();
this.srcblock.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 4: // DST_NAMESPACE_ID
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.dstNamespaceId = new ThdfsNamespaceId();
this.dstNamespaceId.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 5: // DEST_BLOCK
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.destBlock = new ThdfsBlock();
this.destBlock.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 6: // TARGET
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.target = new TDatanodeID();
this.target.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 7: // ASYNCHRONOUS
if (field.type == org.apache.thrift.protocol.TType.BOOL) {
this.asynchronous = iprot.readBool();
setAsynchronousIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
default:
org.apache.thrift.protocol.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(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
validate();
oprot.writeStructBegin(STRUCT_DESC);
if (this.datanode != null) {
oprot.writeFieldBegin(DATANODE_FIELD_DESC);
this.datanode.write(oprot);
oprot.writeFieldEnd();
}
if (this.srcNamespaceId != null) {
oprot.writeFieldBegin(SRC_NAMESPACE_ID_FIELD_DESC);
this.srcNamespaceId.write(oprot);
oprot.writeFieldEnd();
}
if (this.srcblock != null) {
oprot.writeFieldBegin(SRCBLOCK_FIELD_DESC);
this.srcblock.write(oprot);
oprot.writeFieldEnd();
}
if (this.dstNamespaceId != null) {
oprot.writeFieldBegin(DST_NAMESPACE_ID_FIELD_DESC);
this.dstNamespaceId.write(oprot);
oprot.writeFieldEnd();
}
if (this.destBlock != null) {
oprot.writeFieldBegin(DEST_BLOCK_FIELD_DESC);
this.destBlock.write(oprot);
oprot.writeFieldEnd();
}
if (this.target != null) {
oprot.writeFieldBegin(TARGET_FIELD_DESC);
this.target.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(ASYNCHRONOUS_FIELD_DESC);
oprot.writeBool(this.asynchronous);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("copyBlock_args(");
boolean first = true;
sb.append("datanode:");
if (this.datanode == null) {
sb.append("null");
} else {
sb.append(this.datanode);
}
first = false;
if (!first) sb.append(", ");
sb.append("srcNamespaceId:");
if (this.srcNamespaceId == null) {
sb.append("null");
} else {
sb.append(this.srcNamespaceId);
}
first = false;
if (!first) sb.append(", ");
sb.append("srcblock:");
if (this.srcblock == null) {
sb.append("null");
} else {
sb.append(this.srcblock);
}
first = false;
if (!first) sb.append(", ");
sb.append("dstNamespaceId:");
if (this.dstNamespaceId == null) {
sb.append("null");
} else {
sb.append(this.dstNamespaceId);
}
first = false;
if (!first) sb.append(", ");
sb.append("destBlock:");
if (this.destBlock == null) {
sb.append("null");
} else {
sb.append(this.destBlock);
}
first = false;
if (!first) sb.append(", ");
sb.append("target:");
if (this.target == null) {
sb.append("null");
} else {
sb.append(this.target);
}
first = false;
if (!first) sb.append(", ");
sb.append("asynchronous:");
sb.append(this.asynchronous);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
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_bit_vector = new BitSet(1);
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);
}
}
}
public static class copyBlock_result implements org.apache.thrift.TBase<copyBlock_result, copyBlock_result._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("copyBlock_result");
private static final org.apache.thrift.protocol.TField OUCH_FIELD_DESC = new org.apache.thrift.protocol.TField("ouch", org.apache.thrift.protocol.TType.STRUCT, (short)1);
public ThriftIOException ouch; // 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 {
OUCH((short)1, "ouch");
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: // OUCH
return OUCH;
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.OUCH, new org.apache.thrift.meta_data.FieldMetaData("ouch", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(copyBlock_result.class, metaDataMap);
}
public copyBlock_result() {
}
public copyBlock_result(
ThriftIOException ouch)
{
this();
this.ouch = ouch;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public copyBlock_result(copyBlock_result other) {
if (other.isSetOuch()) {
this.ouch = new ThriftIOException(other.ouch);
}
}
public copyBlock_result deepCopy() {
return new copyBlock_result(this);
}
@Override
public void clear() {
this.ouch = null;
}
public ThriftIOException getOuch() {
return this.ouch;
}
public copyBlock_result setOuch(ThriftIOException ouch) {
this.ouch = ouch;
return this;
}
public void unsetOuch() {
this.ouch = null;
}
/** Returns true if field ouch is set (has been assigned a value) and false otherwise */
public boolean isSetOuch() {
return this.ouch != null;
}
public void setOuchIsSet(boolean value) {
if (!value) {
this.ouch = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case OUCH:
if (value == null) {
unsetOuch();
} else {
setOuch((ThriftIOException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case OUCH:
return getOuch();
}
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 OUCH:
return isSetOuch();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof copyBlock_result)
return this.equals((copyBlock_result)that);
return false;
}
public boolean equals(copyBlock_result that) {
if (that == null)
return false;
boolean this_present_ouch = true && this.isSetOuch();
boolean that_present_ouch = true && that.isSetOuch();
if (this_present_ouch || that_present_ouch) {
if (!(this_present_ouch && that_present_ouch))
return false;
if (!this.ouch.equals(that.ouch))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(copyBlock_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
copyBlock_result typedOther = (copyBlock_result)other;
lastComparison = Boolean.valueOf(isSetOuch()).compareTo(typedOther.isSetOuch());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOuch()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ouch, typedOther.ouch);
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 {
org.apache.thrift.protocol.TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
if (field.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (field.id) {
case 1: // OUCH
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.ouch = new ThriftIOException();
this.ouch.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
default:
org.apache.thrift.protocol.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(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
oprot.writeStructBegin(STRUCT_DESC);
if (this.isSetOuch()) {
oprot.writeFieldBegin(OUCH_FIELD_DESC);
this.ouch.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("copyBlock_result(");
boolean first = true;
sb.append("ouch:");
if (this.ouch == null) {
sb.append("null");
} else {
sb.append(this.ouch);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
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);
}
}
}
public static class getBlockPathInfo_args implements org.apache.thrift.TBase<getBlockPathInfo_args, getBlockPathInfo_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBlockPathInfo_args");
private static final org.apache.thrift.protocol.TField DATANODE_FIELD_DESC = new org.apache.thrift.protocol.TField("datanode", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField NAMESPACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("namespaceId", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final org.apache.thrift.protocol.TField BLOCK_FIELD_DESC = new org.apache.thrift.protocol.TField("block", org.apache.thrift.protocol.TType.STRUCT, (short)3);
public TDatanodeID datanode; // required
public ThdfsNamespaceId namespaceId; // required
public ThdfsBlock block; // 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 {
DATANODE((short)1, "datanode"),
NAMESPACE_ID((short)2, "namespaceId"),
BLOCK((short)3, "block");
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: // DATANODE
return DATANODE;
case 2: // NAMESPACE_ID
return NAMESPACE_ID;
case 3: // BLOCK
return BLOCK;
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.DATANODE, new org.apache.thrift.meta_data.FieldMetaData("datanode", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDatanodeID.class)));
tmpMap.put(_Fields.NAMESPACE_ID, new org.apache.thrift.meta_data.FieldMetaData("namespaceId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ThdfsNamespaceId.class)));
tmpMap.put(_Fields.BLOCK, new org.apache.thrift.meta_data.FieldMetaData("block", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ThdfsBlock.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getBlockPathInfo_args.class, metaDataMap);
}
public getBlockPathInfo_args() {
}
public getBlockPathInfo_args(
TDatanodeID datanode,
ThdfsNamespaceId namespaceId,
ThdfsBlock block)
{
this();
this.datanode = datanode;
this.namespaceId = namespaceId;
this.block = block;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getBlockPathInfo_args(getBlockPathInfo_args other) {
if (other.isSetDatanode()) {
this.datanode = new TDatanodeID(other.datanode);
}
if (other.isSetNamespaceId()) {
this.namespaceId = new ThdfsNamespaceId(other.namespaceId);
}
if (other.isSetBlock()) {
this.block = new ThdfsBlock(other.block);
}
}
public getBlockPathInfo_args deepCopy() {
return new getBlockPathInfo_args(this);
}
@Override
public void clear() {
this.datanode = null;
this.namespaceId = null;
this.block = null;
}
public TDatanodeID getDatanode() {
return this.datanode;
}
public getBlockPathInfo_args setDatanode(TDatanodeID datanode) {
this.datanode = datanode;
return this;
}
public void unsetDatanode() {
this.datanode = null;
}
/** Returns true if field datanode is set (has been assigned a value) and false otherwise */
public boolean isSetDatanode() {
return this.datanode != null;
}
public void setDatanodeIsSet(boolean value) {
if (!value) {
this.datanode = null;
}
}
public ThdfsNamespaceId getNamespaceId() {
return this.namespaceId;
}
public getBlockPathInfo_args setNamespaceId(ThdfsNamespaceId namespaceId) {
this.namespaceId = namespaceId;
return this;
}
public void unsetNamespaceId() {
this.namespaceId = null;
}
/** Returns true if field namespaceId is set (has been assigned a value) and false otherwise */
public boolean isSetNamespaceId() {
return this.namespaceId != null;
}
public void setNamespaceIdIsSet(boolean value) {
if (!value) {
this.namespaceId = null;
}
}
public ThdfsBlock getBlock() {
return this.block;
}
public getBlockPathInfo_args setBlock(ThdfsBlock block) {
this.block = block;
return this;
}
public void unsetBlock() {
this.block = null;
}
/** Returns true if field block is set (has been assigned a value) and false otherwise */
public boolean isSetBlock() {
return this.block != null;
}
public void setBlockIsSet(boolean value) {
if (!value) {
this.block = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case DATANODE:
if (value == null) {
unsetDatanode();
} else {
setDatanode((TDatanodeID)value);
}
break;
case NAMESPACE_ID:
if (value == null) {
unsetNamespaceId();
} else {
setNamespaceId((ThdfsNamespaceId)value);
}
break;
case BLOCK:
if (value == null) {
unsetBlock();
} else {
setBlock((ThdfsBlock)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case DATANODE:
return getDatanode();
case NAMESPACE_ID:
return getNamespaceId();
case BLOCK:
return getBlock();
}
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 DATANODE:
return isSetDatanode();
case NAMESPACE_ID:
return isSetNamespaceId();
case BLOCK:
return isSetBlock();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof getBlockPathInfo_args)
return this.equals((getBlockPathInfo_args)that);
return false;
}
public boolean equals(getBlockPathInfo_args that) {
if (that == null)
return false;
boolean this_present_datanode = true && this.isSetDatanode();
boolean that_present_datanode = true && that.isSetDatanode();
if (this_present_datanode || that_present_datanode) {
if (!(this_present_datanode && that_present_datanode))
return false;
if (!this.datanode.equals(that.datanode))
return false;
}
boolean this_present_namespaceId = true && this.isSetNamespaceId();
boolean that_present_namespaceId = true && that.isSetNamespaceId();
if (this_present_namespaceId || that_present_namespaceId) {
if (!(this_present_namespaceId && that_present_namespaceId))
return false;
if (!this.namespaceId.equals(that.namespaceId))
return false;
}
boolean this_present_block = true && this.isSetBlock();
boolean that_present_block = true && that.isSetBlock();
if (this_present_block || that_present_block) {
if (!(this_present_block && that_present_block))
return false;
if (!this.block.equals(that.block))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(getBlockPathInfo_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
getBlockPathInfo_args typedOther = (getBlockPathInfo_args)other;
lastComparison = Boolean.valueOf(isSetDatanode()).compareTo(typedOther.isSetDatanode());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDatanode()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.datanode, typedOther.datanode);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetNamespaceId()).compareTo(typedOther.isSetNamespaceId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetNamespaceId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.namespaceId, typedOther.namespaceId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetBlock()).compareTo(typedOther.isSetBlock());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetBlock()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.block, typedOther.block);
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 {
org.apache.thrift.protocol.TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
if (field.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (field.id) {
case 1: // DATANODE
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.datanode = new TDatanodeID();
this.datanode.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 2: // NAMESPACE_ID
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.namespaceId = new ThdfsNamespaceId();
this.namespaceId.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 3: // BLOCK
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.block = new ThdfsBlock();
this.block.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
default:
org.apache.thrift.protocol.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(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
validate();
oprot.writeStructBegin(STRUCT_DESC);
if (this.datanode != null) {
oprot.writeFieldBegin(DATANODE_FIELD_DESC);
this.datanode.write(oprot);
oprot.writeFieldEnd();
}
if (this.namespaceId != null) {
oprot.writeFieldBegin(NAMESPACE_ID_FIELD_DESC);
this.namespaceId.write(oprot);
oprot.writeFieldEnd();
}
if (this.block != null) {
oprot.writeFieldBegin(BLOCK_FIELD_DESC);
this.block.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("getBlockPathInfo_args(");
boolean first = true;
sb.append("datanode:");
if (this.datanode == null) {
sb.append("null");
} else {
sb.append(this.datanode);
}
first = false;
if (!first) sb.append(", ");
sb.append("namespaceId:");
if (this.namespaceId == null) {
sb.append("null");
} else {
sb.append(this.namespaceId);
}
first = false;
if (!first) sb.append(", ");
sb.append("block:");
if (this.block == null) {
sb.append("null");
} else {
sb.append(this.block);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
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);
}
}
}
public static class getBlockPathInfo_result implements org.apache.thrift.TBase<getBlockPathInfo_result, getBlockPathInfo_result._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBlockPathInfo_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final org.apache.thrift.protocol.TField OUCH_FIELD_DESC = new org.apache.thrift.protocol.TField("ouch", org.apache.thrift.protocol.TType.STRUCT, (short)1);
public ThdfsBlockPath success; // required
public ThriftIOException ouch; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
OUCH((short)1, "ouch");
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;
case 1: // OUCH
return OUCH;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ThdfsBlockPath.class)));
tmpMap.put(_Fields.OUCH, new org.apache.thrift.meta_data.FieldMetaData("ouch", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getBlockPathInfo_result.class, metaDataMap);
}
public getBlockPathInfo_result() {
}
public getBlockPathInfo_result(
ThdfsBlockPath success,
ThriftIOException ouch)
{
this();
this.success = success;
this.ouch = ouch;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getBlockPathInfo_result(getBlockPathInfo_result other) {
if (other.isSetSuccess()) {
this.success = new ThdfsBlockPath(other.success);
}
if (other.isSetOuch()) {
this.ouch = new ThriftIOException(other.ouch);
}
}
public getBlockPathInfo_result deepCopy() {
return new getBlockPathInfo_result(this);
}
@Override
public void clear() {
this.success = null;
this.ouch = null;
}
public ThdfsBlockPath getSuccess() {
return this.success;
}
public getBlockPathInfo_result setSuccess(ThdfsBlockPath success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public ThriftIOException getOuch() {
return this.ouch;
}
public getBlockPathInfo_result setOuch(ThriftIOException ouch) {
this.ouch = ouch;
return this;
}
public void unsetOuch() {
this.ouch = null;
}
/** Returns true if field ouch is set (has been assigned a value) and false otherwise */
public boolean isSetOuch() {
return this.ouch != null;
}
public void setOuchIsSet(boolean value) {
if (!value) {
this.ouch = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((ThdfsBlockPath)value);
}
break;
case OUCH:
if (value == null) {
unsetOuch();
} else {
setOuch((ThriftIOException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case OUCH:
return getOuch();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
case OUCH:
return isSetOuch();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof getBlockPathInfo_result)
return this.equals((getBlockPathInfo_result)that);
return false;
}
public boolean equals(getBlockPathInfo_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;
}
boolean this_present_ouch = true && this.isSetOuch();
boolean that_present_ouch = true && that.isSetOuch();
if (this_present_ouch || that_present_ouch) {
if (!(this_present_ouch && that_present_ouch))
return false;
if (!this.ouch.equals(that.ouch))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(getBlockPathInfo_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
getBlockPathInfo_result typedOther = (getBlockPathInfo_result)other;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetOuch()).compareTo(typedOther.isSetOuch());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOuch()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ouch, typedOther.ouch);
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 {
org.apache.thrift.protocol.TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
if (field.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (field.id) {
case 0: // SUCCESS
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.success = new ThdfsBlockPath();
this.success.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 1: // OUCH
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.ouch = new ThriftIOException();
this.ouch.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
default:
org.apache.thrift.protocol.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(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
oprot.writeStructBegin(STRUCT_DESC);
if (this.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
this.success.write(oprot);
oprot.writeFieldEnd();
} else if (this.isSetOuch()) {
oprot.writeFieldBegin(OUCH_FIELD_DESC);
this.ouch.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("getBlockPathInfo_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
if (!first) sb.append(", ");
sb.append("ouch:");
if (this.ouch == null) {
sb.append("null");
} else {
sb.append(this.ouch);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
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);
}
}
}
}