/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package alluxio.thrift;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
public class BlockWorkerClientService {
public interface Iface extends alluxio.thrift.AlluxioService.Iface {
/**
* Accesses a block given the block id.
*
* @param blockId the id of the block being accessed
*
* @param options the method options
*/
public AccessBlockTResponse accessBlock(long blockId, AccessBlockTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Used to cache a block into Alluxio space, worker will move the temporary block file from session
* folder to data folder, and update the space usage information related. then update the block
* information to master.
*
* @param sessionId the id of the current session
*
* @param blockId the id of the block being accessed
*
* @param options the method options
*/
public CacheBlockTResponse cacheBlock(long sessionId, long blockId, CacheBlockTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Used to cancel a block which is being written. worker will delete the temporary block file and
* the location and space information related, then reclaim space allocated to the block.
*
* @param sessionId the id of the current session
*
* @param blockId the id of the block being accessed
*
* @param options the method options
*/
public CancelBlockTResponse cancelBlock(long sessionId, long blockId, CancelBlockTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Locks the file in Alluxio's space while the session is reading it. If lock succeeds, the path of
* the block's file along with the internal lock id of locked block will be returned. If the block's file
* is not found, FileDoesNotExistException will be thrown.
*
* @param blockId the id of the block being accessed
*
* @param sessionId the id of the current session
*
* @param options the lock method options
*/
public LockBlockTResponse lockBlock(long blockId, long sessionId, LockBlockTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Used to promote block on under storage layer to top storage layer when there are more than one
* storage layers in Alluxio's space. return true if the block is successfully promoted, false
* otherwise.
*
* @param blockId the id of the block being accessed
*
* @param options the method options
*/
public PromoteBlockTResponse promoteBlock(long blockId, PromoteBlockTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Used to remove a block from an Alluxio worker.
*
*
* @param blockId the id of the block being removed
*
* @param options the method options
*/
public RemoveBlockTResponse removeBlock(long blockId, RemoveBlockTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Used to allocate location and space for a new coming block, worker will choose the appropriate
* storage directory which fits the initial block size by some allocation strategy, and the
* temporary file path of the block file will be returned. if there is no enough space on Alluxio
* storage OutOfSpaceException will be thrown, if the file is already being written by the session,
* FileAlreadyExistsException will be thrown.
*
* @param sessionId the id of the current session
*
* @param blockId the id of the block being accessed
*
* @param initialBytes initial number of bytes requested
*
* @param writeTier the target tier to write to
*
* @param options the method options
*/
public RequestBlockLocationTResponse requestBlockLocation(long sessionId, long blockId, long initialBytes, int writeTier, RequestBlockLocationTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Used to request space for some block file. return true if the worker successfully allocates
* space for the block on block’s location, false if there is no enough space, if there is no
* information of the block on worker, FileDoesNotExistException will be thrown.
*
* @param sessionId the id of the current session
*
* @param blockId the id of the block being accessed
*
* @param requestBytes the number of bytes requested
*
* @param options the method options
*/
public RequestSpaceTResponse requestSpace(long sessionId, long blockId, long requestBytes, RequestSpaceTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Local session send heartbeat to local worker to keep its temporary folder.
*
* @param sessionId the id of the current session
*
* @param metrics deprecated since 1.3.0 and will be removed in 2.0
*
* @param options the method options
*/
public SessionBlockHeartbeatTResponse sessionBlockHeartbeat(long sessionId, List<Long> metrics, SessionBlockHeartbeatTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Used to unlock a block after the block is accessed, if the block is to be removed, delete the
* block file. return true if successfully unlock the block, return false if the block is not
* found or failed to delete the block.
*
* @param blockId the id of the block being accessed
*
* @param sessionId the id of the current session
*
* @param options the method options
*/
public UnlockBlockTResponse unlockBlock(long blockId, long sessionId, UnlockBlockTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
}
public interface AsyncIface extends alluxio.thrift.AlluxioService .AsyncIface {
public void accessBlock(long blockId, AccessBlockTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void cacheBlock(long sessionId, long blockId, CacheBlockTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void cancelBlock(long sessionId, long blockId, CancelBlockTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void lockBlock(long blockId, long sessionId, LockBlockTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void promoteBlock(long blockId, PromoteBlockTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void removeBlock(long blockId, RemoveBlockTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void requestBlockLocation(long sessionId, long blockId, long initialBytes, int writeTier, RequestBlockLocationTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void requestSpace(long sessionId, long blockId, long requestBytes, RequestSpaceTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void sessionBlockHeartbeat(long sessionId, List<Long> metrics, SessionBlockHeartbeatTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void unlockBlock(long blockId, long sessionId, UnlockBlockTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
}
public static class Client extends alluxio.thrift.AlluxioService.Client 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 AccessBlockTResponse accessBlock(long blockId, AccessBlockTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_accessBlock(blockId, options);
return recv_accessBlock();
}
public void send_accessBlock(long blockId, AccessBlockTOptions options) throws org.apache.thrift.TException
{
accessBlock_args args = new accessBlock_args();
args.setBlockId(blockId);
args.setOptions(options);
sendBase("accessBlock", args);
}
public AccessBlockTResponse recv_accessBlock() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
accessBlock_result result = new accessBlock_result();
receiveBase(result, "accessBlock");
if (result.isSetSuccess()) {
return result.success;
}
if (result.e != null) {
throw result.e;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "accessBlock failed: unknown result");
}
public CacheBlockTResponse cacheBlock(long sessionId, long blockId, CacheBlockTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_cacheBlock(sessionId, blockId, options);
return recv_cacheBlock();
}
public void send_cacheBlock(long sessionId, long blockId, CacheBlockTOptions options) throws org.apache.thrift.TException
{
cacheBlock_args args = new cacheBlock_args();
args.setSessionId(sessionId);
args.setBlockId(blockId);
args.setOptions(options);
sendBase("cacheBlock", args);
}
public CacheBlockTResponse recv_cacheBlock() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
cacheBlock_result result = new cacheBlock_result();
receiveBase(result, "cacheBlock");
if (result.isSetSuccess()) {
return result.success;
}
if (result.e != null) {
throw result.e;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "cacheBlock failed: unknown result");
}
public CancelBlockTResponse cancelBlock(long sessionId, long blockId, CancelBlockTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_cancelBlock(sessionId, blockId, options);
return recv_cancelBlock();
}
public void send_cancelBlock(long sessionId, long blockId, CancelBlockTOptions options) throws org.apache.thrift.TException
{
cancelBlock_args args = new cancelBlock_args();
args.setSessionId(sessionId);
args.setBlockId(blockId);
args.setOptions(options);
sendBase("cancelBlock", args);
}
public CancelBlockTResponse recv_cancelBlock() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
cancelBlock_result result = new cancelBlock_result();
receiveBase(result, "cancelBlock");
if (result.isSetSuccess()) {
return result.success;
}
if (result.e != null) {
throw result.e;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "cancelBlock failed: unknown result");
}
public LockBlockTResponse lockBlock(long blockId, long sessionId, LockBlockTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_lockBlock(blockId, sessionId, options);
return recv_lockBlock();
}
public void send_lockBlock(long blockId, long sessionId, LockBlockTOptions options) throws org.apache.thrift.TException
{
lockBlock_args args = new lockBlock_args();
args.setBlockId(blockId);
args.setSessionId(sessionId);
args.setOptions(options);
sendBase("lockBlock", args);
}
public LockBlockTResponse recv_lockBlock() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
lockBlock_result result = new lockBlock_result();
receiveBase(result, "lockBlock");
if (result.isSetSuccess()) {
return result.success;
}
if (result.e != null) {
throw result.e;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "lockBlock failed: unknown result");
}
public PromoteBlockTResponse promoteBlock(long blockId, PromoteBlockTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_promoteBlock(blockId, options);
return recv_promoteBlock();
}
public void send_promoteBlock(long blockId, PromoteBlockTOptions options) throws org.apache.thrift.TException
{
promoteBlock_args args = new promoteBlock_args();
args.setBlockId(blockId);
args.setOptions(options);
sendBase("promoteBlock", args);
}
public PromoteBlockTResponse recv_promoteBlock() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
promoteBlock_result result = new promoteBlock_result();
receiveBase(result, "promoteBlock");
if (result.isSetSuccess()) {
return result.success;
}
if (result.e != null) {
throw result.e;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "promoteBlock failed: unknown result");
}
public RemoveBlockTResponse removeBlock(long blockId, RemoveBlockTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_removeBlock(blockId, options);
return recv_removeBlock();
}
public void send_removeBlock(long blockId, RemoveBlockTOptions options) throws org.apache.thrift.TException
{
removeBlock_args args = new removeBlock_args();
args.setBlockId(blockId);
args.setOptions(options);
sendBase("removeBlock", args);
}
public RemoveBlockTResponse recv_removeBlock() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
removeBlock_result result = new removeBlock_result();
receiveBase(result, "removeBlock");
if (result.isSetSuccess()) {
return result.success;
}
if (result.e != null) {
throw result.e;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "removeBlock failed: unknown result");
}
public RequestBlockLocationTResponse requestBlockLocation(long sessionId, long blockId, long initialBytes, int writeTier, RequestBlockLocationTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_requestBlockLocation(sessionId, blockId, initialBytes, writeTier, options);
return recv_requestBlockLocation();
}
public void send_requestBlockLocation(long sessionId, long blockId, long initialBytes, int writeTier, RequestBlockLocationTOptions options) throws org.apache.thrift.TException
{
requestBlockLocation_args args = new requestBlockLocation_args();
args.setSessionId(sessionId);
args.setBlockId(blockId);
args.setInitialBytes(initialBytes);
args.setWriteTier(writeTier);
args.setOptions(options);
sendBase("requestBlockLocation", args);
}
public RequestBlockLocationTResponse recv_requestBlockLocation() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
requestBlockLocation_result result = new requestBlockLocation_result();
receiveBase(result, "requestBlockLocation");
if (result.isSetSuccess()) {
return result.success;
}
if (result.e != null) {
throw result.e;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "requestBlockLocation failed: unknown result");
}
public RequestSpaceTResponse requestSpace(long sessionId, long blockId, long requestBytes, RequestSpaceTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_requestSpace(sessionId, blockId, requestBytes, options);
return recv_requestSpace();
}
public void send_requestSpace(long sessionId, long blockId, long requestBytes, RequestSpaceTOptions options) throws org.apache.thrift.TException
{
requestSpace_args args = new requestSpace_args();
args.setSessionId(sessionId);
args.setBlockId(blockId);
args.setRequestBytes(requestBytes);
args.setOptions(options);
sendBase("requestSpace", args);
}
public RequestSpaceTResponse recv_requestSpace() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
requestSpace_result result = new requestSpace_result();
receiveBase(result, "requestSpace");
if (result.isSetSuccess()) {
return result.success;
}
if (result.e != null) {
throw result.e;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "requestSpace failed: unknown result");
}
public SessionBlockHeartbeatTResponse sessionBlockHeartbeat(long sessionId, List<Long> metrics, SessionBlockHeartbeatTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_sessionBlockHeartbeat(sessionId, metrics, options);
return recv_sessionBlockHeartbeat();
}
public void send_sessionBlockHeartbeat(long sessionId, List<Long> metrics, SessionBlockHeartbeatTOptions options) throws org.apache.thrift.TException
{
sessionBlockHeartbeat_args args = new sessionBlockHeartbeat_args();
args.setSessionId(sessionId);
args.setMetrics(metrics);
args.setOptions(options);
sendBase("sessionBlockHeartbeat", args);
}
public SessionBlockHeartbeatTResponse recv_sessionBlockHeartbeat() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
sessionBlockHeartbeat_result result = new sessionBlockHeartbeat_result();
receiveBase(result, "sessionBlockHeartbeat");
if (result.isSetSuccess()) {
return result.success;
}
if (result.e != null) {
throw result.e;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "sessionBlockHeartbeat failed: unknown result");
}
public UnlockBlockTResponse unlockBlock(long blockId, long sessionId, UnlockBlockTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_unlockBlock(blockId, sessionId, options);
return recv_unlockBlock();
}
public void send_unlockBlock(long blockId, long sessionId, UnlockBlockTOptions options) throws org.apache.thrift.TException
{
unlockBlock_args args = new unlockBlock_args();
args.setBlockId(blockId);
args.setSessionId(sessionId);
args.setOptions(options);
sendBase("unlockBlock", args);
}
public UnlockBlockTResponse recv_unlockBlock() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
unlockBlock_result result = new unlockBlock_result();
receiveBase(result, "unlockBlock");
if (result.isSetSuccess()) {
return result.success;
}
if (result.e != null) {
throw result.e;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "unlockBlock failed: unknown result");
}
}
public static class AsyncClient extends alluxio.thrift.AlluxioService.AsyncClient 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 accessBlock(long blockId, AccessBlockTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
accessBlock_call method_call = new accessBlock_call(blockId, options, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class accessBlock_call extends org.apache.thrift.async.TAsyncMethodCall {
private long blockId;
private AccessBlockTOptions options;
public accessBlock_call(long blockId, AccessBlockTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.blockId = blockId;
this.options = options;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("accessBlock", org.apache.thrift.protocol.TMessageType.CALL, 0));
accessBlock_args args = new accessBlock_args();
args.setBlockId(blockId);
args.setOptions(options);
args.write(prot);
prot.writeMessageEnd();
}
public AccessBlockTResponse getResult() throws alluxio.thrift.AlluxioTException, 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_accessBlock();
}
}
public void cacheBlock(long sessionId, long blockId, CacheBlockTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
cacheBlock_call method_call = new cacheBlock_call(sessionId, blockId, options, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class cacheBlock_call extends org.apache.thrift.async.TAsyncMethodCall {
private long sessionId;
private long blockId;
private CacheBlockTOptions options;
public cacheBlock_call(long sessionId, long blockId, CacheBlockTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.sessionId = sessionId;
this.blockId = blockId;
this.options = options;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("cacheBlock", org.apache.thrift.protocol.TMessageType.CALL, 0));
cacheBlock_args args = new cacheBlock_args();
args.setSessionId(sessionId);
args.setBlockId(blockId);
args.setOptions(options);
args.write(prot);
prot.writeMessageEnd();
}
public CacheBlockTResponse getResult() throws alluxio.thrift.AlluxioTException, 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_cacheBlock();
}
}
public void cancelBlock(long sessionId, long blockId, CancelBlockTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
cancelBlock_call method_call = new cancelBlock_call(sessionId, blockId, options, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class cancelBlock_call extends org.apache.thrift.async.TAsyncMethodCall {
private long sessionId;
private long blockId;
private CancelBlockTOptions options;
public cancelBlock_call(long sessionId, long blockId, CancelBlockTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.sessionId = sessionId;
this.blockId = blockId;
this.options = options;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("cancelBlock", org.apache.thrift.protocol.TMessageType.CALL, 0));
cancelBlock_args args = new cancelBlock_args();
args.setSessionId(sessionId);
args.setBlockId(blockId);
args.setOptions(options);
args.write(prot);
prot.writeMessageEnd();
}
public CancelBlockTResponse getResult() throws alluxio.thrift.AlluxioTException, 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_cancelBlock();
}
}
public void lockBlock(long blockId, long sessionId, LockBlockTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
lockBlock_call method_call = new lockBlock_call(blockId, sessionId, options, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class lockBlock_call extends org.apache.thrift.async.TAsyncMethodCall {
private long blockId;
private long sessionId;
private LockBlockTOptions options;
public lockBlock_call(long blockId, long sessionId, LockBlockTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.blockId = blockId;
this.sessionId = sessionId;
this.options = options;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("lockBlock", org.apache.thrift.protocol.TMessageType.CALL, 0));
lockBlock_args args = new lockBlock_args();
args.setBlockId(blockId);
args.setSessionId(sessionId);
args.setOptions(options);
args.write(prot);
prot.writeMessageEnd();
}
public LockBlockTResponse getResult() throws alluxio.thrift.AlluxioTException, 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_lockBlock();
}
}
public void promoteBlock(long blockId, PromoteBlockTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
promoteBlock_call method_call = new promoteBlock_call(blockId, options, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class promoteBlock_call extends org.apache.thrift.async.TAsyncMethodCall {
private long blockId;
private PromoteBlockTOptions options;
public promoteBlock_call(long blockId, PromoteBlockTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.blockId = blockId;
this.options = options;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("promoteBlock", org.apache.thrift.protocol.TMessageType.CALL, 0));
promoteBlock_args args = new promoteBlock_args();
args.setBlockId(blockId);
args.setOptions(options);
args.write(prot);
prot.writeMessageEnd();
}
public PromoteBlockTResponse getResult() throws alluxio.thrift.AlluxioTException, 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_promoteBlock();
}
}
public void removeBlock(long blockId, RemoveBlockTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
removeBlock_call method_call = new removeBlock_call(blockId, options, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class removeBlock_call extends org.apache.thrift.async.TAsyncMethodCall {
private long blockId;
private RemoveBlockTOptions options;
public removeBlock_call(long blockId, RemoveBlockTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.blockId = blockId;
this.options = options;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("removeBlock", org.apache.thrift.protocol.TMessageType.CALL, 0));
removeBlock_args args = new removeBlock_args();
args.setBlockId(blockId);
args.setOptions(options);
args.write(prot);
prot.writeMessageEnd();
}
public RemoveBlockTResponse getResult() throws alluxio.thrift.AlluxioTException, 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_removeBlock();
}
}
public void requestBlockLocation(long sessionId, long blockId, long initialBytes, int writeTier, RequestBlockLocationTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
requestBlockLocation_call method_call = new requestBlockLocation_call(sessionId, blockId, initialBytes, writeTier, options, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class requestBlockLocation_call extends org.apache.thrift.async.TAsyncMethodCall {
private long sessionId;
private long blockId;
private long initialBytes;
private int writeTier;
private RequestBlockLocationTOptions options;
public requestBlockLocation_call(long sessionId, long blockId, long initialBytes, int writeTier, RequestBlockLocationTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.sessionId = sessionId;
this.blockId = blockId;
this.initialBytes = initialBytes;
this.writeTier = writeTier;
this.options = options;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("requestBlockLocation", org.apache.thrift.protocol.TMessageType.CALL, 0));
requestBlockLocation_args args = new requestBlockLocation_args();
args.setSessionId(sessionId);
args.setBlockId(blockId);
args.setInitialBytes(initialBytes);
args.setWriteTier(writeTier);
args.setOptions(options);
args.write(prot);
prot.writeMessageEnd();
}
public RequestBlockLocationTResponse getResult() throws alluxio.thrift.AlluxioTException, 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_requestBlockLocation();
}
}
public void requestSpace(long sessionId, long blockId, long requestBytes, RequestSpaceTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
requestSpace_call method_call = new requestSpace_call(sessionId, blockId, requestBytes, options, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class requestSpace_call extends org.apache.thrift.async.TAsyncMethodCall {
private long sessionId;
private long blockId;
private long requestBytes;
private RequestSpaceTOptions options;
public requestSpace_call(long sessionId, long blockId, long requestBytes, RequestSpaceTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.sessionId = sessionId;
this.blockId = blockId;
this.requestBytes = requestBytes;
this.options = options;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("requestSpace", org.apache.thrift.protocol.TMessageType.CALL, 0));
requestSpace_args args = new requestSpace_args();
args.setSessionId(sessionId);
args.setBlockId(blockId);
args.setRequestBytes(requestBytes);
args.setOptions(options);
args.write(prot);
prot.writeMessageEnd();
}
public RequestSpaceTResponse getResult() throws alluxio.thrift.AlluxioTException, 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_requestSpace();
}
}
public void sessionBlockHeartbeat(long sessionId, List<Long> metrics, SessionBlockHeartbeatTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
sessionBlockHeartbeat_call method_call = new sessionBlockHeartbeat_call(sessionId, metrics, options, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class sessionBlockHeartbeat_call extends org.apache.thrift.async.TAsyncMethodCall {
private long sessionId;
private List<Long> metrics;
private SessionBlockHeartbeatTOptions options;
public sessionBlockHeartbeat_call(long sessionId, List<Long> metrics, SessionBlockHeartbeatTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.sessionId = sessionId;
this.metrics = metrics;
this.options = options;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("sessionBlockHeartbeat", org.apache.thrift.protocol.TMessageType.CALL, 0));
sessionBlockHeartbeat_args args = new sessionBlockHeartbeat_args();
args.setSessionId(sessionId);
args.setMetrics(metrics);
args.setOptions(options);
args.write(prot);
prot.writeMessageEnd();
}
public SessionBlockHeartbeatTResponse getResult() throws alluxio.thrift.AlluxioTException, 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_sessionBlockHeartbeat();
}
}
public void unlockBlock(long blockId, long sessionId, UnlockBlockTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
unlockBlock_call method_call = new unlockBlock_call(blockId, sessionId, options, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class unlockBlock_call extends org.apache.thrift.async.TAsyncMethodCall {
private long blockId;
private long sessionId;
private UnlockBlockTOptions options;
public unlockBlock_call(long blockId, long sessionId, UnlockBlockTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.blockId = blockId;
this.sessionId = sessionId;
this.options = options;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("unlockBlock", org.apache.thrift.protocol.TMessageType.CALL, 0));
unlockBlock_args args = new unlockBlock_args();
args.setBlockId(blockId);
args.setSessionId(sessionId);
args.setOptions(options);
args.write(prot);
prot.writeMessageEnd();
}
public UnlockBlockTResponse getResult() throws alluxio.thrift.AlluxioTException, 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_unlockBlock();
}
}
}
public static class Processor<I extends Iface> extends alluxio.thrift.AlluxioService.Processor<I> 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("accessBlock", new accessBlock());
processMap.put("cacheBlock", new cacheBlock());
processMap.put("cancelBlock", new cancelBlock());
processMap.put("lockBlock", new lockBlock());
processMap.put("promoteBlock", new promoteBlock());
processMap.put("removeBlock", new removeBlock());
processMap.put("requestBlockLocation", new requestBlockLocation());
processMap.put("requestSpace", new requestSpace());
processMap.put("sessionBlockHeartbeat", new sessionBlockHeartbeat());
processMap.put("unlockBlock", new unlockBlock());
return processMap;
}
public static class accessBlock<I extends Iface> extends org.apache.thrift.ProcessFunction<I, accessBlock_args> {
public accessBlock() {
super("accessBlock");
}
public accessBlock_args getEmptyArgsInstance() {
return new accessBlock_args();
}
protected boolean isOneway() {
return false;
}
public accessBlock_result getResult(I iface, accessBlock_args args) throws org.apache.thrift.TException {
accessBlock_result result = new accessBlock_result();
try {
result.success = iface.accessBlock(args.blockId, args.options);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class cacheBlock<I extends Iface> extends org.apache.thrift.ProcessFunction<I, cacheBlock_args> {
public cacheBlock() {
super("cacheBlock");
}
public cacheBlock_args getEmptyArgsInstance() {
return new cacheBlock_args();
}
protected boolean isOneway() {
return false;
}
public cacheBlock_result getResult(I iface, cacheBlock_args args) throws org.apache.thrift.TException {
cacheBlock_result result = new cacheBlock_result();
try {
result.success = iface.cacheBlock(args.sessionId, args.blockId, args.options);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class cancelBlock<I extends Iface> extends org.apache.thrift.ProcessFunction<I, cancelBlock_args> {
public cancelBlock() {
super("cancelBlock");
}
public cancelBlock_args getEmptyArgsInstance() {
return new cancelBlock_args();
}
protected boolean isOneway() {
return false;
}
public cancelBlock_result getResult(I iface, cancelBlock_args args) throws org.apache.thrift.TException {
cancelBlock_result result = new cancelBlock_result();
try {
result.success = iface.cancelBlock(args.sessionId, args.blockId, args.options);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class lockBlock<I extends Iface> extends org.apache.thrift.ProcessFunction<I, lockBlock_args> {
public lockBlock() {
super("lockBlock");
}
public lockBlock_args getEmptyArgsInstance() {
return new lockBlock_args();
}
protected boolean isOneway() {
return false;
}
public lockBlock_result getResult(I iface, lockBlock_args args) throws org.apache.thrift.TException {
lockBlock_result result = new lockBlock_result();
try {
result.success = iface.lockBlock(args.blockId, args.sessionId, args.options);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class promoteBlock<I extends Iface> extends org.apache.thrift.ProcessFunction<I, promoteBlock_args> {
public promoteBlock() {
super("promoteBlock");
}
public promoteBlock_args getEmptyArgsInstance() {
return new promoteBlock_args();
}
protected boolean isOneway() {
return false;
}
public promoteBlock_result getResult(I iface, promoteBlock_args args) throws org.apache.thrift.TException {
promoteBlock_result result = new promoteBlock_result();
try {
result.success = iface.promoteBlock(args.blockId, args.options);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class removeBlock<I extends Iface> extends org.apache.thrift.ProcessFunction<I, removeBlock_args> {
public removeBlock() {
super("removeBlock");
}
public removeBlock_args getEmptyArgsInstance() {
return new removeBlock_args();
}
protected boolean isOneway() {
return false;
}
public removeBlock_result getResult(I iface, removeBlock_args args) throws org.apache.thrift.TException {
removeBlock_result result = new removeBlock_result();
try {
result.success = iface.removeBlock(args.blockId, args.options);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class requestBlockLocation<I extends Iface> extends org.apache.thrift.ProcessFunction<I, requestBlockLocation_args> {
public requestBlockLocation() {
super("requestBlockLocation");
}
public requestBlockLocation_args getEmptyArgsInstance() {
return new requestBlockLocation_args();
}
protected boolean isOneway() {
return false;
}
public requestBlockLocation_result getResult(I iface, requestBlockLocation_args args) throws org.apache.thrift.TException {
requestBlockLocation_result result = new requestBlockLocation_result();
try {
result.success = iface.requestBlockLocation(args.sessionId, args.blockId, args.initialBytes, args.writeTier, args.options);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class requestSpace<I extends Iface> extends org.apache.thrift.ProcessFunction<I, requestSpace_args> {
public requestSpace() {
super("requestSpace");
}
public requestSpace_args getEmptyArgsInstance() {
return new requestSpace_args();
}
protected boolean isOneway() {
return false;
}
public requestSpace_result getResult(I iface, requestSpace_args args) throws org.apache.thrift.TException {
requestSpace_result result = new requestSpace_result();
try {
result.success = iface.requestSpace(args.sessionId, args.blockId, args.requestBytes, args.options);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class sessionBlockHeartbeat<I extends Iface> extends org.apache.thrift.ProcessFunction<I, sessionBlockHeartbeat_args> {
public sessionBlockHeartbeat() {
super("sessionBlockHeartbeat");
}
public sessionBlockHeartbeat_args getEmptyArgsInstance() {
return new sessionBlockHeartbeat_args();
}
protected boolean isOneway() {
return false;
}
public sessionBlockHeartbeat_result getResult(I iface, sessionBlockHeartbeat_args args) throws org.apache.thrift.TException {
sessionBlockHeartbeat_result result = new sessionBlockHeartbeat_result();
try {
result.success = iface.sessionBlockHeartbeat(args.sessionId, args.metrics, args.options);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class unlockBlock<I extends Iface> extends org.apache.thrift.ProcessFunction<I, unlockBlock_args> {
public unlockBlock() {
super("unlockBlock");
}
public unlockBlock_args getEmptyArgsInstance() {
return new unlockBlock_args();
}
protected boolean isOneway() {
return false;
}
public unlockBlock_result getResult(I iface, unlockBlock_args args) throws org.apache.thrift.TException {
unlockBlock_result result = new unlockBlock_result();
try {
result.success = iface.unlockBlock(args.blockId, args.sessionId, args.options);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
}
public static class AsyncProcessor<I extends AsyncIface> extends alluxio.thrift.AlluxioService.AsyncProcessor<I> {
private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
public AsyncProcessor(I iface) {
super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
}
protected AsyncProcessor(I iface, Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
super(iface, getProcessMap(processMap));
}
private static <I extends AsyncIface> Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase,?>> getProcessMap(Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
processMap.put("accessBlock", new accessBlock());
processMap.put("cacheBlock", new cacheBlock());
processMap.put("cancelBlock", new cancelBlock());
processMap.put("lockBlock", new lockBlock());
processMap.put("promoteBlock", new promoteBlock());
processMap.put("removeBlock", new removeBlock());
processMap.put("requestBlockLocation", new requestBlockLocation());
processMap.put("requestSpace", new requestSpace());
processMap.put("sessionBlockHeartbeat", new sessionBlockHeartbeat());
processMap.put("unlockBlock", new unlockBlock());
return processMap;
}
public static class accessBlock<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, accessBlock_args, AccessBlockTResponse> {
public accessBlock() {
super("accessBlock");
}
public accessBlock_args getEmptyArgsInstance() {
return new accessBlock_args();
}
public AsyncMethodCallback<AccessBlockTResponse> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<AccessBlockTResponse>() {
public void onComplete(AccessBlockTResponse o) {
accessBlock_result result = new accessBlock_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
accessBlock_result result = new accessBlock_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, accessBlock_args args, org.apache.thrift.async.AsyncMethodCallback<AccessBlockTResponse> resultHandler) throws TException {
iface.accessBlock(args.blockId, args.options,resultHandler);
}
}
public static class cacheBlock<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, cacheBlock_args, CacheBlockTResponse> {
public cacheBlock() {
super("cacheBlock");
}
public cacheBlock_args getEmptyArgsInstance() {
return new cacheBlock_args();
}
public AsyncMethodCallback<CacheBlockTResponse> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<CacheBlockTResponse>() {
public void onComplete(CacheBlockTResponse o) {
cacheBlock_result result = new cacheBlock_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
cacheBlock_result result = new cacheBlock_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, cacheBlock_args args, org.apache.thrift.async.AsyncMethodCallback<CacheBlockTResponse> resultHandler) throws TException {
iface.cacheBlock(args.sessionId, args.blockId, args.options,resultHandler);
}
}
public static class cancelBlock<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, cancelBlock_args, CancelBlockTResponse> {
public cancelBlock() {
super("cancelBlock");
}
public cancelBlock_args getEmptyArgsInstance() {
return new cancelBlock_args();
}
public AsyncMethodCallback<CancelBlockTResponse> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<CancelBlockTResponse>() {
public void onComplete(CancelBlockTResponse o) {
cancelBlock_result result = new cancelBlock_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
cancelBlock_result result = new cancelBlock_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, cancelBlock_args args, org.apache.thrift.async.AsyncMethodCallback<CancelBlockTResponse> resultHandler) throws TException {
iface.cancelBlock(args.sessionId, args.blockId, args.options,resultHandler);
}
}
public static class lockBlock<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, lockBlock_args, LockBlockTResponse> {
public lockBlock() {
super("lockBlock");
}
public lockBlock_args getEmptyArgsInstance() {
return new lockBlock_args();
}
public AsyncMethodCallback<LockBlockTResponse> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<LockBlockTResponse>() {
public void onComplete(LockBlockTResponse o) {
lockBlock_result result = new lockBlock_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
lockBlock_result result = new lockBlock_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, lockBlock_args args, org.apache.thrift.async.AsyncMethodCallback<LockBlockTResponse> resultHandler) throws TException {
iface.lockBlock(args.blockId, args.sessionId, args.options,resultHandler);
}
}
public static class promoteBlock<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, promoteBlock_args, PromoteBlockTResponse> {
public promoteBlock() {
super("promoteBlock");
}
public promoteBlock_args getEmptyArgsInstance() {
return new promoteBlock_args();
}
public AsyncMethodCallback<PromoteBlockTResponse> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<PromoteBlockTResponse>() {
public void onComplete(PromoteBlockTResponse o) {
promoteBlock_result result = new promoteBlock_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
promoteBlock_result result = new promoteBlock_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, promoteBlock_args args, org.apache.thrift.async.AsyncMethodCallback<PromoteBlockTResponse> resultHandler) throws TException {
iface.promoteBlock(args.blockId, args.options,resultHandler);
}
}
public static class removeBlock<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, removeBlock_args, RemoveBlockTResponse> {
public removeBlock() {
super("removeBlock");
}
public removeBlock_args getEmptyArgsInstance() {
return new removeBlock_args();
}
public AsyncMethodCallback<RemoveBlockTResponse> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<RemoveBlockTResponse>() {
public void onComplete(RemoveBlockTResponse o) {
removeBlock_result result = new removeBlock_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
removeBlock_result result = new removeBlock_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, removeBlock_args args, org.apache.thrift.async.AsyncMethodCallback<RemoveBlockTResponse> resultHandler) throws TException {
iface.removeBlock(args.blockId, args.options,resultHandler);
}
}
public static class requestBlockLocation<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, requestBlockLocation_args, RequestBlockLocationTResponse> {
public requestBlockLocation() {
super("requestBlockLocation");
}
public requestBlockLocation_args getEmptyArgsInstance() {
return new requestBlockLocation_args();
}
public AsyncMethodCallback<RequestBlockLocationTResponse> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<RequestBlockLocationTResponse>() {
public void onComplete(RequestBlockLocationTResponse o) {
requestBlockLocation_result result = new requestBlockLocation_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
requestBlockLocation_result result = new requestBlockLocation_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, requestBlockLocation_args args, org.apache.thrift.async.AsyncMethodCallback<RequestBlockLocationTResponse> resultHandler) throws TException {
iface.requestBlockLocation(args.sessionId, args.blockId, args.initialBytes, args.writeTier, args.options,resultHandler);
}
}
public static class requestSpace<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, requestSpace_args, RequestSpaceTResponse> {
public requestSpace() {
super("requestSpace");
}
public requestSpace_args getEmptyArgsInstance() {
return new requestSpace_args();
}
public AsyncMethodCallback<RequestSpaceTResponse> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<RequestSpaceTResponse>() {
public void onComplete(RequestSpaceTResponse o) {
requestSpace_result result = new requestSpace_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
requestSpace_result result = new requestSpace_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, requestSpace_args args, org.apache.thrift.async.AsyncMethodCallback<RequestSpaceTResponse> resultHandler) throws TException {
iface.requestSpace(args.sessionId, args.blockId, args.requestBytes, args.options,resultHandler);
}
}
public static class sessionBlockHeartbeat<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, sessionBlockHeartbeat_args, SessionBlockHeartbeatTResponse> {
public sessionBlockHeartbeat() {
super("sessionBlockHeartbeat");
}
public sessionBlockHeartbeat_args getEmptyArgsInstance() {
return new sessionBlockHeartbeat_args();
}
public AsyncMethodCallback<SessionBlockHeartbeatTResponse> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<SessionBlockHeartbeatTResponse>() {
public void onComplete(SessionBlockHeartbeatTResponse o) {
sessionBlockHeartbeat_result result = new sessionBlockHeartbeat_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
sessionBlockHeartbeat_result result = new sessionBlockHeartbeat_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, sessionBlockHeartbeat_args args, org.apache.thrift.async.AsyncMethodCallback<SessionBlockHeartbeatTResponse> resultHandler) throws TException {
iface.sessionBlockHeartbeat(args.sessionId, args.metrics, args.options,resultHandler);
}
}
public static class unlockBlock<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, unlockBlock_args, UnlockBlockTResponse> {
public unlockBlock() {
super("unlockBlock");
}
public unlockBlock_args getEmptyArgsInstance() {
return new unlockBlock_args();
}
public AsyncMethodCallback<UnlockBlockTResponse> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<UnlockBlockTResponse>() {
public void onComplete(UnlockBlockTResponse o) {
unlockBlock_result result = new unlockBlock_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
unlockBlock_result result = new unlockBlock_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, unlockBlock_args args, org.apache.thrift.async.AsyncMethodCallback<UnlockBlockTResponse> resultHandler) throws TException {
iface.unlockBlock(args.blockId, args.sessionId, args.options,resultHandler);
}
}
}
public static class accessBlock_args implements org.apache.thrift.TBase<accessBlock_args, accessBlock_args._Fields>, java.io.Serializable, Cloneable, Comparable<accessBlock_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("accessBlock_args");
private static final org.apache.thrift.protocol.TField BLOCK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("blockId", org.apache.thrift.protocol.TType.I64, (short)1);
private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("options", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new accessBlock_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new accessBlock_argsTupleSchemeFactory());
}
private long blockId; // required
private AccessBlockTOptions options; // 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 {
/**
* the id of the block being accessed
*/
BLOCK_ID((short)1, "blockId"),
/**
* the method options
*/
OPTIONS((short)2, "options");
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: // BLOCK_ID
return BLOCK_ID;
case 2: // OPTIONS
return OPTIONS;
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 __BLOCKID_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.BLOCK_ID, new org.apache.thrift.meta_data.FieldMetaData("blockId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("options", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, AccessBlockTOptions.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(accessBlock_args.class, metaDataMap);
}
public accessBlock_args() {
}
public accessBlock_args(
long blockId,
AccessBlockTOptions options)
{
this();
this.blockId = blockId;
setBlockIdIsSet(true);
this.options = options;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public accessBlock_args(accessBlock_args other) {
__isset_bitfield = other.__isset_bitfield;
this.blockId = other.blockId;
if (other.isSetOptions()) {
this.options = new AccessBlockTOptions(other.options);
}
}
public accessBlock_args deepCopy() {
return new accessBlock_args(this);
}
@Override
public void clear() {
setBlockIdIsSet(false);
this.blockId = 0;
this.options = null;
}
/**
* the id of the block being accessed
*/
public long getBlockId() {
return this.blockId;
}
/**
* the id of the block being accessed
*/
public accessBlock_args setBlockId(long blockId) {
this.blockId = blockId;
setBlockIdIsSet(true);
return this;
}
public void unsetBlockId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKID_ISSET_ID);
}
/** Returns true if field blockId is set (has been assigned a value) and false otherwise */
public boolean isSetBlockId() {
return EncodingUtils.testBit(__isset_bitfield, __BLOCKID_ISSET_ID);
}
public void setBlockIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKID_ISSET_ID, value);
}
/**
* the method options
*/
public AccessBlockTOptions getOptions() {
return this.options;
}
/**
* the method options
*/
public accessBlock_args setOptions(AccessBlockTOptions options) {
this.options = options;
return this;
}
public void unsetOptions() {
this.options = null;
}
/** Returns true if field options is set (has been assigned a value) and false otherwise */
public boolean isSetOptions() {
return this.options != null;
}
public void setOptionsIsSet(boolean value) {
if (!value) {
this.options = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case BLOCK_ID:
if (value == null) {
unsetBlockId();
} else {
setBlockId((Long)value);
}
break;
case OPTIONS:
if (value == null) {
unsetOptions();
} else {
setOptions((AccessBlockTOptions)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case BLOCK_ID:
return getBlockId();
case OPTIONS:
return getOptions();
}
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 BLOCK_ID:
return isSetBlockId();
case OPTIONS:
return isSetOptions();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof accessBlock_args)
return this.equals((accessBlock_args)that);
return false;
}
public boolean equals(accessBlock_args that) {
if (that == null)
return false;
boolean this_present_blockId = true;
boolean that_present_blockId = true;
if (this_present_blockId || that_present_blockId) {
if (!(this_present_blockId && that_present_blockId))
return false;
if (this.blockId != that.blockId)
return false;
}
boolean this_present_options = true && this.isSetOptions();
boolean that_present_options = true && that.isSetOptions();
if (this_present_options || that_present_options) {
if (!(this_present_options && that_present_options))
return false;
if (!this.options.equals(that.options))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_blockId = true;
list.add(present_blockId);
if (present_blockId)
list.add(blockId);
boolean present_options = true && (isSetOptions());
list.add(present_options);
if (present_options)
list.add(options);
return list.hashCode();
}
@Override
public int compareTo(accessBlock_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetBlockId()).compareTo(other.isSetBlockId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetBlockId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockId, other.blockId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetOptions()).compareTo(other.isSetOptions());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOptions()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, other.options);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("accessBlock_args(");
boolean first = true;
sb.append("blockId:");
sb.append(this.blockId);
first = false;
if (!first) sb.append(", ");
sb.append("options:");
if (this.options == null) {
sb.append("null");
} else {
sb.append(this.options);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (options != null) {
options.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class accessBlock_argsStandardSchemeFactory implements SchemeFactory {
public accessBlock_argsStandardScheme getScheme() {
return new accessBlock_argsStandardScheme();
}
}
private static class accessBlock_argsStandardScheme extends StandardScheme<accessBlock_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, accessBlock_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // BLOCK_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // OPTIONS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.options = new AccessBlockTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, accessBlock_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC);
oprot.writeI64(struct.blockId);
oprot.writeFieldEnd();
if (struct.options != null) {
oprot.writeFieldBegin(OPTIONS_FIELD_DESC);
struct.options.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class accessBlock_argsTupleSchemeFactory implements SchemeFactory {
public accessBlock_argsTupleScheme getScheme() {
return new accessBlock_argsTupleScheme();
}
}
private static class accessBlock_argsTupleScheme extends TupleScheme<accessBlock_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, accessBlock_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetBlockId()) {
optionals.set(0);
}
if (struct.isSetOptions()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetBlockId()) {
oprot.writeI64(struct.blockId);
}
if (struct.isSetOptions()) {
struct.options.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, accessBlock_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(true);
}
if (incoming.get(1)) {
struct.options = new AccessBlockTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
}
}
}
}
public static class accessBlock_result implements org.apache.thrift.TBase<accessBlock_result, accessBlock_result._Fields>, java.io.Serializable, Cloneable, Comparable<accessBlock_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("accessBlock_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 E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new accessBlock_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new accessBlock_resultTupleSchemeFactory());
}
private AccessBlockTResponse success; // required
private alluxio.thrift.AlluxioTException e; // 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"),
E((short)1, "e");
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: // E
return E;
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, AccessBlockTResponse.class)));
tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", 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(accessBlock_result.class, metaDataMap);
}
public accessBlock_result() {
}
public accessBlock_result(
AccessBlockTResponse success,
alluxio.thrift.AlluxioTException e)
{
this();
this.success = success;
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public accessBlock_result(accessBlock_result other) {
if (other.isSetSuccess()) {
this.success = new AccessBlockTResponse(other.success);
}
if (other.isSetE()) {
this.e = new alluxio.thrift.AlluxioTException(other.e);
}
}
public accessBlock_result deepCopy() {
return new accessBlock_result(this);
}
@Override
public void clear() {
this.success = null;
this.e = null;
}
public AccessBlockTResponse getSuccess() {
return this.success;
}
public accessBlock_result setSuccess(AccessBlockTResponse 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 alluxio.thrift.AlluxioTException getE() {
return this.e;
}
public accessBlock_result setE(alluxio.thrift.AlluxioTException e) {
this.e = e;
return this;
}
public void unsetE() {
this.e = null;
}
/** Returns true if field e is set (has been assigned a value) and false otherwise */
public boolean isSetE() {
return this.e != null;
}
public void setEIsSet(boolean value) {
if (!value) {
this.e = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((AccessBlockTResponse)value);
}
break;
case E:
if (value == null) {
unsetE();
} else {
setE((alluxio.thrift.AlluxioTException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case E:
return getE();
}
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 E:
return isSetE();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof accessBlock_result)
return this.equals((accessBlock_result)that);
return false;
}
public boolean equals(accessBlock_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_e = true && this.isSetE();
boolean that_present_e = true && that.isSetE();
if (this_present_e || that_present_e) {
if (!(this_present_e && that_present_e))
return false;
if (!this.e.equals(that.e))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_success = true && (isSetSuccess());
list.add(present_success);
if (present_success)
list.add(success);
boolean present_e = true && (isSetE());
list.add(present_e);
if (present_e)
list.add(e);
return list.hashCode();
}
@Override
public int compareTo(accessBlock_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetE()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("accessBlock_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("e:");
if (this.e == null) {
sb.append("null");
} else {
sb.append(this.e);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (success != null) {
success.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class accessBlock_resultStandardSchemeFactory implements SchemeFactory {
public accessBlock_resultStandardScheme getScheme() {
return new accessBlock_resultStandardScheme();
}
}
private static class accessBlock_resultStandardScheme extends StandardScheme<accessBlock_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, accessBlock_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new AccessBlockTResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // E
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, accessBlock_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.e != null) {
oprot.writeFieldBegin(E_FIELD_DESC);
struct.e.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class accessBlock_resultTupleSchemeFactory implements SchemeFactory {
public accessBlock_resultTupleScheme getScheme() {
return new accessBlock_resultTupleScheme();
}
}
private static class accessBlock_resultTupleScheme extends TupleScheme<accessBlock_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, accessBlock_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetE()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetE()) {
struct.e.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, accessBlock_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = new AccessBlockTResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
}
}
}
}
public static class cacheBlock_args implements org.apache.thrift.TBase<cacheBlock_args, cacheBlock_args._Fields>, java.io.Serializable, Cloneable, Comparable<cacheBlock_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("cacheBlock_args");
private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.I64, (short)1);
private static final org.apache.thrift.protocol.TField BLOCK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("blockId", org.apache.thrift.protocol.TType.I64, (short)2);
private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("options", org.apache.thrift.protocol.TType.STRUCT, (short)3);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new cacheBlock_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new cacheBlock_argsTupleSchemeFactory());
}
private long sessionId; // required
private long blockId; // required
private CacheBlockTOptions options; // 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 {
/**
* the id of the current session
*/
SESSION_ID((short)1, "sessionId"),
/**
* the id of the block being accessed
*/
BLOCK_ID((short)2, "blockId"),
/**
* the method options
*/
OPTIONS((short)3, "options");
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: // SESSION_ID
return SESSION_ID;
case 2: // BLOCK_ID
return BLOCK_ID;
case 3: // OPTIONS
return OPTIONS;
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 __SESSIONID_ISSET_ID = 0;
private static final int __BLOCKID_ISSET_ID = 1;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.BLOCK_ID, new org.apache.thrift.meta_data.FieldMetaData("blockId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("options", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CacheBlockTOptions.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(cacheBlock_args.class, metaDataMap);
}
public cacheBlock_args() {
}
public cacheBlock_args(
long sessionId,
long blockId,
CacheBlockTOptions options)
{
this();
this.sessionId = sessionId;
setSessionIdIsSet(true);
this.blockId = blockId;
setBlockIdIsSet(true);
this.options = options;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public cacheBlock_args(cacheBlock_args other) {
__isset_bitfield = other.__isset_bitfield;
this.sessionId = other.sessionId;
this.blockId = other.blockId;
if (other.isSetOptions()) {
this.options = new CacheBlockTOptions(other.options);
}
}
public cacheBlock_args deepCopy() {
return new cacheBlock_args(this);
}
@Override
public void clear() {
setSessionIdIsSet(false);
this.sessionId = 0;
setBlockIdIsSet(false);
this.blockId = 0;
this.options = null;
}
/**
* the id of the current session
*/
public long getSessionId() {
return this.sessionId;
}
/**
* the id of the current session
*/
public cacheBlock_args setSessionId(long sessionId) {
this.sessionId = sessionId;
setSessionIdIsSet(true);
return this;
}
public void unsetSessionId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SESSIONID_ISSET_ID);
}
/** Returns true if field sessionId is set (has been assigned a value) and false otherwise */
public boolean isSetSessionId() {
return EncodingUtils.testBit(__isset_bitfield, __SESSIONID_ISSET_ID);
}
public void setSessionIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SESSIONID_ISSET_ID, value);
}
/**
* the id of the block being accessed
*/
public long getBlockId() {
return this.blockId;
}
/**
* the id of the block being accessed
*/
public cacheBlock_args setBlockId(long blockId) {
this.blockId = blockId;
setBlockIdIsSet(true);
return this;
}
public void unsetBlockId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKID_ISSET_ID);
}
/** Returns true if field blockId is set (has been assigned a value) and false otherwise */
public boolean isSetBlockId() {
return EncodingUtils.testBit(__isset_bitfield, __BLOCKID_ISSET_ID);
}
public void setBlockIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKID_ISSET_ID, value);
}
/**
* the method options
*/
public CacheBlockTOptions getOptions() {
return this.options;
}
/**
* the method options
*/
public cacheBlock_args setOptions(CacheBlockTOptions options) {
this.options = options;
return this;
}
public void unsetOptions() {
this.options = null;
}
/** Returns true if field options is set (has been assigned a value) and false otherwise */
public boolean isSetOptions() {
return this.options != null;
}
public void setOptionsIsSet(boolean value) {
if (!value) {
this.options = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SESSION_ID:
if (value == null) {
unsetSessionId();
} else {
setSessionId((Long)value);
}
break;
case BLOCK_ID:
if (value == null) {
unsetBlockId();
} else {
setBlockId((Long)value);
}
break;
case OPTIONS:
if (value == null) {
unsetOptions();
} else {
setOptions((CacheBlockTOptions)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SESSION_ID:
return getSessionId();
case BLOCK_ID:
return getBlockId();
case OPTIONS:
return getOptions();
}
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 SESSION_ID:
return isSetSessionId();
case BLOCK_ID:
return isSetBlockId();
case OPTIONS:
return isSetOptions();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof cacheBlock_args)
return this.equals((cacheBlock_args)that);
return false;
}
public boolean equals(cacheBlock_args that) {
if (that == null)
return false;
boolean this_present_sessionId = true;
boolean that_present_sessionId = true;
if (this_present_sessionId || that_present_sessionId) {
if (!(this_present_sessionId && that_present_sessionId))
return false;
if (this.sessionId != that.sessionId)
return false;
}
boolean this_present_blockId = true;
boolean that_present_blockId = true;
if (this_present_blockId || that_present_blockId) {
if (!(this_present_blockId && that_present_blockId))
return false;
if (this.blockId != that.blockId)
return false;
}
boolean this_present_options = true && this.isSetOptions();
boolean that_present_options = true && that.isSetOptions();
if (this_present_options || that_present_options) {
if (!(this_present_options && that_present_options))
return false;
if (!this.options.equals(that.options))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_sessionId = true;
list.add(present_sessionId);
if (present_sessionId)
list.add(sessionId);
boolean present_blockId = true;
list.add(present_blockId);
if (present_blockId)
list.add(blockId);
boolean present_options = true && (isSetOptions());
list.add(present_options);
if (present_options)
list.add(options);
return list.hashCode();
}
@Override
public int compareTo(cacheBlock_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSessionId()).compareTo(other.isSetSessionId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSessionId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, other.sessionId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetBlockId()).compareTo(other.isSetBlockId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetBlockId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockId, other.blockId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetOptions()).compareTo(other.isSetOptions());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOptions()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, other.options);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("cacheBlock_args(");
boolean first = true;
sb.append("sessionId:");
sb.append(this.sessionId);
first = false;
if (!first) sb.append(", ");
sb.append("blockId:");
sb.append(this.blockId);
first = false;
if (!first) sb.append(", ");
sb.append("options:");
if (this.options == null) {
sb.append("null");
} else {
sb.append(this.options);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (options != null) {
options.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class cacheBlock_argsStandardSchemeFactory implements SchemeFactory {
public cacheBlock_argsStandardScheme getScheme() {
return new cacheBlock_argsStandardScheme();
}
}
private static class cacheBlock_argsStandardScheme extends StandardScheme<cacheBlock_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, cacheBlock_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // SESSION_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.sessionId = iprot.readI64();
struct.setSessionIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // BLOCK_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // OPTIONS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.options = new CacheBlockTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, cacheBlock_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(SESSION_ID_FIELD_DESC);
oprot.writeI64(struct.sessionId);
oprot.writeFieldEnd();
oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC);
oprot.writeI64(struct.blockId);
oprot.writeFieldEnd();
if (struct.options != null) {
oprot.writeFieldBegin(OPTIONS_FIELD_DESC);
struct.options.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class cacheBlock_argsTupleSchemeFactory implements SchemeFactory {
public cacheBlock_argsTupleScheme getScheme() {
return new cacheBlock_argsTupleScheme();
}
}
private static class cacheBlock_argsTupleScheme extends TupleScheme<cacheBlock_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, cacheBlock_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSessionId()) {
optionals.set(0);
}
if (struct.isSetBlockId()) {
optionals.set(1);
}
if (struct.isSetOptions()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetSessionId()) {
oprot.writeI64(struct.sessionId);
}
if (struct.isSetBlockId()) {
oprot.writeI64(struct.blockId);
}
if (struct.isSetOptions()) {
struct.options.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, cacheBlock_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.sessionId = iprot.readI64();
struct.setSessionIdIsSet(true);
}
if (incoming.get(1)) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(true);
}
if (incoming.get(2)) {
struct.options = new CacheBlockTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
}
}
}
}
public static class cacheBlock_result implements org.apache.thrift.TBase<cacheBlock_result, cacheBlock_result._Fields>, java.io.Serializable, Cloneable, Comparable<cacheBlock_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("cacheBlock_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 E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new cacheBlock_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new cacheBlock_resultTupleSchemeFactory());
}
private CacheBlockTResponse success; // required
private alluxio.thrift.AlluxioTException e; // 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"),
E((short)1, "e");
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: // E
return E;
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, CacheBlockTResponse.class)));
tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", 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(cacheBlock_result.class, metaDataMap);
}
public cacheBlock_result() {
}
public cacheBlock_result(
CacheBlockTResponse success,
alluxio.thrift.AlluxioTException e)
{
this();
this.success = success;
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public cacheBlock_result(cacheBlock_result other) {
if (other.isSetSuccess()) {
this.success = new CacheBlockTResponse(other.success);
}
if (other.isSetE()) {
this.e = new alluxio.thrift.AlluxioTException(other.e);
}
}
public cacheBlock_result deepCopy() {
return new cacheBlock_result(this);
}
@Override
public void clear() {
this.success = null;
this.e = null;
}
public CacheBlockTResponse getSuccess() {
return this.success;
}
public cacheBlock_result setSuccess(CacheBlockTResponse 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 alluxio.thrift.AlluxioTException getE() {
return this.e;
}
public cacheBlock_result setE(alluxio.thrift.AlluxioTException e) {
this.e = e;
return this;
}
public void unsetE() {
this.e = null;
}
/** Returns true if field e is set (has been assigned a value) and false otherwise */
public boolean isSetE() {
return this.e != null;
}
public void setEIsSet(boolean value) {
if (!value) {
this.e = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((CacheBlockTResponse)value);
}
break;
case E:
if (value == null) {
unsetE();
} else {
setE((alluxio.thrift.AlluxioTException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case E:
return getE();
}
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 E:
return isSetE();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof cacheBlock_result)
return this.equals((cacheBlock_result)that);
return false;
}
public boolean equals(cacheBlock_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_e = true && this.isSetE();
boolean that_present_e = true && that.isSetE();
if (this_present_e || that_present_e) {
if (!(this_present_e && that_present_e))
return false;
if (!this.e.equals(that.e))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_success = true && (isSetSuccess());
list.add(present_success);
if (present_success)
list.add(success);
boolean present_e = true && (isSetE());
list.add(present_e);
if (present_e)
list.add(e);
return list.hashCode();
}
@Override
public int compareTo(cacheBlock_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetE()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("cacheBlock_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("e:");
if (this.e == null) {
sb.append("null");
} else {
sb.append(this.e);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (success != null) {
success.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class cacheBlock_resultStandardSchemeFactory implements SchemeFactory {
public cacheBlock_resultStandardScheme getScheme() {
return new cacheBlock_resultStandardScheme();
}
}
private static class cacheBlock_resultStandardScheme extends StandardScheme<cacheBlock_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, cacheBlock_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new CacheBlockTResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // E
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, cacheBlock_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.e != null) {
oprot.writeFieldBegin(E_FIELD_DESC);
struct.e.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class cacheBlock_resultTupleSchemeFactory implements SchemeFactory {
public cacheBlock_resultTupleScheme getScheme() {
return new cacheBlock_resultTupleScheme();
}
}
private static class cacheBlock_resultTupleScheme extends TupleScheme<cacheBlock_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, cacheBlock_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetE()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetE()) {
struct.e.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, cacheBlock_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = new CacheBlockTResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
}
}
}
}
public static class cancelBlock_args implements org.apache.thrift.TBase<cancelBlock_args, cancelBlock_args._Fields>, java.io.Serializable, Cloneable, Comparable<cancelBlock_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("cancelBlock_args");
private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.I64, (short)1);
private static final org.apache.thrift.protocol.TField BLOCK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("blockId", org.apache.thrift.protocol.TType.I64, (short)2);
private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("options", org.apache.thrift.protocol.TType.STRUCT, (short)3);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new cancelBlock_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new cancelBlock_argsTupleSchemeFactory());
}
private long sessionId; // required
private long blockId; // required
private CancelBlockTOptions options; // 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 {
/**
* the id of the current session
*/
SESSION_ID((short)1, "sessionId"),
/**
* the id of the block being accessed
*/
BLOCK_ID((short)2, "blockId"),
/**
* the method options
*/
OPTIONS((short)3, "options");
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: // SESSION_ID
return SESSION_ID;
case 2: // BLOCK_ID
return BLOCK_ID;
case 3: // OPTIONS
return OPTIONS;
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 __SESSIONID_ISSET_ID = 0;
private static final int __BLOCKID_ISSET_ID = 1;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.BLOCK_ID, new org.apache.thrift.meta_data.FieldMetaData("blockId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("options", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CancelBlockTOptions.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(cancelBlock_args.class, metaDataMap);
}
public cancelBlock_args() {
}
public cancelBlock_args(
long sessionId,
long blockId,
CancelBlockTOptions options)
{
this();
this.sessionId = sessionId;
setSessionIdIsSet(true);
this.blockId = blockId;
setBlockIdIsSet(true);
this.options = options;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public cancelBlock_args(cancelBlock_args other) {
__isset_bitfield = other.__isset_bitfield;
this.sessionId = other.sessionId;
this.blockId = other.blockId;
if (other.isSetOptions()) {
this.options = new CancelBlockTOptions(other.options);
}
}
public cancelBlock_args deepCopy() {
return new cancelBlock_args(this);
}
@Override
public void clear() {
setSessionIdIsSet(false);
this.sessionId = 0;
setBlockIdIsSet(false);
this.blockId = 0;
this.options = null;
}
/**
* the id of the current session
*/
public long getSessionId() {
return this.sessionId;
}
/**
* the id of the current session
*/
public cancelBlock_args setSessionId(long sessionId) {
this.sessionId = sessionId;
setSessionIdIsSet(true);
return this;
}
public void unsetSessionId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SESSIONID_ISSET_ID);
}
/** Returns true if field sessionId is set (has been assigned a value) and false otherwise */
public boolean isSetSessionId() {
return EncodingUtils.testBit(__isset_bitfield, __SESSIONID_ISSET_ID);
}
public void setSessionIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SESSIONID_ISSET_ID, value);
}
/**
* the id of the block being accessed
*/
public long getBlockId() {
return this.blockId;
}
/**
* the id of the block being accessed
*/
public cancelBlock_args setBlockId(long blockId) {
this.blockId = blockId;
setBlockIdIsSet(true);
return this;
}
public void unsetBlockId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKID_ISSET_ID);
}
/** Returns true if field blockId is set (has been assigned a value) and false otherwise */
public boolean isSetBlockId() {
return EncodingUtils.testBit(__isset_bitfield, __BLOCKID_ISSET_ID);
}
public void setBlockIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKID_ISSET_ID, value);
}
/**
* the method options
*/
public CancelBlockTOptions getOptions() {
return this.options;
}
/**
* the method options
*/
public cancelBlock_args setOptions(CancelBlockTOptions options) {
this.options = options;
return this;
}
public void unsetOptions() {
this.options = null;
}
/** Returns true if field options is set (has been assigned a value) and false otherwise */
public boolean isSetOptions() {
return this.options != null;
}
public void setOptionsIsSet(boolean value) {
if (!value) {
this.options = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SESSION_ID:
if (value == null) {
unsetSessionId();
} else {
setSessionId((Long)value);
}
break;
case BLOCK_ID:
if (value == null) {
unsetBlockId();
} else {
setBlockId((Long)value);
}
break;
case OPTIONS:
if (value == null) {
unsetOptions();
} else {
setOptions((CancelBlockTOptions)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SESSION_ID:
return getSessionId();
case BLOCK_ID:
return getBlockId();
case OPTIONS:
return getOptions();
}
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 SESSION_ID:
return isSetSessionId();
case BLOCK_ID:
return isSetBlockId();
case OPTIONS:
return isSetOptions();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof cancelBlock_args)
return this.equals((cancelBlock_args)that);
return false;
}
public boolean equals(cancelBlock_args that) {
if (that == null)
return false;
boolean this_present_sessionId = true;
boolean that_present_sessionId = true;
if (this_present_sessionId || that_present_sessionId) {
if (!(this_present_sessionId && that_present_sessionId))
return false;
if (this.sessionId != that.sessionId)
return false;
}
boolean this_present_blockId = true;
boolean that_present_blockId = true;
if (this_present_blockId || that_present_blockId) {
if (!(this_present_blockId && that_present_blockId))
return false;
if (this.blockId != that.blockId)
return false;
}
boolean this_present_options = true && this.isSetOptions();
boolean that_present_options = true && that.isSetOptions();
if (this_present_options || that_present_options) {
if (!(this_present_options && that_present_options))
return false;
if (!this.options.equals(that.options))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_sessionId = true;
list.add(present_sessionId);
if (present_sessionId)
list.add(sessionId);
boolean present_blockId = true;
list.add(present_blockId);
if (present_blockId)
list.add(blockId);
boolean present_options = true && (isSetOptions());
list.add(present_options);
if (present_options)
list.add(options);
return list.hashCode();
}
@Override
public int compareTo(cancelBlock_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSessionId()).compareTo(other.isSetSessionId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSessionId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, other.sessionId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetBlockId()).compareTo(other.isSetBlockId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetBlockId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockId, other.blockId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetOptions()).compareTo(other.isSetOptions());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOptions()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, other.options);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("cancelBlock_args(");
boolean first = true;
sb.append("sessionId:");
sb.append(this.sessionId);
first = false;
if (!first) sb.append(", ");
sb.append("blockId:");
sb.append(this.blockId);
first = false;
if (!first) sb.append(", ");
sb.append("options:");
if (this.options == null) {
sb.append("null");
} else {
sb.append(this.options);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (options != null) {
options.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class cancelBlock_argsStandardSchemeFactory implements SchemeFactory {
public cancelBlock_argsStandardScheme getScheme() {
return new cancelBlock_argsStandardScheme();
}
}
private static class cancelBlock_argsStandardScheme extends StandardScheme<cancelBlock_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, cancelBlock_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // SESSION_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.sessionId = iprot.readI64();
struct.setSessionIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // BLOCK_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // OPTIONS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.options = new CancelBlockTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, cancelBlock_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(SESSION_ID_FIELD_DESC);
oprot.writeI64(struct.sessionId);
oprot.writeFieldEnd();
oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC);
oprot.writeI64(struct.blockId);
oprot.writeFieldEnd();
if (struct.options != null) {
oprot.writeFieldBegin(OPTIONS_FIELD_DESC);
struct.options.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class cancelBlock_argsTupleSchemeFactory implements SchemeFactory {
public cancelBlock_argsTupleScheme getScheme() {
return new cancelBlock_argsTupleScheme();
}
}
private static class cancelBlock_argsTupleScheme extends TupleScheme<cancelBlock_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, cancelBlock_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSessionId()) {
optionals.set(0);
}
if (struct.isSetBlockId()) {
optionals.set(1);
}
if (struct.isSetOptions()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetSessionId()) {
oprot.writeI64(struct.sessionId);
}
if (struct.isSetBlockId()) {
oprot.writeI64(struct.blockId);
}
if (struct.isSetOptions()) {
struct.options.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, cancelBlock_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.sessionId = iprot.readI64();
struct.setSessionIdIsSet(true);
}
if (incoming.get(1)) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(true);
}
if (incoming.get(2)) {
struct.options = new CancelBlockTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
}
}
}
}
public static class cancelBlock_result implements org.apache.thrift.TBase<cancelBlock_result, cancelBlock_result._Fields>, java.io.Serializable, Cloneable, Comparable<cancelBlock_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("cancelBlock_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 E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new cancelBlock_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new cancelBlock_resultTupleSchemeFactory());
}
private CancelBlockTResponse success; // required
private alluxio.thrift.AlluxioTException e; // 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"),
E((short)1, "e");
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: // E
return E;
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, CancelBlockTResponse.class)));
tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", 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(cancelBlock_result.class, metaDataMap);
}
public cancelBlock_result() {
}
public cancelBlock_result(
CancelBlockTResponse success,
alluxio.thrift.AlluxioTException e)
{
this();
this.success = success;
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public cancelBlock_result(cancelBlock_result other) {
if (other.isSetSuccess()) {
this.success = new CancelBlockTResponse(other.success);
}
if (other.isSetE()) {
this.e = new alluxio.thrift.AlluxioTException(other.e);
}
}
public cancelBlock_result deepCopy() {
return new cancelBlock_result(this);
}
@Override
public void clear() {
this.success = null;
this.e = null;
}
public CancelBlockTResponse getSuccess() {
return this.success;
}
public cancelBlock_result setSuccess(CancelBlockTResponse 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 alluxio.thrift.AlluxioTException getE() {
return this.e;
}
public cancelBlock_result setE(alluxio.thrift.AlluxioTException e) {
this.e = e;
return this;
}
public void unsetE() {
this.e = null;
}
/** Returns true if field e is set (has been assigned a value) and false otherwise */
public boolean isSetE() {
return this.e != null;
}
public void setEIsSet(boolean value) {
if (!value) {
this.e = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((CancelBlockTResponse)value);
}
break;
case E:
if (value == null) {
unsetE();
} else {
setE((alluxio.thrift.AlluxioTException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case E:
return getE();
}
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 E:
return isSetE();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof cancelBlock_result)
return this.equals((cancelBlock_result)that);
return false;
}
public boolean equals(cancelBlock_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_e = true && this.isSetE();
boolean that_present_e = true && that.isSetE();
if (this_present_e || that_present_e) {
if (!(this_present_e && that_present_e))
return false;
if (!this.e.equals(that.e))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_success = true && (isSetSuccess());
list.add(present_success);
if (present_success)
list.add(success);
boolean present_e = true && (isSetE());
list.add(present_e);
if (present_e)
list.add(e);
return list.hashCode();
}
@Override
public int compareTo(cancelBlock_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetE()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("cancelBlock_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("e:");
if (this.e == null) {
sb.append("null");
} else {
sb.append(this.e);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (success != null) {
success.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class cancelBlock_resultStandardSchemeFactory implements SchemeFactory {
public cancelBlock_resultStandardScheme getScheme() {
return new cancelBlock_resultStandardScheme();
}
}
private static class cancelBlock_resultStandardScheme extends StandardScheme<cancelBlock_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, cancelBlock_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new CancelBlockTResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // E
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, cancelBlock_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.e != null) {
oprot.writeFieldBegin(E_FIELD_DESC);
struct.e.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class cancelBlock_resultTupleSchemeFactory implements SchemeFactory {
public cancelBlock_resultTupleScheme getScheme() {
return new cancelBlock_resultTupleScheme();
}
}
private static class cancelBlock_resultTupleScheme extends TupleScheme<cancelBlock_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, cancelBlock_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetE()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetE()) {
struct.e.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, cancelBlock_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = new CancelBlockTResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
}
}
}
}
public static class lockBlock_args implements org.apache.thrift.TBase<lockBlock_args, lockBlock_args._Fields>, java.io.Serializable, Cloneable, Comparable<lockBlock_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("lockBlock_args");
private static final org.apache.thrift.protocol.TField BLOCK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("blockId", org.apache.thrift.protocol.TType.I64, (short)1);
private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.I64, (short)2);
private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("options", org.apache.thrift.protocol.TType.STRUCT, (short)3);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new lockBlock_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new lockBlock_argsTupleSchemeFactory());
}
private long blockId; // required
private long sessionId; // required
private LockBlockTOptions options; // 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 {
/**
* the id of the block being accessed
*/
BLOCK_ID((short)1, "blockId"),
/**
* the id of the current session
*/
SESSION_ID((short)2, "sessionId"),
/**
* the lock method options
*/
OPTIONS((short)3, "options");
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: // BLOCK_ID
return BLOCK_ID;
case 2: // SESSION_ID
return SESSION_ID;
case 3: // OPTIONS
return OPTIONS;
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 __BLOCKID_ISSET_ID = 0;
private static final int __SESSIONID_ISSET_ID = 1;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.BLOCK_ID, new org.apache.thrift.meta_data.FieldMetaData("blockId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("options", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, LockBlockTOptions.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(lockBlock_args.class, metaDataMap);
}
public lockBlock_args() {
}
public lockBlock_args(
long blockId,
long sessionId,
LockBlockTOptions options)
{
this();
this.blockId = blockId;
setBlockIdIsSet(true);
this.sessionId = sessionId;
setSessionIdIsSet(true);
this.options = options;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public lockBlock_args(lockBlock_args other) {
__isset_bitfield = other.__isset_bitfield;
this.blockId = other.blockId;
this.sessionId = other.sessionId;
if (other.isSetOptions()) {
this.options = new LockBlockTOptions(other.options);
}
}
public lockBlock_args deepCopy() {
return new lockBlock_args(this);
}
@Override
public void clear() {
setBlockIdIsSet(false);
this.blockId = 0;
setSessionIdIsSet(false);
this.sessionId = 0;
this.options = null;
}
/**
* the id of the block being accessed
*/
public long getBlockId() {
return this.blockId;
}
/**
* the id of the block being accessed
*/
public lockBlock_args setBlockId(long blockId) {
this.blockId = blockId;
setBlockIdIsSet(true);
return this;
}
public void unsetBlockId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKID_ISSET_ID);
}
/** Returns true if field blockId is set (has been assigned a value) and false otherwise */
public boolean isSetBlockId() {
return EncodingUtils.testBit(__isset_bitfield, __BLOCKID_ISSET_ID);
}
public void setBlockIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKID_ISSET_ID, value);
}
/**
* the id of the current session
*/
public long getSessionId() {
return this.sessionId;
}
/**
* the id of the current session
*/
public lockBlock_args setSessionId(long sessionId) {
this.sessionId = sessionId;
setSessionIdIsSet(true);
return this;
}
public void unsetSessionId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SESSIONID_ISSET_ID);
}
/** Returns true if field sessionId is set (has been assigned a value) and false otherwise */
public boolean isSetSessionId() {
return EncodingUtils.testBit(__isset_bitfield, __SESSIONID_ISSET_ID);
}
public void setSessionIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SESSIONID_ISSET_ID, value);
}
/**
* the lock method options
*/
public LockBlockTOptions getOptions() {
return this.options;
}
/**
* the lock method options
*/
public lockBlock_args setOptions(LockBlockTOptions options) {
this.options = options;
return this;
}
public void unsetOptions() {
this.options = null;
}
/** Returns true if field options is set (has been assigned a value) and false otherwise */
public boolean isSetOptions() {
return this.options != null;
}
public void setOptionsIsSet(boolean value) {
if (!value) {
this.options = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case BLOCK_ID:
if (value == null) {
unsetBlockId();
} else {
setBlockId((Long)value);
}
break;
case SESSION_ID:
if (value == null) {
unsetSessionId();
} else {
setSessionId((Long)value);
}
break;
case OPTIONS:
if (value == null) {
unsetOptions();
} else {
setOptions((LockBlockTOptions)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case BLOCK_ID:
return getBlockId();
case SESSION_ID:
return getSessionId();
case OPTIONS:
return getOptions();
}
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 BLOCK_ID:
return isSetBlockId();
case SESSION_ID:
return isSetSessionId();
case OPTIONS:
return isSetOptions();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof lockBlock_args)
return this.equals((lockBlock_args)that);
return false;
}
public boolean equals(lockBlock_args that) {
if (that == null)
return false;
boolean this_present_blockId = true;
boolean that_present_blockId = true;
if (this_present_blockId || that_present_blockId) {
if (!(this_present_blockId && that_present_blockId))
return false;
if (this.blockId != that.blockId)
return false;
}
boolean this_present_sessionId = true;
boolean that_present_sessionId = true;
if (this_present_sessionId || that_present_sessionId) {
if (!(this_present_sessionId && that_present_sessionId))
return false;
if (this.sessionId != that.sessionId)
return false;
}
boolean this_present_options = true && this.isSetOptions();
boolean that_present_options = true && that.isSetOptions();
if (this_present_options || that_present_options) {
if (!(this_present_options && that_present_options))
return false;
if (!this.options.equals(that.options))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_blockId = true;
list.add(present_blockId);
if (present_blockId)
list.add(blockId);
boolean present_sessionId = true;
list.add(present_sessionId);
if (present_sessionId)
list.add(sessionId);
boolean present_options = true && (isSetOptions());
list.add(present_options);
if (present_options)
list.add(options);
return list.hashCode();
}
@Override
public int compareTo(lockBlock_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetBlockId()).compareTo(other.isSetBlockId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetBlockId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockId, other.blockId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetSessionId()).compareTo(other.isSetSessionId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSessionId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, other.sessionId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetOptions()).compareTo(other.isSetOptions());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOptions()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, other.options);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("lockBlock_args(");
boolean first = true;
sb.append("blockId:");
sb.append(this.blockId);
first = false;
if (!first) sb.append(", ");
sb.append("sessionId:");
sb.append(this.sessionId);
first = false;
if (!first) sb.append(", ");
sb.append("options:");
if (this.options == null) {
sb.append("null");
} else {
sb.append(this.options);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (options != null) {
options.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class lockBlock_argsStandardSchemeFactory implements SchemeFactory {
public lockBlock_argsStandardScheme getScheme() {
return new lockBlock_argsStandardScheme();
}
}
private static class lockBlock_argsStandardScheme extends StandardScheme<lockBlock_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, lockBlock_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // BLOCK_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // SESSION_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.sessionId = iprot.readI64();
struct.setSessionIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // OPTIONS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.options = new LockBlockTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, lockBlock_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC);
oprot.writeI64(struct.blockId);
oprot.writeFieldEnd();
oprot.writeFieldBegin(SESSION_ID_FIELD_DESC);
oprot.writeI64(struct.sessionId);
oprot.writeFieldEnd();
if (struct.options != null) {
oprot.writeFieldBegin(OPTIONS_FIELD_DESC);
struct.options.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class lockBlock_argsTupleSchemeFactory implements SchemeFactory {
public lockBlock_argsTupleScheme getScheme() {
return new lockBlock_argsTupleScheme();
}
}
private static class lockBlock_argsTupleScheme extends TupleScheme<lockBlock_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, lockBlock_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetBlockId()) {
optionals.set(0);
}
if (struct.isSetSessionId()) {
optionals.set(1);
}
if (struct.isSetOptions()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetBlockId()) {
oprot.writeI64(struct.blockId);
}
if (struct.isSetSessionId()) {
oprot.writeI64(struct.sessionId);
}
if (struct.isSetOptions()) {
struct.options.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, lockBlock_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(true);
}
if (incoming.get(1)) {
struct.sessionId = iprot.readI64();
struct.setSessionIdIsSet(true);
}
if (incoming.get(2)) {
struct.options = new LockBlockTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
}
}
}
}
public static class lockBlock_result implements org.apache.thrift.TBase<lockBlock_result, lockBlock_result._Fields>, java.io.Serializable, Cloneable, Comparable<lockBlock_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("lockBlock_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 E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new lockBlock_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new lockBlock_resultTupleSchemeFactory());
}
private LockBlockTResponse success; // required
private alluxio.thrift.AlluxioTException e; // 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"),
E((short)1, "e");
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: // E
return E;
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, LockBlockTResponse.class)));
tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", 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(lockBlock_result.class, metaDataMap);
}
public lockBlock_result() {
}
public lockBlock_result(
LockBlockTResponse success,
alluxio.thrift.AlluxioTException e)
{
this();
this.success = success;
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public lockBlock_result(lockBlock_result other) {
if (other.isSetSuccess()) {
this.success = new LockBlockTResponse(other.success);
}
if (other.isSetE()) {
this.e = new alluxio.thrift.AlluxioTException(other.e);
}
}
public lockBlock_result deepCopy() {
return new lockBlock_result(this);
}
@Override
public void clear() {
this.success = null;
this.e = null;
}
public LockBlockTResponse getSuccess() {
return this.success;
}
public lockBlock_result setSuccess(LockBlockTResponse 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 alluxio.thrift.AlluxioTException getE() {
return this.e;
}
public lockBlock_result setE(alluxio.thrift.AlluxioTException e) {
this.e = e;
return this;
}
public void unsetE() {
this.e = null;
}
/** Returns true if field e is set (has been assigned a value) and false otherwise */
public boolean isSetE() {
return this.e != null;
}
public void setEIsSet(boolean value) {
if (!value) {
this.e = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((LockBlockTResponse)value);
}
break;
case E:
if (value == null) {
unsetE();
} else {
setE((alluxio.thrift.AlluxioTException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case E:
return getE();
}
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 E:
return isSetE();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof lockBlock_result)
return this.equals((lockBlock_result)that);
return false;
}
public boolean equals(lockBlock_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_e = true && this.isSetE();
boolean that_present_e = true && that.isSetE();
if (this_present_e || that_present_e) {
if (!(this_present_e && that_present_e))
return false;
if (!this.e.equals(that.e))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_success = true && (isSetSuccess());
list.add(present_success);
if (present_success)
list.add(success);
boolean present_e = true && (isSetE());
list.add(present_e);
if (present_e)
list.add(e);
return list.hashCode();
}
@Override
public int compareTo(lockBlock_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetE()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("lockBlock_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("e:");
if (this.e == null) {
sb.append("null");
} else {
sb.append(this.e);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (success != null) {
success.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class lockBlock_resultStandardSchemeFactory implements SchemeFactory {
public lockBlock_resultStandardScheme getScheme() {
return new lockBlock_resultStandardScheme();
}
}
private static class lockBlock_resultStandardScheme extends StandardScheme<lockBlock_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, lockBlock_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new LockBlockTResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // E
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, lockBlock_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.e != null) {
oprot.writeFieldBegin(E_FIELD_DESC);
struct.e.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class lockBlock_resultTupleSchemeFactory implements SchemeFactory {
public lockBlock_resultTupleScheme getScheme() {
return new lockBlock_resultTupleScheme();
}
}
private static class lockBlock_resultTupleScheme extends TupleScheme<lockBlock_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, lockBlock_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetE()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetE()) {
struct.e.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, lockBlock_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = new LockBlockTResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
}
}
}
}
public static class promoteBlock_args implements org.apache.thrift.TBase<promoteBlock_args, promoteBlock_args._Fields>, java.io.Serializable, Cloneable, Comparable<promoteBlock_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("promoteBlock_args");
private static final org.apache.thrift.protocol.TField BLOCK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("blockId", org.apache.thrift.protocol.TType.I64, (short)1);
private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("options", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new promoteBlock_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new promoteBlock_argsTupleSchemeFactory());
}
private long blockId; // required
private PromoteBlockTOptions options; // 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 {
/**
* the id of the block being accessed
*/
BLOCK_ID((short)1, "blockId"),
/**
* the method options
*/
OPTIONS((short)2, "options");
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: // BLOCK_ID
return BLOCK_ID;
case 2: // OPTIONS
return OPTIONS;
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 __BLOCKID_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.BLOCK_ID, new org.apache.thrift.meta_data.FieldMetaData("blockId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("options", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PromoteBlockTOptions.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(promoteBlock_args.class, metaDataMap);
}
public promoteBlock_args() {
}
public promoteBlock_args(
long blockId,
PromoteBlockTOptions options)
{
this();
this.blockId = blockId;
setBlockIdIsSet(true);
this.options = options;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public promoteBlock_args(promoteBlock_args other) {
__isset_bitfield = other.__isset_bitfield;
this.blockId = other.blockId;
if (other.isSetOptions()) {
this.options = new PromoteBlockTOptions(other.options);
}
}
public promoteBlock_args deepCopy() {
return new promoteBlock_args(this);
}
@Override
public void clear() {
setBlockIdIsSet(false);
this.blockId = 0;
this.options = null;
}
/**
* the id of the block being accessed
*/
public long getBlockId() {
return this.blockId;
}
/**
* the id of the block being accessed
*/
public promoteBlock_args setBlockId(long blockId) {
this.blockId = blockId;
setBlockIdIsSet(true);
return this;
}
public void unsetBlockId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKID_ISSET_ID);
}
/** Returns true if field blockId is set (has been assigned a value) and false otherwise */
public boolean isSetBlockId() {
return EncodingUtils.testBit(__isset_bitfield, __BLOCKID_ISSET_ID);
}
public void setBlockIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKID_ISSET_ID, value);
}
/**
* the method options
*/
public PromoteBlockTOptions getOptions() {
return this.options;
}
/**
* the method options
*/
public promoteBlock_args setOptions(PromoteBlockTOptions options) {
this.options = options;
return this;
}
public void unsetOptions() {
this.options = null;
}
/** Returns true if field options is set (has been assigned a value) and false otherwise */
public boolean isSetOptions() {
return this.options != null;
}
public void setOptionsIsSet(boolean value) {
if (!value) {
this.options = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case BLOCK_ID:
if (value == null) {
unsetBlockId();
} else {
setBlockId((Long)value);
}
break;
case OPTIONS:
if (value == null) {
unsetOptions();
} else {
setOptions((PromoteBlockTOptions)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case BLOCK_ID:
return getBlockId();
case OPTIONS:
return getOptions();
}
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 BLOCK_ID:
return isSetBlockId();
case OPTIONS:
return isSetOptions();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof promoteBlock_args)
return this.equals((promoteBlock_args)that);
return false;
}
public boolean equals(promoteBlock_args that) {
if (that == null)
return false;
boolean this_present_blockId = true;
boolean that_present_blockId = true;
if (this_present_blockId || that_present_blockId) {
if (!(this_present_blockId && that_present_blockId))
return false;
if (this.blockId != that.blockId)
return false;
}
boolean this_present_options = true && this.isSetOptions();
boolean that_present_options = true && that.isSetOptions();
if (this_present_options || that_present_options) {
if (!(this_present_options && that_present_options))
return false;
if (!this.options.equals(that.options))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_blockId = true;
list.add(present_blockId);
if (present_blockId)
list.add(blockId);
boolean present_options = true && (isSetOptions());
list.add(present_options);
if (present_options)
list.add(options);
return list.hashCode();
}
@Override
public int compareTo(promoteBlock_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetBlockId()).compareTo(other.isSetBlockId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetBlockId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockId, other.blockId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetOptions()).compareTo(other.isSetOptions());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOptions()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, other.options);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("promoteBlock_args(");
boolean first = true;
sb.append("blockId:");
sb.append(this.blockId);
first = false;
if (!first) sb.append(", ");
sb.append("options:");
if (this.options == null) {
sb.append("null");
} else {
sb.append(this.options);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (options != null) {
options.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class promoteBlock_argsStandardSchemeFactory implements SchemeFactory {
public promoteBlock_argsStandardScheme getScheme() {
return new promoteBlock_argsStandardScheme();
}
}
private static class promoteBlock_argsStandardScheme extends StandardScheme<promoteBlock_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, promoteBlock_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // BLOCK_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // OPTIONS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.options = new PromoteBlockTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, promoteBlock_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC);
oprot.writeI64(struct.blockId);
oprot.writeFieldEnd();
if (struct.options != null) {
oprot.writeFieldBegin(OPTIONS_FIELD_DESC);
struct.options.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class promoteBlock_argsTupleSchemeFactory implements SchemeFactory {
public promoteBlock_argsTupleScheme getScheme() {
return new promoteBlock_argsTupleScheme();
}
}
private static class promoteBlock_argsTupleScheme extends TupleScheme<promoteBlock_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, promoteBlock_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetBlockId()) {
optionals.set(0);
}
if (struct.isSetOptions()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetBlockId()) {
oprot.writeI64(struct.blockId);
}
if (struct.isSetOptions()) {
struct.options.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, promoteBlock_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(true);
}
if (incoming.get(1)) {
struct.options = new PromoteBlockTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
}
}
}
}
public static class promoteBlock_result implements org.apache.thrift.TBase<promoteBlock_result, promoteBlock_result._Fields>, java.io.Serializable, Cloneable, Comparable<promoteBlock_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("promoteBlock_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 E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new promoteBlock_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new promoteBlock_resultTupleSchemeFactory());
}
private PromoteBlockTResponse success; // required
private alluxio.thrift.AlluxioTException e; // 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"),
E((short)1, "e");
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: // E
return E;
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, PromoteBlockTResponse.class)));
tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", 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(promoteBlock_result.class, metaDataMap);
}
public promoteBlock_result() {
}
public promoteBlock_result(
PromoteBlockTResponse success,
alluxio.thrift.AlluxioTException e)
{
this();
this.success = success;
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public promoteBlock_result(promoteBlock_result other) {
if (other.isSetSuccess()) {
this.success = new PromoteBlockTResponse(other.success);
}
if (other.isSetE()) {
this.e = new alluxio.thrift.AlluxioTException(other.e);
}
}
public promoteBlock_result deepCopy() {
return new promoteBlock_result(this);
}
@Override
public void clear() {
this.success = null;
this.e = null;
}
public PromoteBlockTResponse getSuccess() {
return this.success;
}
public promoteBlock_result setSuccess(PromoteBlockTResponse 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 alluxio.thrift.AlluxioTException getE() {
return this.e;
}
public promoteBlock_result setE(alluxio.thrift.AlluxioTException e) {
this.e = e;
return this;
}
public void unsetE() {
this.e = null;
}
/** Returns true if field e is set (has been assigned a value) and false otherwise */
public boolean isSetE() {
return this.e != null;
}
public void setEIsSet(boolean value) {
if (!value) {
this.e = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((PromoteBlockTResponse)value);
}
break;
case E:
if (value == null) {
unsetE();
} else {
setE((alluxio.thrift.AlluxioTException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case E:
return getE();
}
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 E:
return isSetE();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof promoteBlock_result)
return this.equals((promoteBlock_result)that);
return false;
}
public boolean equals(promoteBlock_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_e = true && this.isSetE();
boolean that_present_e = true && that.isSetE();
if (this_present_e || that_present_e) {
if (!(this_present_e && that_present_e))
return false;
if (!this.e.equals(that.e))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_success = true && (isSetSuccess());
list.add(present_success);
if (present_success)
list.add(success);
boolean present_e = true && (isSetE());
list.add(present_e);
if (present_e)
list.add(e);
return list.hashCode();
}
@Override
public int compareTo(promoteBlock_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetE()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("promoteBlock_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("e:");
if (this.e == null) {
sb.append("null");
} else {
sb.append(this.e);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (success != null) {
success.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class promoteBlock_resultStandardSchemeFactory implements SchemeFactory {
public promoteBlock_resultStandardScheme getScheme() {
return new promoteBlock_resultStandardScheme();
}
}
private static class promoteBlock_resultStandardScheme extends StandardScheme<promoteBlock_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, promoteBlock_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new PromoteBlockTResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // E
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, promoteBlock_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.e != null) {
oprot.writeFieldBegin(E_FIELD_DESC);
struct.e.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class promoteBlock_resultTupleSchemeFactory implements SchemeFactory {
public promoteBlock_resultTupleScheme getScheme() {
return new promoteBlock_resultTupleScheme();
}
}
private static class promoteBlock_resultTupleScheme extends TupleScheme<promoteBlock_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, promoteBlock_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetE()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetE()) {
struct.e.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, promoteBlock_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = new PromoteBlockTResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
}
}
}
}
public static class removeBlock_args implements org.apache.thrift.TBase<removeBlock_args, removeBlock_args._Fields>, java.io.Serializable, Cloneable, Comparable<removeBlock_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("removeBlock_args");
private static final org.apache.thrift.protocol.TField BLOCK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("blockId", org.apache.thrift.protocol.TType.I64, (short)1);
private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("options", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new removeBlock_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new removeBlock_argsTupleSchemeFactory());
}
private long blockId; // required
private RemoveBlockTOptions options; // 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 {
/**
* the id of the block being removed
*/
BLOCK_ID((short)1, "blockId"),
/**
* the method options
*/
OPTIONS((short)2, "options");
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: // BLOCK_ID
return BLOCK_ID;
case 2: // OPTIONS
return OPTIONS;
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 __BLOCKID_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.BLOCK_ID, new org.apache.thrift.meta_data.FieldMetaData("blockId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("options", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RemoveBlockTOptions.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(removeBlock_args.class, metaDataMap);
}
public removeBlock_args() {
}
public removeBlock_args(
long blockId,
RemoveBlockTOptions options)
{
this();
this.blockId = blockId;
setBlockIdIsSet(true);
this.options = options;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public removeBlock_args(removeBlock_args other) {
__isset_bitfield = other.__isset_bitfield;
this.blockId = other.blockId;
if (other.isSetOptions()) {
this.options = new RemoveBlockTOptions(other.options);
}
}
public removeBlock_args deepCopy() {
return new removeBlock_args(this);
}
@Override
public void clear() {
setBlockIdIsSet(false);
this.blockId = 0;
this.options = null;
}
/**
* the id of the block being removed
*/
public long getBlockId() {
return this.blockId;
}
/**
* the id of the block being removed
*/
public removeBlock_args setBlockId(long blockId) {
this.blockId = blockId;
setBlockIdIsSet(true);
return this;
}
public void unsetBlockId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKID_ISSET_ID);
}
/** Returns true if field blockId is set (has been assigned a value) and false otherwise */
public boolean isSetBlockId() {
return EncodingUtils.testBit(__isset_bitfield, __BLOCKID_ISSET_ID);
}
public void setBlockIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKID_ISSET_ID, value);
}
/**
* the method options
*/
public RemoveBlockTOptions getOptions() {
return this.options;
}
/**
* the method options
*/
public removeBlock_args setOptions(RemoveBlockTOptions options) {
this.options = options;
return this;
}
public void unsetOptions() {
this.options = null;
}
/** Returns true if field options is set (has been assigned a value) and false otherwise */
public boolean isSetOptions() {
return this.options != null;
}
public void setOptionsIsSet(boolean value) {
if (!value) {
this.options = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case BLOCK_ID:
if (value == null) {
unsetBlockId();
} else {
setBlockId((Long)value);
}
break;
case OPTIONS:
if (value == null) {
unsetOptions();
} else {
setOptions((RemoveBlockTOptions)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case BLOCK_ID:
return getBlockId();
case OPTIONS:
return getOptions();
}
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 BLOCK_ID:
return isSetBlockId();
case OPTIONS:
return isSetOptions();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof removeBlock_args)
return this.equals((removeBlock_args)that);
return false;
}
public boolean equals(removeBlock_args that) {
if (that == null)
return false;
boolean this_present_blockId = true;
boolean that_present_blockId = true;
if (this_present_blockId || that_present_blockId) {
if (!(this_present_blockId && that_present_blockId))
return false;
if (this.blockId != that.blockId)
return false;
}
boolean this_present_options = true && this.isSetOptions();
boolean that_present_options = true && that.isSetOptions();
if (this_present_options || that_present_options) {
if (!(this_present_options && that_present_options))
return false;
if (!this.options.equals(that.options))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_blockId = true;
list.add(present_blockId);
if (present_blockId)
list.add(blockId);
boolean present_options = true && (isSetOptions());
list.add(present_options);
if (present_options)
list.add(options);
return list.hashCode();
}
@Override
public int compareTo(removeBlock_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetBlockId()).compareTo(other.isSetBlockId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetBlockId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockId, other.blockId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetOptions()).compareTo(other.isSetOptions());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOptions()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, other.options);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("removeBlock_args(");
boolean first = true;
sb.append("blockId:");
sb.append(this.blockId);
first = false;
if (!first) sb.append(", ");
sb.append("options:");
if (this.options == null) {
sb.append("null");
} else {
sb.append(this.options);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (options != null) {
options.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class removeBlock_argsStandardSchemeFactory implements SchemeFactory {
public removeBlock_argsStandardScheme getScheme() {
return new removeBlock_argsStandardScheme();
}
}
private static class removeBlock_argsStandardScheme extends StandardScheme<removeBlock_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, removeBlock_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // BLOCK_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // OPTIONS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.options = new RemoveBlockTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, removeBlock_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC);
oprot.writeI64(struct.blockId);
oprot.writeFieldEnd();
if (struct.options != null) {
oprot.writeFieldBegin(OPTIONS_FIELD_DESC);
struct.options.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class removeBlock_argsTupleSchemeFactory implements SchemeFactory {
public removeBlock_argsTupleScheme getScheme() {
return new removeBlock_argsTupleScheme();
}
}
private static class removeBlock_argsTupleScheme extends TupleScheme<removeBlock_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, removeBlock_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetBlockId()) {
optionals.set(0);
}
if (struct.isSetOptions()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetBlockId()) {
oprot.writeI64(struct.blockId);
}
if (struct.isSetOptions()) {
struct.options.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, removeBlock_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(true);
}
if (incoming.get(1)) {
struct.options = new RemoveBlockTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
}
}
}
}
public static class removeBlock_result implements org.apache.thrift.TBase<removeBlock_result, removeBlock_result._Fields>, java.io.Serializable, Cloneable, Comparable<removeBlock_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("removeBlock_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 E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new removeBlock_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new removeBlock_resultTupleSchemeFactory());
}
private RemoveBlockTResponse success; // required
private alluxio.thrift.AlluxioTException e; // 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"),
E((short)1, "e");
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: // E
return E;
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, RemoveBlockTResponse.class)));
tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", 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(removeBlock_result.class, metaDataMap);
}
public removeBlock_result() {
}
public removeBlock_result(
RemoveBlockTResponse success,
alluxio.thrift.AlluxioTException e)
{
this();
this.success = success;
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public removeBlock_result(removeBlock_result other) {
if (other.isSetSuccess()) {
this.success = new RemoveBlockTResponse(other.success);
}
if (other.isSetE()) {
this.e = new alluxio.thrift.AlluxioTException(other.e);
}
}
public removeBlock_result deepCopy() {
return new removeBlock_result(this);
}
@Override
public void clear() {
this.success = null;
this.e = null;
}
public RemoveBlockTResponse getSuccess() {
return this.success;
}
public removeBlock_result setSuccess(RemoveBlockTResponse 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 alluxio.thrift.AlluxioTException getE() {
return this.e;
}
public removeBlock_result setE(alluxio.thrift.AlluxioTException e) {
this.e = e;
return this;
}
public void unsetE() {
this.e = null;
}
/** Returns true if field e is set (has been assigned a value) and false otherwise */
public boolean isSetE() {
return this.e != null;
}
public void setEIsSet(boolean value) {
if (!value) {
this.e = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((RemoveBlockTResponse)value);
}
break;
case E:
if (value == null) {
unsetE();
} else {
setE((alluxio.thrift.AlluxioTException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case E:
return getE();
}
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 E:
return isSetE();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof removeBlock_result)
return this.equals((removeBlock_result)that);
return false;
}
public boolean equals(removeBlock_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_e = true && this.isSetE();
boolean that_present_e = true && that.isSetE();
if (this_present_e || that_present_e) {
if (!(this_present_e && that_present_e))
return false;
if (!this.e.equals(that.e))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_success = true && (isSetSuccess());
list.add(present_success);
if (present_success)
list.add(success);
boolean present_e = true && (isSetE());
list.add(present_e);
if (present_e)
list.add(e);
return list.hashCode();
}
@Override
public int compareTo(removeBlock_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetE()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("removeBlock_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("e:");
if (this.e == null) {
sb.append("null");
} else {
sb.append(this.e);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (success != null) {
success.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class removeBlock_resultStandardSchemeFactory implements SchemeFactory {
public removeBlock_resultStandardScheme getScheme() {
return new removeBlock_resultStandardScheme();
}
}
private static class removeBlock_resultStandardScheme extends StandardScheme<removeBlock_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, removeBlock_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new RemoveBlockTResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // E
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, removeBlock_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.e != null) {
oprot.writeFieldBegin(E_FIELD_DESC);
struct.e.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class removeBlock_resultTupleSchemeFactory implements SchemeFactory {
public removeBlock_resultTupleScheme getScheme() {
return new removeBlock_resultTupleScheme();
}
}
private static class removeBlock_resultTupleScheme extends TupleScheme<removeBlock_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, removeBlock_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetE()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetE()) {
struct.e.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, removeBlock_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = new RemoveBlockTResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
}
}
}
}
public static class requestBlockLocation_args implements org.apache.thrift.TBase<requestBlockLocation_args, requestBlockLocation_args._Fields>, java.io.Serializable, Cloneable, Comparable<requestBlockLocation_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("requestBlockLocation_args");
private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.I64, (short)1);
private static final org.apache.thrift.protocol.TField BLOCK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("blockId", org.apache.thrift.protocol.TType.I64, (short)2);
private static final org.apache.thrift.protocol.TField INITIAL_BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("initialBytes", org.apache.thrift.protocol.TType.I64, (short)3);
private static final org.apache.thrift.protocol.TField WRITE_TIER_FIELD_DESC = new org.apache.thrift.protocol.TField("writeTier", org.apache.thrift.protocol.TType.I32, (short)4);
private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("options", org.apache.thrift.protocol.TType.STRUCT, (short)5);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new requestBlockLocation_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new requestBlockLocation_argsTupleSchemeFactory());
}
private long sessionId; // required
private long blockId; // required
private long initialBytes; // required
private int writeTier; // required
private RequestBlockLocationTOptions options; // 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 {
/**
* the id of the current session
*/
SESSION_ID((short)1, "sessionId"),
/**
* the id of the block being accessed
*/
BLOCK_ID((short)2, "blockId"),
/**
* initial number of bytes requested
*/
INITIAL_BYTES((short)3, "initialBytes"),
/**
* the target tier to write to
*/
WRITE_TIER((short)4, "writeTier"),
/**
* the method options
*/
OPTIONS((short)5, "options");
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: // SESSION_ID
return SESSION_ID;
case 2: // BLOCK_ID
return BLOCK_ID;
case 3: // INITIAL_BYTES
return INITIAL_BYTES;
case 4: // WRITE_TIER
return WRITE_TIER;
case 5: // OPTIONS
return OPTIONS;
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 __SESSIONID_ISSET_ID = 0;
private static final int __BLOCKID_ISSET_ID = 1;
private static final int __INITIALBYTES_ISSET_ID = 2;
private static final int __WRITETIER_ISSET_ID = 3;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.BLOCK_ID, new org.apache.thrift.meta_data.FieldMetaData("blockId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.INITIAL_BYTES, new org.apache.thrift.meta_data.FieldMetaData("initialBytes", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.WRITE_TIER, new org.apache.thrift.meta_data.FieldMetaData("writeTier", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("options", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RequestBlockLocationTOptions.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(requestBlockLocation_args.class, metaDataMap);
}
public requestBlockLocation_args() {
}
public requestBlockLocation_args(
long sessionId,
long blockId,
long initialBytes,
int writeTier,
RequestBlockLocationTOptions options)
{
this();
this.sessionId = sessionId;
setSessionIdIsSet(true);
this.blockId = blockId;
setBlockIdIsSet(true);
this.initialBytes = initialBytes;
setInitialBytesIsSet(true);
this.writeTier = writeTier;
setWriteTierIsSet(true);
this.options = options;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public requestBlockLocation_args(requestBlockLocation_args other) {
__isset_bitfield = other.__isset_bitfield;
this.sessionId = other.sessionId;
this.blockId = other.blockId;
this.initialBytes = other.initialBytes;
this.writeTier = other.writeTier;
if (other.isSetOptions()) {
this.options = new RequestBlockLocationTOptions(other.options);
}
}
public requestBlockLocation_args deepCopy() {
return new requestBlockLocation_args(this);
}
@Override
public void clear() {
setSessionIdIsSet(false);
this.sessionId = 0;
setBlockIdIsSet(false);
this.blockId = 0;
setInitialBytesIsSet(false);
this.initialBytes = 0;
setWriteTierIsSet(false);
this.writeTier = 0;
this.options = null;
}
/**
* the id of the current session
*/
public long getSessionId() {
return this.sessionId;
}
/**
* the id of the current session
*/
public requestBlockLocation_args setSessionId(long sessionId) {
this.sessionId = sessionId;
setSessionIdIsSet(true);
return this;
}
public void unsetSessionId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SESSIONID_ISSET_ID);
}
/** Returns true if field sessionId is set (has been assigned a value) and false otherwise */
public boolean isSetSessionId() {
return EncodingUtils.testBit(__isset_bitfield, __SESSIONID_ISSET_ID);
}
public void setSessionIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SESSIONID_ISSET_ID, value);
}
/**
* the id of the block being accessed
*/
public long getBlockId() {
return this.blockId;
}
/**
* the id of the block being accessed
*/
public requestBlockLocation_args setBlockId(long blockId) {
this.blockId = blockId;
setBlockIdIsSet(true);
return this;
}
public void unsetBlockId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKID_ISSET_ID);
}
/** Returns true if field blockId is set (has been assigned a value) and false otherwise */
public boolean isSetBlockId() {
return EncodingUtils.testBit(__isset_bitfield, __BLOCKID_ISSET_ID);
}
public void setBlockIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKID_ISSET_ID, value);
}
/**
* initial number of bytes requested
*/
public long getInitialBytes() {
return this.initialBytes;
}
/**
* initial number of bytes requested
*/
public requestBlockLocation_args setInitialBytes(long initialBytes) {
this.initialBytes = initialBytes;
setInitialBytesIsSet(true);
return this;
}
public void unsetInitialBytes() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __INITIALBYTES_ISSET_ID);
}
/** Returns true if field initialBytes is set (has been assigned a value) and false otherwise */
public boolean isSetInitialBytes() {
return EncodingUtils.testBit(__isset_bitfield, __INITIALBYTES_ISSET_ID);
}
public void setInitialBytesIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __INITIALBYTES_ISSET_ID, value);
}
/**
* the target tier to write to
*/
public int getWriteTier() {
return this.writeTier;
}
/**
* the target tier to write to
*/
public requestBlockLocation_args setWriteTier(int writeTier) {
this.writeTier = writeTier;
setWriteTierIsSet(true);
return this;
}
public void unsetWriteTier() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WRITETIER_ISSET_ID);
}
/** Returns true if field writeTier is set (has been assigned a value) and false otherwise */
public boolean isSetWriteTier() {
return EncodingUtils.testBit(__isset_bitfield, __WRITETIER_ISSET_ID);
}
public void setWriteTierIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WRITETIER_ISSET_ID, value);
}
/**
* the method options
*/
public RequestBlockLocationTOptions getOptions() {
return this.options;
}
/**
* the method options
*/
public requestBlockLocation_args setOptions(RequestBlockLocationTOptions options) {
this.options = options;
return this;
}
public void unsetOptions() {
this.options = null;
}
/** Returns true if field options is set (has been assigned a value) and false otherwise */
public boolean isSetOptions() {
return this.options != null;
}
public void setOptionsIsSet(boolean value) {
if (!value) {
this.options = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SESSION_ID:
if (value == null) {
unsetSessionId();
} else {
setSessionId((Long)value);
}
break;
case BLOCK_ID:
if (value == null) {
unsetBlockId();
} else {
setBlockId((Long)value);
}
break;
case INITIAL_BYTES:
if (value == null) {
unsetInitialBytes();
} else {
setInitialBytes((Long)value);
}
break;
case WRITE_TIER:
if (value == null) {
unsetWriteTier();
} else {
setWriteTier((Integer)value);
}
break;
case OPTIONS:
if (value == null) {
unsetOptions();
} else {
setOptions((RequestBlockLocationTOptions)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SESSION_ID:
return getSessionId();
case BLOCK_ID:
return getBlockId();
case INITIAL_BYTES:
return getInitialBytes();
case WRITE_TIER:
return getWriteTier();
case OPTIONS:
return getOptions();
}
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 SESSION_ID:
return isSetSessionId();
case BLOCK_ID:
return isSetBlockId();
case INITIAL_BYTES:
return isSetInitialBytes();
case WRITE_TIER:
return isSetWriteTier();
case OPTIONS:
return isSetOptions();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof requestBlockLocation_args)
return this.equals((requestBlockLocation_args)that);
return false;
}
public boolean equals(requestBlockLocation_args that) {
if (that == null)
return false;
boolean this_present_sessionId = true;
boolean that_present_sessionId = true;
if (this_present_sessionId || that_present_sessionId) {
if (!(this_present_sessionId && that_present_sessionId))
return false;
if (this.sessionId != that.sessionId)
return false;
}
boolean this_present_blockId = true;
boolean that_present_blockId = true;
if (this_present_blockId || that_present_blockId) {
if (!(this_present_blockId && that_present_blockId))
return false;
if (this.blockId != that.blockId)
return false;
}
boolean this_present_initialBytes = true;
boolean that_present_initialBytes = true;
if (this_present_initialBytes || that_present_initialBytes) {
if (!(this_present_initialBytes && that_present_initialBytes))
return false;
if (this.initialBytes != that.initialBytes)
return false;
}
boolean this_present_writeTier = true;
boolean that_present_writeTier = true;
if (this_present_writeTier || that_present_writeTier) {
if (!(this_present_writeTier && that_present_writeTier))
return false;
if (this.writeTier != that.writeTier)
return false;
}
boolean this_present_options = true && this.isSetOptions();
boolean that_present_options = true && that.isSetOptions();
if (this_present_options || that_present_options) {
if (!(this_present_options && that_present_options))
return false;
if (!this.options.equals(that.options))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_sessionId = true;
list.add(present_sessionId);
if (present_sessionId)
list.add(sessionId);
boolean present_blockId = true;
list.add(present_blockId);
if (present_blockId)
list.add(blockId);
boolean present_initialBytes = true;
list.add(present_initialBytes);
if (present_initialBytes)
list.add(initialBytes);
boolean present_writeTier = true;
list.add(present_writeTier);
if (present_writeTier)
list.add(writeTier);
boolean present_options = true && (isSetOptions());
list.add(present_options);
if (present_options)
list.add(options);
return list.hashCode();
}
@Override
public int compareTo(requestBlockLocation_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSessionId()).compareTo(other.isSetSessionId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSessionId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, other.sessionId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetBlockId()).compareTo(other.isSetBlockId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetBlockId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockId, other.blockId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetInitialBytes()).compareTo(other.isSetInitialBytes());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetInitialBytes()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.initialBytes, other.initialBytes);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetWriteTier()).compareTo(other.isSetWriteTier());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetWriteTier()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.writeTier, other.writeTier);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetOptions()).compareTo(other.isSetOptions());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOptions()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, other.options);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("requestBlockLocation_args(");
boolean first = true;
sb.append("sessionId:");
sb.append(this.sessionId);
first = false;
if (!first) sb.append(", ");
sb.append("blockId:");
sb.append(this.blockId);
first = false;
if (!first) sb.append(", ");
sb.append("initialBytes:");
sb.append(this.initialBytes);
first = false;
if (!first) sb.append(", ");
sb.append("writeTier:");
sb.append(this.writeTier);
first = false;
if (!first) sb.append(", ");
sb.append("options:");
if (this.options == null) {
sb.append("null");
} else {
sb.append(this.options);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (options != null) {
options.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class requestBlockLocation_argsStandardSchemeFactory implements SchemeFactory {
public requestBlockLocation_argsStandardScheme getScheme() {
return new requestBlockLocation_argsStandardScheme();
}
}
private static class requestBlockLocation_argsStandardScheme extends StandardScheme<requestBlockLocation_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, requestBlockLocation_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // SESSION_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.sessionId = iprot.readI64();
struct.setSessionIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // BLOCK_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // INITIAL_BYTES
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.initialBytes = iprot.readI64();
struct.setInitialBytesIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // WRITE_TIER
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.writeTier = iprot.readI32();
struct.setWriteTierIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 5: // OPTIONS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.options = new RequestBlockLocationTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, requestBlockLocation_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(SESSION_ID_FIELD_DESC);
oprot.writeI64(struct.sessionId);
oprot.writeFieldEnd();
oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC);
oprot.writeI64(struct.blockId);
oprot.writeFieldEnd();
oprot.writeFieldBegin(INITIAL_BYTES_FIELD_DESC);
oprot.writeI64(struct.initialBytes);
oprot.writeFieldEnd();
oprot.writeFieldBegin(WRITE_TIER_FIELD_DESC);
oprot.writeI32(struct.writeTier);
oprot.writeFieldEnd();
if (struct.options != null) {
oprot.writeFieldBegin(OPTIONS_FIELD_DESC);
struct.options.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class requestBlockLocation_argsTupleSchemeFactory implements SchemeFactory {
public requestBlockLocation_argsTupleScheme getScheme() {
return new requestBlockLocation_argsTupleScheme();
}
}
private static class requestBlockLocation_argsTupleScheme extends TupleScheme<requestBlockLocation_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, requestBlockLocation_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSessionId()) {
optionals.set(0);
}
if (struct.isSetBlockId()) {
optionals.set(1);
}
if (struct.isSetInitialBytes()) {
optionals.set(2);
}
if (struct.isSetWriteTier()) {
optionals.set(3);
}
if (struct.isSetOptions()) {
optionals.set(4);
}
oprot.writeBitSet(optionals, 5);
if (struct.isSetSessionId()) {
oprot.writeI64(struct.sessionId);
}
if (struct.isSetBlockId()) {
oprot.writeI64(struct.blockId);
}
if (struct.isSetInitialBytes()) {
oprot.writeI64(struct.initialBytes);
}
if (struct.isSetWriteTier()) {
oprot.writeI32(struct.writeTier);
}
if (struct.isSetOptions()) {
struct.options.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, requestBlockLocation_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(5);
if (incoming.get(0)) {
struct.sessionId = iprot.readI64();
struct.setSessionIdIsSet(true);
}
if (incoming.get(1)) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(true);
}
if (incoming.get(2)) {
struct.initialBytes = iprot.readI64();
struct.setInitialBytesIsSet(true);
}
if (incoming.get(3)) {
struct.writeTier = iprot.readI32();
struct.setWriteTierIsSet(true);
}
if (incoming.get(4)) {
struct.options = new RequestBlockLocationTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
}
}
}
}
public static class requestBlockLocation_result implements org.apache.thrift.TBase<requestBlockLocation_result, requestBlockLocation_result._Fields>, java.io.Serializable, Cloneable, Comparable<requestBlockLocation_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("requestBlockLocation_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 E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new requestBlockLocation_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new requestBlockLocation_resultTupleSchemeFactory());
}
private RequestBlockLocationTResponse success; // required
private alluxio.thrift.AlluxioTException e; // 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"),
E((short)1, "e");
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: // E
return E;
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, RequestBlockLocationTResponse.class)));
tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", 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(requestBlockLocation_result.class, metaDataMap);
}
public requestBlockLocation_result() {
}
public requestBlockLocation_result(
RequestBlockLocationTResponse success,
alluxio.thrift.AlluxioTException e)
{
this();
this.success = success;
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public requestBlockLocation_result(requestBlockLocation_result other) {
if (other.isSetSuccess()) {
this.success = new RequestBlockLocationTResponse(other.success);
}
if (other.isSetE()) {
this.e = new alluxio.thrift.AlluxioTException(other.e);
}
}
public requestBlockLocation_result deepCopy() {
return new requestBlockLocation_result(this);
}
@Override
public void clear() {
this.success = null;
this.e = null;
}
public RequestBlockLocationTResponse getSuccess() {
return this.success;
}
public requestBlockLocation_result setSuccess(RequestBlockLocationTResponse 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 alluxio.thrift.AlluxioTException getE() {
return this.e;
}
public requestBlockLocation_result setE(alluxio.thrift.AlluxioTException e) {
this.e = e;
return this;
}
public void unsetE() {
this.e = null;
}
/** Returns true if field e is set (has been assigned a value) and false otherwise */
public boolean isSetE() {
return this.e != null;
}
public void setEIsSet(boolean value) {
if (!value) {
this.e = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((RequestBlockLocationTResponse)value);
}
break;
case E:
if (value == null) {
unsetE();
} else {
setE((alluxio.thrift.AlluxioTException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case E:
return getE();
}
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 E:
return isSetE();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof requestBlockLocation_result)
return this.equals((requestBlockLocation_result)that);
return false;
}
public boolean equals(requestBlockLocation_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_e = true && this.isSetE();
boolean that_present_e = true && that.isSetE();
if (this_present_e || that_present_e) {
if (!(this_present_e && that_present_e))
return false;
if (!this.e.equals(that.e))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_success = true && (isSetSuccess());
list.add(present_success);
if (present_success)
list.add(success);
boolean present_e = true && (isSetE());
list.add(present_e);
if (present_e)
list.add(e);
return list.hashCode();
}
@Override
public int compareTo(requestBlockLocation_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetE()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("requestBlockLocation_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("e:");
if (this.e == null) {
sb.append("null");
} else {
sb.append(this.e);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (success != null) {
success.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class requestBlockLocation_resultStandardSchemeFactory implements SchemeFactory {
public requestBlockLocation_resultStandardScheme getScheme() {
return new requestBlockLocation_resultStandardScheme();
}
}
private static class requestBlockLocation_resultStandardScheme extends StandardScheme<requestBlockLocation_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, requestBlockLocation_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new RequestBlockLocationTResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // E
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, requestBlockLocation_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.e != null) {
oprot.writeFieldBegin(E_FIELD_DESC);
struct.e.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class requestBlockLocation_resultTupleSchemeFactory implements SchemeFactory {
public requestBlockLocation_resultTupleScheme getScheme() {
return new requestBlockLocation_resultTupleScheme();
}
}
private static class requestBlockLocation_resultTupleScheme extends TupleScheme<requestBlockLocation_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, requestBlockLocation_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetE()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetE()) {
struct.e.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, requestBlockLocation_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = new RequestBlockLocationTResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
}
}
}
}
public static class requestSpace_args implements org.apache.thrift.TBase<requestSpace_args, requestSpace_args._Fields>, java.io.Serializable, Cloneable, Comparable<requestSpace_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("requestSpace_args");
private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.I64, (short)1);
private static final org.apache.thrift.protocol.TField BLOCK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("blockId", org.apache.thrift.protocol.TType.I64, (short)2);
private static final org.apache.thrift.protocol.TField REQUEST_BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("requestBytes", org.apache.thrift.protocol.TType.I64, (short)3);
private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("options", org.apache.thrift.protocol.TType.STRUCT, (short)4);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new requestSpace_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new requestSpace_argsTupleSchemeFactory());
}
private long sessionId; // required
private long blockId; // required
private long requestBytes; // required
private RequestSpaceTOptions options; // 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 {
/**
* the id of the current session
*/
SESSION_ID((short)1, "sessionId"),
/**
* the id of the block being accessed
*/
BLOCK_ID((short)2, "blockId"),
/**
* the number of bytes requested
*/
REQUEST_BYTES((short)3, "requestBytes"),
/**
* the method options
*/
OPTIONS((short)4, "options");
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: // SESSION_ID
return SESSION_ID;
case 2: // BLOCK_ID
return BLOCK_ID;
case 3: // REQUEST_BYTES
return REQUEST_BYTES;
case 4: // OPTIONS
return OPTIONS;
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 __SESSIONID_ISSET_ID = 0;
private static final int __BLOCKID_ISSET_ID = 1;
private static final int __REQUESTBYTES_ISSET_ID = 2;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.BLOCK_ID, new org.apache.thrift.meta_data.FieldMetaData("blockId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.REQUEST_BYTES, new org.apache.thrift.meta_data.FieldMetaData("requestBytes", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("options", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RequestSpaceTOptions.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(requestSpace_args.class, metaDataMap);
}
public requestSpace_args() {
}
public requestSpace_args(
long sessionId,
long blockId,
long requestBytes,
RequestSpaceTOptions options)
{
this();
this.sessionId = sessionId;
setSessionIdIsSet(true);
this.blockId = blockId;
setBlockIdIsSet(true);
this.requestBytes = requestBytes;
setRequestBytesIsSet(true);
this.options = options;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public requestSpace_args(requestSpace_args other) {
__isset_bitfield = other.__isset_bitfield;
this.sessionId = other.sessionId;
this.blockId = other.blockId;
this.requestBytes = other.requestBytes;
if (other.isSetOptions()) {
this.options = new RequestSpaceTOptions(other.options);
}
}
public requestSpace_args deepCopy() {
return new requestSpace_args(this);
}
@Override
public void clear() {
setSessionIdIsSet(false);
this.sessionId = 0;
setBlockIdIsSet(false);
this.blockId = 0;
setRequestBytesIsSet(false);
this.requestBytes = 0;
this.options = null;
}
/**
* the id of the current session
*/
public long getSessionId() {
return this.sessionId;
}
/**
* the id of the current session
*/
public requestSpace_args setSessionId(long sessionId) {
this.sessionId = sessionId;
setSessionIdIsSet(true);
return this;
}
public void unsetSessionId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SESSIONID_ISSET_ID);
}
/** Returns true if field sessionId is set (has been assigned a value) and false otherwise */
public boolean isSetSessionId() {
return EncodingUtils.testBit(__isset_bitfield, __SESSIONID_ISSET_ID);
}
public void setSessionIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SESSIONID_ISSET_ID, value);
}
/**
* the id of the block being accessed
*/
public long getBlockId() {
return this.blockId;
}
/**
* the id of the block being accessed
*/
public requestSpace_args setBlockId(long blockId) {
this.blockId = blockId;
setBlockIdIsSet(true);
return this;
}
public void unsetBlockId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKID_ISSET_ID);
}
/** Returns true if field blockId is set (has been assigned a value) and false otherwise */
public boolean isSetBlockId() {
return EncodingUtils.testBit(__isset_bitfield, __BLOCKID_ISSET_ID);
}
public void setBlockIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKID_ISSET_ID, value);
}
/**
* the number of bytes requested
*/
public long getRequestBytes() {
return this.requestBytes;
}
/**
* the number of bytes requested
*/
public requestSpace_args setRequestBytes(long requestBytes) {
this.requestBytes = requestBytes;
setRequestBytesIsSet(true);
return this;
}
public void unsetRequestBytes() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REQUESTBYTES_ISSET_ID);
}
/** Returns true if field requestBytes is set (has been assigned a value) and false otherwise */
public boolean isSetRequestBytes() {
return EncodingUtils.testBit(__isset_bitfield, __REQUESTBYTES_ISSET_ID);
}
public void setRequestBytesIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REQUESTBYTES_ISSET_ID, value);
}
/**
* the method options
*/
public RequestSpaceTOptions getOptions() {
return this.options;
}
/**
* the method options
*/
public requestSpace_args setOptions(RequestSpaceTOptions options) {
this.options = options;
return this;
}
public void unsetOptions() {
this.options = null;
}
/** Returns true if field options is set (has been assigned a value) and false otherwise */
public boolean isSetOptions() {
return this.options != null;
}
public void setOptionsIsSet(boolean value) {
if (!value) {
this.options = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SESSION_ID:
if (value == null) {
unsetSessionId();
} else {
setSessionId((Long)value);
}
break;
case BLOCK_ID:
if (value == null) {
unsetBlockId();
} else {
setBlockId((Long)value);
}
break;
case REQUEST_BYTES:
if (value == null) {
unsetRequestBytes();
} else {
setRequestBytes((Long)value);
}
break;
case OPTIONS:
if (value == null) {
unsetOptions();
} else {
setOptions((RequestSpaceTOptions)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SESSION_ID:
return getSessionId();
case BLOCK_ID:
return getBlockId();
case REQUEST_BYTES:
return getRequestBytes();
case OPTIONS:
return getOptions();
}
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 SESSION_ID:
return isSetSessionId();
case BLOCK_ID:
return isSetBlockId();
case REQUEST_BYTES:
return isSetRequestBytes();
case OPTIONS:
return isSetOptions();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof requestSpace_args)
return this.equals((requestSpace_args)that);
return false;
}
public boolean equals(requestSpace_args that) {
if (that == null)
return false;
boolean this_present_sessionId = true;
boolean that_present_sessionId = true;
if (this_present_sessionId || that_present_sessionId) {
if (!(this_present_sessionId && that_present_sessionId))
return false;
if (this.sessionId != that.sessionId)
return false;
}
boolean this_present_blockId = true;
boolean that_present_blockId = true;
if (this_present_blockId || that_present_blockId) {
if (!(this_present_blockId && that_present_blockId))
return false;
if (this.blockId != that.blockId)
return false;
}
boolean this_present_requestBytes = true;
boolean that_present_requestBytes = true;
if (this_present_requestBytes || that_present_requestBytes) {
if (!(this_present_requestBytes && that_present_requestBytes))
return false;
if (this.requestBytes != that.requestBytes)
return false;
}
boolean this_present_options = true && this.isSetOptions();
boolean that_present_options = true && that.isSetOptions();
if (this_present_options || that_present_options) {
if (!(this_present_options && that_present_options))
return false;
if (!this.options.equals(that.options))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_sessionId = true;
list.add(present_sessionId);
if (present_sessionId)
list.add(sessionId);
boolean present_blockId = true;
list.add(present_blockId);
if (present_blockId)
list.add(blockId);
boolean present_requestBytes = true;
list.add(present_requestBytes);
if (present_requestBytes)
list.add(requestBytes);
boolean present_options = true && (isSetOptions());
list.add(present_options);
if (present_options)
list.add(options);
return list.hashCode();
}
@Override
public int compareTo(requestSpace_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSessionId()).compareTo(other.isSetSessionId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSessionId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, other.sessionId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetBlockId()).compareTo(other.isSetBlockId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetBlockId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockId, other.blockId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetRequestBytes()).compareTo(other.isSetRequestBytes());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetRequestBytes()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestBytes, other.requestBytes);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetOptions()).compareTo(other.isSetOptions());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOptions()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, other.options);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("requestSpace_args(");
boolean first = true;
sb.append("sessionId:");
sb.append(this.sessionId);
first = false;
if (!first) sb.append(", ");
sb.append("blockId:");
sb.append(this.blockId);
first = false;
if (!first) sb.append(", ");
sb.append("requestBytes:");
sb.append(this.requestBytes);
first = false;
if (!first) sb.append(", ");
sb.append("options:");
if (this.options == null) {
sb.append("null");
} else {
sb.append(this.options);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (options != null) {
options.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class requestSpace_argsStandardSchemeFactory implements SchemeFactory {
public requestSpace_argsStandardScheme getScheme() {
return new requestSpace_argsStandardScheme();
}
}
private static class requestSpace_argsStandardScheme extends StandardScheme<requestSpace_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, requestSpace_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // SESSION_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.sessionId = iprot.readI64();
struct.setSessionIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // BLOCK_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // REQUEST_BYTES
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.requestBytes = iprot.readI64();
struct.setRequestBytesIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // OPTIONS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.options = new RequestSpaceTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, requestSpace_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(SESSION_ID_FIELD_DESC);
oprot.writeI64(struct.sessionId);
oprot.writeFieldEnd();
oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC);
oprot.writeI64(struct.blockId);
oprot.writeFieldEnd();
oprot.writeFieldBegin(REQUEST_BYTES_FIELD_DESC);
oprot.writeI64(struct.requestBytes);
oprot.writeFieldEnd();
if (struct.options != null) {
oprot.writeFieldBegin(OPTIONS_FIELD_DESC);
struct.options.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class requestSpace_argsTupleSchemeFactory implements SchemeFactory {
public requestSpace_argsTupleScheme getScheme() {
return new requestSpace_argsTupleScheme();
}
}
private static class requestSpace_argsTupleScheme extends TupleScheme<requestSpace_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, requestSpace_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSessionId()) {
optionals.set(0);
}
if (struct.isSetBlockId()) {
optionals.set(1);
}
if (struct.isSetRequestBytes()) {
optionals.set(2);
}
if (struct.isSetOptions()) {
optionals.set(3);
}
oprot.writeBitSet(optionals, 4);
if (struct.isSetSessionId()) {
oprot.writeI64(struct.sessionId);
}
if (struct.isSetBlockId()) {
oprot.writeI64(struct.blockId);
}
if (struct.isSetRequestBytes()) {
oprot.writeI64(struct.requestBytes);
}
if (struct.isSetOptions()) {
struct.options.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, requestSpace_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(4);
if (incoming.get(0)) {
struct.sessionId = iprot.readI64();
struct.setSessionIdIsSet(true);
}
if (incoming.get(1)) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(true);
}
if (incoming.get(2)) {
struct.requestBytes = iprot.readI64();
struct.setRequestBytesIsSet(true);
}
if (incoming.get(3)) {
struct.options = new RequestSpaceTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
}
}
}
}
public static class requestSpace_result implements org.apache.thrift.TBase<requestSpace_result, requestSpace_result._Fields>, java.io.Serializable, Cloneable, Comparable<requestSpace_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("requestSpace_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 E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new requestSpace_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new requestSpace_resultTupleSchemeFactory());
}
private RequestSpaceTResponse success; // required
private alluxio.thrift.AlluxioTException e; // 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"),
E((short)1, "e");
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: // E
return E;
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, RequestSpaceTResponse.class)));
tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", 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(requestSpace_result.class, metaDataMap);
}
public requestSpace_result() {
}
public requestSpace_result(
RequestSpaceTResponse success,
alluxio.thrift.AlluxioTException e)
{
this();
this.success = success;
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public requestSpace_result(requestSpace_result other) {
if (other.isSetSuccess()) {
this.success = new RequestSpaceTResponse(other.success);
}
if (other.isSetE()) {
this.e = new alluxio.thrift.AlluxioTException(other.e);
}
}
public requestSpace_result deepCopy() {
return new requestSpace_result(this);
}
@Override
public void clear() {
this.success = null;
this.e = null;
}
public RequestSpaceTResponse getSuccess() {
return this.success;
}
public requestSpace_result setSuccess(RequestSpaceTResponse 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 alluxio.thrift.AlluxioTException getE() {
return this.e;
}
public requestSpace_result setE(alluxio.thrift.AlluxioTException e) {
this.e = e;
return this;
}
public void unsetE() {
this.e = null;
}
/** Returns true if field e is set (has been assigned a value) and false otherwise */
public boolean isSetE() {
return this.e != null;
}
public void setEIsSet(boolean value) {
if (!value) {
this.e = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((RequestSpaceTResponse)value);
}
break;
case E:
if (value == null) {
unsetE();
} else {
setE((alluxio.thrift.AlluxioTException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case E:
return getE();
}
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 E:
return isSetE();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof requestSpace_result)
return this.equals((requestSpace_result)that);
return false;
}
public boolean equals(requestSpace_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_e = true && this.isSetE();
boolean that_present_e = true && that.isSetE();
if (this_present_e || that_present_e) {
if (!(this_present_e && that_present_e))
return false;
if (!this.e.equals(that.e))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_success = true && (isSetSuccess());
list.add(present_success);
if (present_success)
list.add(success);
boolean present_e = true && (isSetE());
list.add(present_e);
if (present_e)
list.add(e);
return list.hashCode();
}
@Override
public int compareTo(requestSpace_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetE()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("requestSpace_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("e:");
if (this.e == null) {
sb.append("null");
} else {
sb.append(this.e);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (success != null) {
success.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class requestSpace_resultStandardSchemeFactory implements SchemeFactory {
public requestSpace_resultStandardScheme getScheme() {
return new requestSpace_resultStandardScheme();
}
}
private static class requestSpace_resultStandardScheme extends StandardScheme<requestSpace_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, requestSpace_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new RequestSpaceTResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // E
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, requestSpace_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.e != null) {
oprot.writeFieldBegin(E_FIELD_DESC);
struct.e.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class requestSpace_resultTupleSchemeFactory implements SchemeFactory {
public requestSpace_resultTupleScheme getScheme() {
return new requestSpace_resultTupleScheme();
}
}
private static class requestSpace_resultTupleScheme extends TupleScheme<requestSpace_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, requestSpace_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetE()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetE()) {
struct.e.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, requestSpace_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = new RequestSpaceTResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
}
}
}
}
public static class sessionBlockHeartbeat_args implements org.apache.thrift.TBase<sessionBlockHeartbeat_args, sessionBlockHeartbeat_args._Fields>, java.io.Serializable, Cloneable, Comparable<sessionBlockHeartbeat_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sessionBlockHeartbeat_args");
private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.I64, (short)1);
private static final org.apache.thrift.protocol.TField METRICS_FIELD_DESC = new org.apache.thrift.protocol.TField("metrics", org.apache.thrift.protocol.TType.LIST, (short)2);
private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("options", org.apache.thrift.protocol.TType.STRUCT, (short)3);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new sessionBlockHeartbeat_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new sessionBlockHeartbeat_argsTupleSchemeFactory());
}
private long sessionId; // required
private List<Long> metrics; // required
private SessionBlockHeartbeatTOptions options; // 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 {
/**
* the id of the current session
*/
SESSION_ID((short)1, "sessionId"),
/**
* deprecated since 1.3.0 and will be removed in 2.0
*/
METRICS((short)2, "metrics"),
/**
* the method options
*/
OPTIONS((short)3, "options");
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: // SESSION_ID
return SESSION_ID;
case 2: // METRICS
return METRICS;
case 3: // OPTIONS
return OPTIONS;
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 __SESSIONID_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.METRICS, new org.apache.thrift.meta_data.FieldMetaData("metrics", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
tmpMap.put(_Fields.OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("options", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SessionBlockHeartbeatTOptions.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sessionBlockHeartbeat_args.class, metaDataMap);
}
public sessionBlockHeartbeat_args() {
}
public sessionBlockHeartbeat_args(
long sessionId,
List<Long> metrics,
SessionBlockHeartbeatTOptions options)
{
this();
this.sessionId = sessionId;
setSessionIdIsSet(true);
this.metrics = metrics;
this.options = options;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public sessionBlockHeartbeat_args(sessionBlockHeartbeat_args other) {
__isset_bitfield = other.__isset_bitfield;
this.sessionId = other.sessionId;
if (other.isSetMetrics()) {
List<Long> __this__metrics = new ArrayList<Long>(other.metrics);
this.metrics = __this__metrics;
}
if (other.isSetOptions()) {
this.options = new SessionBlockHeartbeatTOptions(other.options);
}
}
public sessionBlockHeartbeat_args deepCopy() {
return new sessionBlockHeartbeat_args(this);
}
@Override
public void clear() {
setSessionIdIsSet(false);
this.sessionId = 0;
this.metrics = null;
this.options = null;
}
/**
* the id of the current session
*/
public long getSessionId() {
return this.sessionId;
}
/**
* the id of the current session
*/
public sessionBlockHeartbeat_args setSessionId(long sessionId) {
this.sessionId = sessionId;
setSessionIdIsSet(true);
return this;
}
public void unsetSessionId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SESSIONID_ISSET_ID);
}
/** Returns true if field sessionId is set (has been assigned a value) and false otherwise */
public boolean isSetSessionId() {
return EncodingUtils.testBit(__isset_bitfield, __SESSIONID_ISSET_ID);
}
public void setSessionIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SESSIONID_ISSET_ID, value);
}
public int getMetricsSize() {
return (this.metrics == null) ? 0 : this.metrics.size();
}
public java.util.Iterator<Long> getMetricsIterator() {
return (this.metrics == null) ? null : this.metrics.iterator();
}
public void addToMetrics(long elem) {
if (this.metrics == null) {
this.metrics = new ArrayList<Long>();
}
this.metrics.add(elem);
}
/**
* deprecated since 1.3.0 and will be removed in 2.0
*/
public List<Long> getMetrics() {
return this.metrics;
}
/**
* deprecated since 1.3.0 and will be removed in 2.0
*/
public sessionBlockHeartbeat_args setMetrics(List<Long> metrics) {
this.metrics = metrics;
return this;
}
public void unsetMetrics() {
this.metrics = null;
}
/** Returns true if field metrics is set (has been assigned a value) and false otherwise */
public boolean isSetMetrics() {
return this.metrics != null;
}
public void setMetricsIsSet(boolean value) {
if (!value) {
this.metrics = null;
}
}
/**
* the method options
*/
public SessionBlockHeartbeatTOptions getOptions() {
return this.options;
}
/**
* the method options
*/
public sessionBlockHeartbeat_args setOptions(SessionBlockHeartbeatTOptions options) {
this.options = options;
return this;
}
public void unsetOptions() {
this.options = null;
}
/** Returns true if field options is set (has been assigned a value) and false otherwise */
public boolean isSetOptions() {
return this.options != null;
}
public void setOptionsIsSet(boolean value) {
if (!value) {
this.options = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SESSION_ID:
if (value == null) {
unsetSessionId();
} else {
setSessionId((Long)value);
}
break;
case METRICS:
if (value == null) {
unsetMetrics();
} else {
setMetrics((List<Long>)value);
}
break;
case OPTIONS:
if (value == null) {
unsetOptions();
} else {
setOptions((SessionBlockHeartbeatTOptions)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SESSION_ID:
return getSessionId();
case METRICS:
return getMetrics();
case OPTIONS:
return getOptions();
}
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 SESSION_ID:
return isSetSessionId();
case METRICS:
return isSetMetrics();
case OPTIONS:
return isSetOptions();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof sessionBlockHeartbeat_args)
return this.equals((sessionBlockHeartbeat_args)that);
return false;
}
public boolean equals(sessionBlockHeartbeat_args that) {
if (that == null)
return false;
boolean this_present_sessionId = true;
boolean that_present_sessionId = true;
if (this_present_sessionId || that_present_sessionId) {
if (!(this_present_sessionId && that_present_sessionId))
return false;
if (this.sessionId != that.sessionId)
return false;
}
boolean this_present_metrics = true && this.isSetMetrics();
boolean that_present_metrics = true && that.isSetMetrics();
if (this_present_metrics || that_present_metrics) {
if (!(this_present_metrics && that_present_metrics))
return false;
if (!this.metrics.equals(that.metrics))
return false;
}
boolean this_present_options = true && this.isSetOptions();
boolean that_present_options = true && that.isSetOptions();
if (this_present_options || that_present_options) {
if (!(this_present_options && that_present_options))
return false;
if (!this.options.equals(that.options))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_sessionId = true;
list.add(present_sessionId);
if (present_sessionId)
list.add(sessionId);
boolean present_metrics = true && (isSetMetrics());
list.add(present_metrics);
if (present_metrics)
list.add(metrics);
boolean present_options = true && (isSetOptions());
list.add(present_options);
if (present_options)
list.add(options);
return list.hashCode();
}
@Override
public int compareTo(sessionBlockHeartbeat_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSessionId()).compareTo(other.isSetSessionId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSessionId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, other.sessionId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetMetrics()).compareTo(other.isSetMetrics());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetMetrics()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metrics, other.metrics);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetOptions()).compareTo(other.isSetOptions());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOptions()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, other.options);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("sessionBlockHeartbeat_args(");
boolean first = true;
sb.append("sessionId:");
sb.append(this.sessionId);
first = false;
if (!first) sb.append(", ");
sb.append("metrics:");
if (this.metrics == null) {
sb.append("null");
} else {
sb.append(this.metrics);
}
first = false;
if (!first) sb.append(", ");
sb.append("options:");
if (this.options == null) {
sb.append("null");
} else {
sb.append(this.options);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (options != null) {
options.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class sessionBlockHeartbeat_argsStandardSchemeFactory implements SchemeFactory {
public sessionBlockHeartbeat_argsStandardScheme getScheme() {
return new sessionBlockHeartbeat_argsStandardScheme();
}
}
private static class sessionBlockHeartbeat_argsStandardScheme extends StandardScheme<sessionBlockHeartbeat_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, sessionBlockHeartbeat_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // SESSION_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.sessionId = iprot.readI64();
struct.setSessionIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // METRICS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
struct.metrics = new ArrayList<Long>(_list0.size);
long _elem1;
for (int _i2 = 0; _i2 < _list0.size; ++_i2)
{
_elem1 = iprot.readI64();
struct.metrics.add(_elem1);
}
iprot.readListEnd();
}
struct.setMetricsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // OPTIONS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.options = new SessionBlockHeartbeatTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, sessionBlockHeartbeat_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(SESSION_ID_FIELD_DESC);
oprot.writeI64(struct.sessionId);
oprot.writeFieldEnd();
if (struct.metrics != null) {
oprot.writeFieldBegin(METRICS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.metrics.size()));
for (long _iter3 : struct.metrics)
{
oprot.writeI64(_iter3);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
if (struct.options != null) {
oprot.writeFieldBegin(OPTIONS_FIELD_DESC);
struct.options.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class sessionBlockHeartbeat_argsTupleSchemeFactory implements SchemeFactory {
public sessionBlockHeartbeat_argsTupleScheme getScheme() {
return new sessionBlockHeartbeat_argsTupleScheme();
}
}
private static class sessionBlockHeartbeat_argsTupleScheme extends TupleScheme<sessionBlockHeartbeat_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, sessionBlockHeartbeat_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSessionId()) {
optionals.set(0);
}
if (struct.isSetMetrics()) {
optionals.set(1);
}
if (struct.isSetOptions()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetSessionId()) {
oprot.writeI64(struct.sessionId);
}
if (struct.isSetMetrics()) {
{
oprot.writeI32(struct.metrics.size());
for (long _iter4 : struct.metrics)
{
oprot.writeI64(_iter4);
}
}
}
if (struct.isSetOptions()) {
struct.options.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, sessionBlockHeartbeat_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.sessionId = iprot.readI64();
struct.setSessionIdIsSet(true);
}
if (incoming.get(1)) {
{
org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32());
struct.metrics = new ArrayList<Long>(_list5.size);
long _elem6;
for (int _i7 = 0; _i7 < _list5.size; ++_i7)
{
_elem6 = iprot.readI64();
struct.metrics.add(_elem6);
}
}
struct.setMetricsIsSet(true);
}
if (incoming.get(2)) {
struct.options = new SessionBlockHeartbeatTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
}
}
}
}
public static class sessionBlockHeartbeat_result implements org.apache.thrift.TBase<sessionBlockHeartbeat_result, sessionBlockHeartbeat_result._Fields>, java.io.Serializable, Cloneable, Comparable<sessionBlockHeartbeat_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sessionBlockHeartbeat_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 E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new sessionBlockHeartbeat_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new sessionBlockHeartbeat_resultTupleSchemeFactory());
}
private SessionBlockHeartbeatTResponse success; // required
private alluxio.thrift.AlluxioTException e; // 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"),
E((short)1, "e");
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: // E
return E;
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, SessionBlockHeartbeatTResponse.class)));
tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", 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(sessionBlockHeartbeat_result.class, metaDataMap);
}
public sessionBlockHeartbeat_result() {
}
public sessionBlockHeartbeat_result(
SessionBlockHeartbeatTResponse success,
alluxio.thrift.AlluxioTException e)
{
this();
this.success = success;
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public sessionBlockHeartbeat_result(sessionBlockHeartbeat_result other) {
if (other.isSetSuccess()) {
this.success = new SessionBlockHeartbeatTResponse(other.success);
}
if (other.isSetE()) {
this.e = new alluxio.thrift.AlluxioTException(other.e);
}
}
public sessionBlockHeartbeat_result deepCopy() {
return new sessionBlockHeartbeat_result(this);
}
@Override
public void clear() {
this.success = null;
this.e = null;
}
public SessionBlockHeartbeatTResponse getSuccess() {
return this.success;
}
public sessionBlockHeartbeat_result setSuccess(SessionBlockHeartbeatTResponse 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 alluxio.thrift.AlluxioTException getE() {
return this.e;
}
public sessionBlockHeartbeat_result setE(alluxio.thrift.AlluxioTException e) {
this.e = e;
return this;
}
public void unsetE() {
this.e = null;
}
/** Returns true if field e is set (has been assigned a value) and false otherwise */
public boolean isSetE() {
return this.e != null;
}
public void setEIsSet(boolean value) {
if (!value) {
this.e = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((SessionBlockHeartbeatTResponse)value);
}
break;
case E:
if (value == null) {
unsetE();
} else {
setE((alluxio.thrift.AlluxioTException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case E:
return getE();
}
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 E:
return isSetE();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof sessionBlockHeartbeat_result)
return this.equals((sessionBlockHeartbeat_result)that);
return false;
}
public boolean equals(sessionBlockHeartbeat_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_e = true && this.isSetE();
boolean that_present_e = true && that.isSetE();
if (this_present_e || that_present_e) {
if (!(this_present_e && that_present_e))
return false;
if (!this.e.equals(that.e))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_success = true && (isSetSuccess());
list.add(present_success);
if (present_success)
list.add(success);
boolean present_e = true && (isSetE());
list.add(present_e);
if (present_e)
list.add(e);
return list.hashCode();
}
@Override
public int compareTo(sessionBlockHeartbeat_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetE()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("sessionBlockHeartbeat_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("e:");
if (this.e == null) {
sb.append("null");
} else {
sb.append(this.e);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (success != null) {
success.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class sessionBlockHeartbeat_resultStandardSchemeFactory implements SchemeFactory {
public sessionBlockHeartbeat_resultStandardScheme getScheme() {
return new sessionBlockHeartbeat_resultStandardScheme();
}
}
private static class sessionBlockHeartbeat_resultStandardScheme extends StandardScheme<sessionBlockHeartbeat_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, sessionBlockHeartbeat_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new SessionBlockHeartbeatTResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // E
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, sessionBlockHeartbeat_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.e != null) {
oprot.writeFieldBegin(E_FIELD_DESC);
struct.e.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class sessionBlockHeartbeat_resultTupleSchemeFactory implements SchemeFactory {
public sessionBlockHeartbeat_resultTupleScheme getScheme() {
return new sessionBlockHeartbeat_resultTupleScheme();
}
}
private static class sessionBlockHeartbeat_resultTupleScheme extends TupleScheme<sessionBlockHeartbeat_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, sessionBlockHeartbeat_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetE()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetE()) {
struct.e.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, sessionBlockHeartbeat_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = new SessionBlockHeartbeatTResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
}
}
}
}
public static class unlockBlock_args implements org.apache.thrift.TBase<unlockBlock_args, unlockBlock_args._Fields>, java.io.Serializable, Cloneable, Comparable<unlockBlock_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("unlockBlock_args");
private static final org.apache.thrift.protocol.TField BLOCK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("blockId", org.apache.thrift.protocol.TType.I64, (short)1);
private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.I64, (short)2);
private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("options", org.apache.thrift.protocol.TType.STRUCT, (short)3);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new unlockBlock_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new unlockBlock_argsTupleSchemeFactory());
}
private long blockId; // required
private long sessionId; // required
private UnlockBlockTOptions options; // 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 {
/**
* the id of the block being accessed
*/
BLOCK_ID((short)1, "blockId"),
/**
* the id of the current session
*/
SESSION_ID((short)2, "sessionId"),
/**
* the method options
*/
OPTIONS((short)3, "options");
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: // BLOCK_ID
return BLOCK_ID;
case 2: // SESSION_ID
return SESSION_ID;
case 3: // OPTIONS
return OPTIONS;
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 __BLOCKID_ISSET_ID = 0;
private static final int __SESSIONID_ISSET_ID = 1;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.BLOCK_ID, new org.apache.thrift.meta_data.FieldMetaData("blockId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("options", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, UnlockBlockTOptions.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(unlockBlock_args.class, metaDataMap);
}
public unlockBlock_args() {
}
public unlockBlock_args(
long blockId,
long sessionId,
UnlockBlockTOptions options)
{
this();
this.blockId = blockId;
setBlockIdIsSet(true);
this.sessionId = sessionId;
setSessionIdIsSet(true);
this.options = options;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public unlockBlock_args(unlockBlock_args other) {
__isset_bitfield = other.__isset_bitfield;
this.blockId = other.blockId;
this.sessionId = other.sessionId;
if (other.isSetOptions()) {
this.options = new UnlockBlockTOptions(other.options);
}
}
public unlockBlock_args deepCopy() {
return new unlockBlock_args(this);
}
@Override
public void clear() {
setBlockIdIsSet(false);
this.blockId = 0;
setSessionIdIsSet(false);
this.sessionId = 0;
this.options = null;
}
/**
* the id of the block being accessed
*/
public long getBlockId() {
return this.blockId;
}
/**
* the id of the block being accessed
*/
public unlockBlock_args setBlockId(long blockId) {
this.blockId = blockId;
setBlockIdIsSet(true);
return this;
}
public void unsetBlockId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKID_ISSET_ID);
}
/** Returns true if field blockId is set (has been assigned a value) and false otherwise */
public boolean isSetBlockId() {
return EncodingUtils.testBit(__isset_bitfield, __BLOCKID_ISSET_ID);
}
public void setBlockIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKID_ISSET_ID, value);
}
/**
* the id of the current session
*/
public long getSessionId() {
return this.sessionId;
}
/**
* the id of the current session
*/
public unlockBlock_args setSessionId(long sessionId) {
this.sessionId = sessionId;
setSessionIdIsSet(true);
return this;
}
public void unsetSessionId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SESSIONID_ISSET_ID);
}
/** Returns true if field sessionId is set (has been assigned a value) and false otherwise */
public boolean isSetSessionId() {
return EncodingUtils.testBit(__isset_bitfield, __SESSIONID_ISSET_ID);
}
public void setSessionIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SESSIONID_ISSET_ID, value);
}
/**
* the method options
*/
public UnlockBlockTOptions getOptions() {
return this.options;
}
/**
* the method options
*/
public unlockBlock_args setOptions(UnlockBlockTOptions options) {
this.options = options;
return this;
}
public void unsetOptions() {
this.options = null;
}
/** Returns true if field options is set (has been assigned a value) and false otherwise */
public boolean isSetOptions() {
return this.options != null;
}
public void setOptionsIsSet(boolean value) {
if (!value) {
this.options = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case BLOCK_ID:
if (value == null) {
unsetBlockId();
} else {
setBlockId((Long)value);
}
break;
case SESSION_ID:
if (value == null) {
unsetSessionId();
} else {
setSessionId((Long)value);
}
break;
case OPTIONS:
if (value == null) {
unsetOptions();
} else {
setOptions((UnlockBlockTOptions)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case BLOCK_ID:
return getBlockId();
case SESSION_ID:
return getSessionId();
case OPTIONS:
return getOptions();
}
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 BLOCK_ID:
return isSetBlockId();
case SESSION_ID:
return isSetSessionId();
case OPTIONS:
return isSetOptions();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof unlockBlock_args)
return this.equals((unlockBlock_args)that);
return false;
}
public boolean equals(unlockBlock_args that) {
if (that == null)
return false;
boolean this_present_blockId = true;
boolean that_present_blockId = true;
if (this_present_blockId || that_present_blockId) {
if (!(this_present_blockId && that_present_blockId))
return false;
if (this.blockId != that.blockId)
return false;
}
boolean this_present_sessionId = true;
boolean that_present_sessionId = true;
if (this_present_sessionId || that_present_sessionId) {
if (!(this_present_sessionId && that_present_sessionId))
return false;
if (this.sessionId != that.sessionId)
return false;
}
boolean this_present_options = true && this.isSetOptions();
boolean that_present_options = true && that.isSetOptions();
if (this_present_options || that_present_options) {
if (!(this_present_options && that_present_options))
return false;
if (!this.options.equals(that.options))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_blockId = true;
list.add(present_blockId);
if (present_blockId)
list.add(blockId);
boolean present_sessionId = true;
list.add(present_sessionId);
if (present_sessionId)
list.add(sessionId);
boolean present_options = true && (isSetOptions());
list.add(present_options);
if (present_options)
list.add(options);
return list.hashCode();
}
@Override
public int compareTo(unlockBlock_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetBlockId()).compareTo(other.isSetBlockId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetBlockId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockId, other.blockId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetSessionId()).compareTo(other.isSetSessionId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSessionId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, other.sessionId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetOptions()).compareTo(other.isSetOptions());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOptions()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, other.options);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("unlockBlock_args(");
boolean first = true;
sb.append("blockId:");
sb.append(this.blockId);
first = false;
if (!first) sb.append(", ");
sb.append("sessionId:");
sb.append(this.sessionId);
first = false;
if (!first) sb.append(", ");
sb.append("options:");
if (this.options == null) {
sb.append("null");
} else {
sb.append(this.options);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (options != null) {
options.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class unlockBlock_argsStandardSchemeFactory implements SchemeFactory {
public unlockBlock_argsStandardScheme getScheme() {
return new unlockBlock_argsStandardScheme();
}
}
private static class unlockBlock_argsStandardScheme extends StandardScheme<unlockBlock_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, unlockBlock_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // BLOCK_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // SESSION_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.sessionId = iprot.readI64();
struct.setSessionIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // OPTIONS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.options = new UnlockBlockTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, unlockBlock_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC);
oprot.writeI64(struct.blockId);
oprot.writeFieldEnd();
oprot.writeFieldBegin(SESSION_ID_FIELD_DESC);
oprot.writeI64(struct.sessionId);
oprot.writeFieldEnd();
if (struct.options != null) {
oprot.writeFieldBegin(OPTIONS_FIELD_DESC);
struct.options.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class unlockBlock_argsTupleSchemeFactory implements SchemeFactory {
public unlockBlock_argsTupleScheme getScheme() {
return new unlockBlock_argsTupleScheme();
}
}
private static class unlockBlock_argsTupleScheme extends TupleScheme<unlockBlock_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, unlockBlock_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetBlockId()) {
optionals.set(0);
}
if (struct.isSetSessionId()) {
optionals.set(1);
}
if (struct.isSetOptions()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetBlockId()) {
oprot.writeI64(struct.blockId);
}
if (struct.isSetSessionId()) {
oprot.writeI64(struct.sessionId);
}
if (struct.isSetOptions()) {
struct.options.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, unlockBlock_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(true);
}
if (incoming.get(1)) {
struct.sessionId = iprot.readI64();
struct.setSessionIdIsSet(true);
}
if (incoming.get(2)) {
struct.options = new UnlockBlockTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
}
}
}
}
public static class unlockBlock_result implements org.apache.thrift.TBase<unlockBlock_result, unlockBlock_result._Fields>, java.io.Serializable, Cloneable, Comparable<unlockBlock_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("unlockBlock_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 E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new unlockBlock_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new unlockBlock_resultTupleSchemeFactory());
}
private UnlockBlockTResponse success; // required
private alluxio.thrift.AlluxioTException e; // 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"),
E((short)1, "e");
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: // E
return E;
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, UnlockBlockTResponse.class)));
tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", 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(unlockBlock_result.class, metaDataMap);
}
public unlockBlock_result() {
}
public unlockBlock_result(
UnlockBlockTResponse success,
alluxio.thrift.AlluxioTException e)
{
this();
this.success = success;
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public unlockBlock_result(unlockBlock_result other) {
if (other.isSetSuccess()) {
this.success = new UnlockBlockTResponse(other.success);
}
if (other.isSetE()) {
this.e = new alluxio.thrift.AlluxioTException(other.e);
}
}
public unlockBlock_result deepCopy() {
return new unlockBlock_result(this);
}
@Override
public void clear() {
this.success = null;
this.e = null;
}
public UnlockBlockTResponse getSuccess() {
return this.success;
}
public unlockBlock_result setSuccess(UnlockBlockTResponse 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 alluxio.thrift.AlluxioTException getE() {
return this.e;
}
public unlockBlock_result setE(alluxio.thrift.AlluxioTException e) {
this.e = e;
return this;
}
public void unsetE() {
this.e = null;
}
/** Returns true if field e is set (has been assigned a value) and false otherwise */
public boolean isSetE() {
return this.e != null;
}
public void setEIsSet(boolean value) {
if (!value) {
this.e = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((UnlockBlockTResponse)value);
}
break;
case E:
if (value == null) {
unsetE();
} else {
setE((alluxio.thrift.AlluxioTException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case E:
return getE();
}
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 E:
return isSetE();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof unlockBlock_result)
return this.equals((unlockBlock_result)that);
return false;
}
public boolean equals(unlockBlock_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_e = true && this.isSetE();
boolean that_present_e = true && that.isSetE();
if (this_present_e || that_present_e) {
if (!(this_present_e && that_present_e))
return false;
if (!this.e.equals(that.e))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_success = true && (isSetSuccess());
list.add(present_success);
if (present_success)
list.add(success);
boolean present_e = true && (isSetE());
list.add(present_e);
if (present_e)
list.add(e);
return list.hashCode();
}
@Override
public int compareTo(unlockBlock_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetE()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("unlockBlock_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("e:");
if (this.e == null) {
sb.append("null");
} else {
sb.append(this.e);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (success != null) {
success.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class unlockBlock_resultStandardSchemeFactory implements SchemeFactory {
public unlockBlock_resultStandardScheme getScheme() {
return new unlockBlock_resultStandardScheme();
}
}
private static class unlockBlock_resultStandardScheme extends StandardScheme<unlockBlock_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, unlockBlock_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new UnlockBlockTResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // E
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, unlockBlock_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.e != null) {
oprot.writeFieldBegin(E_FIELD_DESC);
struct.e.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class unlockBlock_resultTupleSchemeFactory implements SchemeFactory {
public unlockBlock_resultTupleScheme getScheme() {
return new unlockBlock_resultTupleScheme();
}
}
private static class unlockBlock_resultTupleScheme extends TupleScheme<unlockBlock_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, unlockBlock_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetE()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetE()) {
struct.e.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, unlockBlock_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = new UnlockBlockTResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
}
}
}
}
}