/**
* 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
*/
public void accessBlock(long blockId) 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
*/
public void cacheBlock(long sessionId, long blockId) 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
*/
public void cancelBlock(long sessionId, long blockId) 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 block options
*/
public LockBlockResult 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
*/
public boolean promoteBlock(long blockId) 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
*/
public void removeBlock(long blockId) 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
*/
public String requestBlockLocation(long sessionId, long blockId, long initialBytes, int writeTier) 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
*/
public boolean requestSpace(long sessionId, long blockId, long requestBytes) 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
*/
public void sessionHeartbeat(long sessionId, List<Long> metrics) 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
*/
public boolean unlockBlock(long blockId, long sessionId) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
}
public interface AsyncIface extends alluxio.thrift.AlluxioService .AsyncIface {
public void accessBlock(long blockId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void cacheBlock(long sessionId, long blockId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void cancelBlock(long sessionId, long blockId, 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, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void removeBlock(long blockId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void requestBlockLocation(long sessionId, long blockId, long initialBytes, int writeTier, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void requestSpace(long sessionId, long blockId, long requestBytes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void sessionHeartbeat(long sessionId, List<Long> metrics, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void unlockBlock(long blockId, long sessionId, 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 void accessBlock(long blockId) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_accessBlock(blockId);
recv_accessBlock();
}
public void send_accessBlock(long blockId) throws org.apache.thrift.TException
{
accessBlock_args args = new accessBlock_args();
args.setBlockId(blockId);
sendBase("accessBlock", args);
}
public void recv_accessBlock() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
accessBlock_result result = new accessBlock_result();
receiveBase(result, "accessBlock");
if (result.e != null) {
throw result.e;
}
return;
}
public void cacheBlock(long sessionId, long blockId) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_cacheBlock(sessionId, blockId);
recv_cacheBlock();
}
public void send_cacheBlock(long sessionId, long blockId) throws org.apache.thrift.TException
{
cacheBlock_args args = new cacheBlock_args();
args.setSessionId(sessionId);
args.setBlockId(blockId);
sendBase("cacheBlock", args);
}
public void recv_cacheBlock() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
cacheBlock_result result = new cacheBlock_result();
receiveBase(result, "cacheBlock");
if (result.e != null) {
throw result.e;
}
return;
}
public void cancelBlock(long sessionId, long blockId) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_cancelBlock(sessionId, blockId);
recv_cancelBlock();
}
public void send_cancelBlock(long sessionId, long blockId) throws org.apache.thrift.TException
{
cancelBlock_args args = new cancelBlock_args();
args.setSessionId(sessionId);
args.setBlockId(blockId);
sendBase("cancelBlock", args);
}
public void recv_cancelBlock() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
cancelBlock_result result = new cancelBlock_result();
receiveBase(result, "cancelBlock");
if (result.e != null) {
throw result.e;
}
return;
}
public LockBlockResult 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 LockBlockResult 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 boolean promoteBlock(long blockId) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_promoteBlock(blockId);
return recv_promoteBlock();
}
public void send_promoteBlock(long blockId) throws org.apache.thrift.TException
{
promoteBlock_args args = new promoteBlock_args();
args.setBlockId(blockId);
sendBase("promoteBlock", args);
}
public boolean 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 void removeBlock(long blockId) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_removeBlock(blockId);
recv_removeBlock();
}
public void send_removeBlock(long blockId) throws org.apache.thrift.TException
{
removeBlock_args args = new removeBlock_args();
args.setBlockId(blockId);
sendBase("removeBlock", args);
}
public void recv_removeBlock() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
removeBlock_result result = new removeBlock_result();
receiveBase(result, "removeBlock");
if (result.e != null) {
throw result.e;
}
return;
}
public String requestBlockLocation(long sessionId, long blockId, long initialBytes, int writeTier) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_requestBlockLocation(sessionId, blockId, initialBytes, writeTier);
return recv_requestBlockLocation();
}
public void send_requestBlockLocation(long sessionId, long blockId, long initialBytes, int writeTier) throws org.apache.thrift.TException
{
requestBlockLocation_args args = new requestBlockLocation_args();
args.setSessionId(sessionId);
args.setBlockId(blockId);
args.setInitialBytes(initialBytes);
args.setWriteTier(writeTier);
sendBase("requestBlockLocation", args);
}
public String 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 boolean requestSpace(long sessionId, long blockId, long requestBytes) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_requestSpace(sessionId, blockId, requestBytes);
return recv_requestSpace();
}
public void send_requestSpace(long sessionId, long blockId, long requestBytes) throws org.apache.thrift.TException
{
requestSpace_args args = new requestSpace_args();
args.setSessionId(sessionId);
args.setBlockId(blockId);
args.setRequestBytes(requestBytes);
sendBase("requestSpace", args);
}
public boolean 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 void sessionHeartbeat(long sessionId, List<Long> metrics) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_sessionHeartbeat(sessionId, metrics);
recv_sessionHeartbeat();
}
public void send_sessionHeartbeat(long sessionId, List<Long> metrics) throws org.apache.thrift.TException
{
sessionHeartbeat_args args = new sessionHeartbeat_args();
args.setSessionId(sessionId);
args.setMetrics(metrics);
sendBase("sessionHeartbeat", args);
}
public void recv_sessionHeartbeat() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
sessionHeartbeat_result result = new sessionHeartbeat_result();
receiveBase(result, "sessionHeartbeat");
if (result.e != null) {
throw result.e;
}
return;
}
public boolean unlockBlock(long blockId, long sessionId) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_unlockBlock(blockId, sessionId);
return recv_unlockBlock();
}
public void send_unlockBlock(long blockId, long sessionId) throws org.apache.thrift.TException
{
unlockBlock_args args = new unlockBlock_args();
args.setBlockId(blockId);
args.setSessionId(sessionId);
sendBase("unlockBlock", args);
}
public boolean 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, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
accessBlock_call method_call = new accessBlock_call(blockId, 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;
public accessBlock_call(long blockId, 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;
}
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.write(prot);
prot.writeMessageEnd();
}
public void 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);
(new Client(prot)).recv_accessBlock();
}
}
public void cacheBlock(long sessionId, long blockId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
cacheBlock_call method_call = new cacheBlock_call(sessionId, blockId, 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;
public cacheBlock_call(long sessionId, long blockId, 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;
}
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.write(prot);
prot.writeMessageEnd();
}
public void 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);
(new Client(prot)).recv_cacheBlock();
}
}
public void cancelBlock(long sessionId, long blockId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
cancelBlock_call method_call = new cancelBlock_call(sessionId, blockId, 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;
public cancelBlock_call(long sessionId, long blockId, 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;
}
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.write(prot);
prot.writeMessageEnd();
}
public void 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);
(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 LockBlockResult 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, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
promoteBlock_call method_call = new promoteBlock_call(blockId, 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;
public promoteBlock_call(long blockId, 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;
}
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.write(prot);
prot.writeMessageEnd();
}
public boolean 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, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
removeBlock_call method_call = new removeBlock_call(blockId, 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;
public removeBlock_call(long blockId, 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;
}
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.write(prot);
prot.writeMessageEnd();
}
public void 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);
(new Client(prot)).recv_removeBlock();
}
}
public void requestBlockLocation(long sessionId, long blockId, long initialBytes, int writeTier, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
requestBlockLocation_call method_call = new requestBlockLocation_call(sessionId, blockId, initialBytes, writeTier, 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;
public requestBlockLocation_call(long sessionId, long blockId, long initialBytes, int writeTier, 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;
}
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.write(prot);
prot.writeMessageEnd();
}
public String 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, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
requestSpace_call method_call = new requestSpace_call(sessionId, blockId, requestBytes, 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;
public requestSpace_call(long sessionId, long blockId, long requestBytes, 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;
}
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.write(prot);
prot.writeMessageEnd();
}
public boolean 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 sessionHeartbeat(long sessionId, List<Long> metrics, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
sessionHeartbeat_call method_call = new sessionHeartbeat_call(sessionId, metrics, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class sessionHeartbeat_call extends org.apache.thrift.async.TAsyncMethodCall {
private long sessionId;
private List<Long> metrics;
public sessionHeartbeat_call(long sessionId, List<Long> metrics, 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;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("sessionHeartbeat", org.apache.thrift.protocol.TMessageType.CALL, 0));
sessionHeartbeat_args args = new sessionHeartbeat_args();
args.setSessionId(sessionId);
args.setMetrics(metrics);
args.write(prot);
prot.writeMessageEnd();
}
public void 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);
(new Client(prot)).recv_sessionHeartbeat();
}
}
public void unlockBlock(long blockId, long sessionId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
unlockBlock_call method_call = new unlockBlock_call(blockId, sessionId, 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;
public unlockBlock_call(long blockId, long sessionId, 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;
}
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.write(prot);
prot.writeMessageEnd();
}
public boolean 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("sessionHeartbeat", new sessionHeartbeat());
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 {
iface.accessBlock(args.blockId);
} 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 {
iface.cacheBlock(args.sessionId, args.blockId);
} 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 {
iface.cancelBlock(args.sessionId, args.blockId);
} 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);
result.setSuccessIsSet(true);
} 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 {
iface.removeBlock(args.blockId);
} 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);
} 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);
result.setSuccessIsSet(true);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class sessionHeartbeat<I extends Iface> extends org.apache.thrift.ProcessFunction<I, sessionHeartbeat_args> {
public sessionHeartbeat() {
super("sessionHeartbeat");
}
public sessionHeartbeat_args getEmptyArgsInstance() {
return new sessionHeartbeat_args();
}
protected boolean isOneway() {
return false;
}
public sessionHeartbeat_result getResult(I iface, sessionHeartbeat_args args) throws org.apache.thrift.TException {
sessionHeartbeat_result result = new sessionHeartbeat_result();
try {
iface.sessionHeartbeat(args.sessionId, args.metrics);
} 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);
result.setSuccessIsSet(true);
} 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("sessionHeartbeat", new sessionHeartbeat());
processMap.put("unlockBlock", new unlockBlock());
return processMap;
}
public static class accessBlock<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, accessBlock_args, Void> {
public accessBlock() {
super("accessBlock");
}
public accessBlock_args getEmptyArgsInstance() {
return new accessBlock_args();
}
public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<Void>() {
public void onComplete(Void o) {
accessBlock_result result = new accessBlock_result();
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<Void> resultHandler) throws TException {
iface.accessBlock(args.blockId,resultHandler);
}
}
public static class cacheBlock<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, cacheBlock_args, Void> {
public cacheBlock() {
super("cacheBlock");
}
public cacheBlock_args getEmptyArgsInstance() {
return new cacheBlock_args();
}
public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<Void>() {
public void onComplete(Void o) {
cacheBlock_result result = new cacheBlock_result();
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<Void> resultHandler) throws TException {
iface.cacheBlock(args.sessionId, args.blockId,resultHandler);
}
}
public static class cancelBlock<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, cancelBlock_args, Void> {
public cancelBlock() {
super("cancelBlock");
}
public cancelBlock_args getEmptyArgsInstance() {
return new cancelBlock_args();
}
public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<Void>() {
public void onComplete(Void o) {
cancelBlock_result result = new cancelBlock_result();
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<Void> resultHandler) throws TException {
iface.cancelBlock(args.sessionId, args.blockId,resultHandler);
}
}
public static class lockBlock<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, lockBlock_args, LockBlockResult> {
public lockBlock() {
super("lockBlock");
}
public lockBlock_args getEmptyArgsInstance() {
return new lockBlock_args();
}
public AsyncMethodCallback<LockBlockResult> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<LockBlockResult>() {
public void onComplete(LockBlockResult 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<LockBlockResult> 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, Boolean> {
public promoteBlock() {
super("promoteBlock");
}
public promoteBlock_args getEmptyArgsInstance() {
return new promoteBlock_args();
}
public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<Boolean>() {
public void onComplete(Boolean o) {
promoteBlock_result result = new promoteBlock_result();
result.success = o;
result.setSuccessIsSet(true);
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<Boolean> resultHandler) throws TException {
iface.promoteBlock(args.blockId,resultHandler);
}
}
public static class removeBlock<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, removeBlock_args, Void> {
public removeBlock() {
super("removeBlock");
}
public removeBlock_args getEmptyArgsInstance() {
return new removeBlock_args();
}
public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<Void>() {
public void onComplete(Void o) {
removeBlock_result result = new removeBlock_result();
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<Void> resultHandler) throws TException {
iface.removeBlock(args.blockId,resultHandler);
}
}
public static class requestBlockLocation<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, requestBlockLocation_args, String> {
public requestBlockLocation() {
super("requestBlockLocation");
}
public requestBlockLocation_args getEmptyArgsInstance() {
return new requestBlockLocation_args();
}
public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<String>() {
public void onComplete(String 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<String> resultHandler) throws TException {
iface.requestBlockLocation(args.sessionId, args.blockId, args.initialBytes, args.writeTier,resultHandler);
}
}
public static class requestSpace<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, requestSpace_args, Boolean> {
public requestSpace() {
super("requestSpace");
}
public requestSpace_args getEmptyArgsInstance() {
return new requestSpace_args();
}
public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<Boolean>() {
public void onComplete(Boolean o) {
requestSpace_result result = new requestSpace_result();
result.success = o;
result.setSuccessIsSet(true);
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<Boolean> resultHandler) throws TException {
iface.requestSpace(args.sessionId, args.blockId, args.requestBytes,resultHandler);
}
}
public static class sessionHeartbeat<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, sessionHeartbeat_args, Void> {
public sessionHeartbeat() {
super("sessionHeartbeat");
}
public sessionHeartbeat_args getEmptyArgsInstance() {
return new sessionHeartbeat_args();
}
public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<Void>() {
public void onComplete(Void o) {
sessionHeartbeat_result result = new sessionHeartbeat_result();
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;
sessionHeartbeat_result result = new sessionHeartbeat_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, sessionHeartbeat_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
iface.sessionHeartbeat(args.sessionId, args.metrics,resultHandler);
}
}
public static class unlockBlock<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, unlockBlock_args, Boolean> {
public unlockBlock() {
super("unlockBlock");
}
public unlockBlock_args getEmptyArgsInstance() {
return new unlockBlock_args();
}
public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<Boolean>() {
public void onComplete(Boolean o) {
unlockBlock_result result = new unlockBlock_result();
result.success = o;
result.setSuccessIsSet(true);
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<Boolean> resultHandler) throws TException {
iface.unlockBlock(args.blockId, args.sessionId,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 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
/** 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");
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;
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)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(accessBlock_args.class, metaDataMap);
}
public accessBlock_args() {
}
public accessBlock_args(
long blockId)
{
this();
this.blockId = blockId;
setBlockIdIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public accessBlock_args(accessBlock_args other) {
__isset_bitfield = other.__isset_bitfield;
this.blockId = other.blockId;
}
public accessBlock_args deepCopy() {
return new accessBlock_args(this);
}
@Override
public void clear() {
setBlockIdIsSet(false);
this.blockId = 0;
}
/**
* 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);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case BLOCK_ID:
if (value == null) {
unsetBlockId();
} else {
setBlockId((Long)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case BLOCK_ID:
return getBlockId();
}
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();
}
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;
}
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);
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;
}
}
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;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class 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;
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();
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);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetBlockId()) {
oprot.writeI64(struct.blockId);
}
}
@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(1);
if (incoming.get(0)) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(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 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 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 {
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 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.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(
alluxio.thrift.AlluxioTException e)
{
this();
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public accessBlock_result(accessBlock_result other) {
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.e = 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 E:
if (value == null) {
unsetE();
} else {
setE((alluxio.thrift.AlluxioTException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
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 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_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_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(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("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
}
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 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.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.isSetE()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
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(1);
if (incoming.get(0)) {
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 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
/** 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");
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;
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)));
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)
{
this();
this.sessionId = sessionId;
setSessionIdIsSet(true);
this.blockId = blockId;
setBlockIdIsSet(true);
}
/**
* 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;
}
public cacheBlock_args deepCopy() {
return new cacheBlock_args(this);
}
@Override
public void clear() {
setSessionIdIsSet(false);
this.sessionId = 0;
setBlockIdIsSet(false);
this.blockId = 0;
}
/**
* 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);
}
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;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SESSION_ID:
return getSessionId();
case BLOCK_ID:
return getBlockId();
}
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();
}
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;
}
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);
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;
}
}
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;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class 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;
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();
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);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSessionId()) {
oprot.writeI64(struct.sessionId);
}
if (struct.isSetBlockId()) {
oprot.writeI64(struct.blockId);
}
}
@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(2);
if (incoming.get(0)) {
struct.sessionId = iprot.readI64();
struct.setSessionIdIsSet(true);
}
if (incoming.get(1)) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(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 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 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 {
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 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.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(
alluxio.thrift.AlluxioTException e)
{
this();
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public cacheBlock_result(cacheBlock_result other) {
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.e = 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 E:
if (value == null) {
unsetE();
} else {
setE((alluxio.thrift.AlluxioTException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
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 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_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_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(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("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
}
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 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.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.isSetE()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
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(1);
if (incoming.get(0)) {
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 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
/** 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");
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;
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)));
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)
{
this();
this.sessionId = sessionId;
setSessionIdIsSet(true);
this.blockId = blockId;
setBlockIdIsSet(true);
}
/**
* 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;
}
public cancelBlock_args deepCopy() {
return new cancelBlock_args(this);
}
@Override
public void clear() {
setSessionIdIsSet(false);
this.sessionId = 0;
setBlockIdIsSet(false);
this.blockId = 0;
}
/**
* 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);
}
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;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SESSION_ID:
return getSessionId();
case BLOCK_ID:
return getBlockId();
}
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();
}
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;
}
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);
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;
}
}
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;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class 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;
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();
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);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSessionId()) {
oprot.writeI64(struct.sessionId);
}
if (struct.isSetBlockId()) {
oprot.writeI64(struct.blockId);
}
}
@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(2);
if (incoming.get(0)) {
struct.sessionId = iprot.readI64();
struct.setSessionIdIsSet(true);
}
if (incoming.get(1)) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(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 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 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 {
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 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.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(
alluxio.thrift.AlluxioTException e)
{
this();
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public cancelBlock_result(cancelBlock_result other) {
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.e = 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 E:
if (value == null) {
unsetE();
} else {
setE((alluxio.thrift.AlluxioTException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
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 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_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_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(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("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
}
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 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.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.isSetE()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
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(1);
if (incoming.get(0)) {
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 block 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 block options
*/
public LockBlockTOptions getOptions() {
return this.options;
}
/**
* the lock block 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 LockBlockResult 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, LockBlockResult.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(
LockBlockResult 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 LockBlockResult(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 LockBlockResult getSuccess() {
return this.success;
}
public lockBlock_result setSuccess(LockBlockResult 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((LockBlockResult)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 LockBlockResult();
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 LockBlockResult();
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 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
/** 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");
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;
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)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(promoteBlock_args.class, metaDataMap);
}
public promoteBlock_args() {
}
public promoteBlock_args(
long blockId)
{
this();
this.blockId = blockId;
setBlockIdIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public promoteBlock_args(promoteBlock_args other) {
__isset_bitfield = other.__isset_bitfield;
this.blockId = other.blockId;
}
public promoteBlock_args deepCopy() {
return new promoteBlock_args(this);
}
@Override
public void clear() {
setBlockIdIsSet(false);
this.blockId = 0;
}
/**
* 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);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case BLOCK_ID:
if (value == null) {
unsetBlockId();
} else {
setBlockId((Long)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case BLOCK_ID:
return getBlockId();
}
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();
}
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;
}
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);
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;
}
}
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;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class 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;
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();
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);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetBlockId()) {
oprot.writeI64(struct.blockId);
}
}
@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(1);
if (incoming.get(0)) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(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.BOOL, (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 boolean 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
private static final int __SUCCESS_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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
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(
boolean success,
alluxio.thrift.AlluxioTException e)
{
this();
this.success = success;
setSuccessIsSet(true);
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public promoteBlock_result(promoteBlock_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = 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() {
setSuccessIsSet(false);
this.success = false;
this.e = null;
}
public boolean isSuccess() {
return this.success;
}
public promoteBlock_result setSuccess(boolean success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
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((Boolean)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 isSuccess();
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;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != 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;
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:");
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
}
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_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.BOOL) {
struct.success = iprot.readBool();
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.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeBool(struct.success);
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()) {
oprot.writeBool(struct.success);
}
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 = iprot.readBool();
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 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
/** 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");
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;
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)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(removeBlock_args.class, metaDataMap);
}
public removeBlock_args() {
}
public removeBlock_args(
long blockId)
{
this();
this.blockId = blockId;
setBlockIdIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public removeBlock_args(removeBlock_args other) {
__isset_bitfield = other.__isset_bitfield;
this.blockId = other.blockId;
}
public removeBlock_args deepCopy() {
return new removeBlock_args(this);
}
@Override
public void clear() {
setBlockIdIsSet(false);
this.blockId = 0;
}
/**
* 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);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case BLOCK_ID:
if (value == null) {
unsetBlockId();
} else {
setBlockId((Long)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case BLOCK_ID:
return getBlockId();
}
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();
}
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;
}
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);
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;
}
}
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;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class 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;
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();
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);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetBlockId()) {
oprot.writeI64(struct.blockId);
}
}
@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(1);
if (incoming.get(0)) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(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 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 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 {
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 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.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(
alluxio.thrift.AlluxioTException e)
{
this();
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public removeBlock_result(removeBlock_result other) {
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.e = 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 E:
if (value == null) {
unsetE();
} else {
setE((alluxio.thrift.AlluxioTException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
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 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_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_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(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("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
}
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 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.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.isSetE()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
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(1);
if (incoming.get(0)) {
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 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
/** 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");
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;
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)));
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)
{
this();
this.sessionId = sessionId;
setSessionIdIsSet(true);
this.blockId = blockId;
setBlockIdIsSet(true);
this.initialBytes = initialBytes;
setInitialBytesIsSet(true);
this.writeTier = writeTier;
setWriteTierIsSet(true);
}
/**
* 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;
}
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;
}
/**
* 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);
}
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;
}
}
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();
}
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();
}
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;
}
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);
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;
}
}
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;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class 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;
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();
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);
}
oprot.writeBitSet(optionals, 4);
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);
}
}
@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(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.initialBytes = iprot.readI64();
struct.setInitialBytesIsSet(true);
}
if (incoming.get(3)) {
struct.writeTier = iprot.readI32();
struct.setWriteTierIsSet(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.STRING, (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 String 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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
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(
String 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 = 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 String getSuccess() {
return this.success;
}
public requestBlockLocation_result setSuccess(String 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((String)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
}
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.STRING) {
struct.success = iprot.readString();
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);
oprot.writeString(struct.success);
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()) {
oprot.writeString(struct.success);
}
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 = iprot.readString();
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 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
/** 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");
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;
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)));
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)
{
this();
this.sessionId = sessionId;
setSessionIdIsSet(true);
this.blockId = blockId;
setBlockIdIsSet(true);
this.requestBytes = requestBytes;
setRequestBytesIsSet(true);
}
/**
* 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;
}
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;
}
/**
* 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);
}
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;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SESSION_ID:
return getSessionId();
case BLOCK_ID:
return getBlockId();
case REQUEST_BYTES:
return getRequestBytes();
}
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();
}
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;
}
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);
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;
}
}
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;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class 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;
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();
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);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetSessionId()) {
oprot.writeI64(struct.sessionId);
}
if (struct.isSetBlockId()) {
oprot.writeI64(struct.blockId);
}
if (struct.isSetRequestBytes()) {
oprot.writeI64(struct.requestBytes);
}
}
@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(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.requestBytes = iprot.readI64();
struct.setRequestBytesIsSet(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.BOOL, (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 boolean 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
private static final int __SUCCESS_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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
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(
boolean success,
alluxio.thrift.AlluxioTException e)
{
this();
this.success = success;
setSuccessIsSet(true);
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public requestSpace_result(requestSpace_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = 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() {
setSuccessIsSet(false);
this.success = false;
this.e = null;
}
public boolean isSuccess() {
return this.success;
}
public requestSpace_result setSuccess(boolean success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
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((Boolean)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 isSuccess();
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;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != 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;
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:");
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
}
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_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.BOOL) {
struct.success = iprot.readBool();
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.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeBool(struct.success);
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()) {
oprot.writeBool(struct.success);
}
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 = iprot.readBool();
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
}
}
}
}
public static class sessionHeartbeat_args implements org.apache.thrift.TBase<sessionHeartbeat_args, sessionHeartbeat_args._Fields>, java.io.Serializable, Cloneable, Comparable<sessionHeartbeat_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sessionHeartbeat_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 Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new sessionHeartbeat_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new sessionHeartbeat_argsTupleSchemeFactory());
}
private long sessionId; // required
private List<Long> metrics; // 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");
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;
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))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sessionHeartbeat_args.class, metaDataMap);
}
public sessionHeartbeat_args() {
}
public sessionHeartbeat_args(
long sessionId,
List<Long> metrics)
{
this();
this.sessionId = sessionId;
setSessionIdIsSet(true);
this.metrics = metrics;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public sessionHeartbeat_args(sessionHeartbeat_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;
}
}
public sessionHeartbeat_args deepCopy() {
return new sessionHeartbeat_args(this);
}
@Override
public void clear() {
setSessionIdIsSet(false);
this.sessionId = 0;
this.metrics = null;
}
/**
* the id of the current session
*/
public long getSessionId() {
return this.sessionId;
}
/**
* the id of the current session
*/
public sessionHeartbeat_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 sessionHeartbeat_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;
}
}
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;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SESSION_ID:
return getSessionId();
case METRICS:
return getMetrics();
}
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();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof sessionHeartbeat_args)
return this.equals((sessionHeartbeat_args)that);
return false;
}
public boolean equals(sessionHeartbeat_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;
}
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);
return list.hashCode();
}
@Override
public int compareTo(sessionHeartbeat_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;
}
}
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("sessionHeartbeat_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;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class sessionHeartbeat_argsStandardSchemeFactory implements SchemeFactory {
public sessionHeartbeat_argsStandardScheme getScheme() {
return new sessionHeartbeat_argsStandardScheme();
}
}
private static class sessionHeartbeat_argsStandardScheme extends StandardScheme<sessionHeartbeat_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, sessionHeartbeat_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;
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, sessionHeartbeat_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();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class sessionHeartbeat_argsTupleSchemeFactory implements SchemeFactory {
public sessionHeartbeat_argsTupleScheme getScheme() {
return new sessionHeartbeat_argsTupleScheme();
}
}
private static class sessionHeartbeat_argsTupleScheme extends TupleScheme<sessionHeartbeat_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, sessionHeartbeat_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);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSessionId()) {
oprot.writeI64(struct.sessionId);
}
if (struct.isSetMetrics()) {
{
oprot.writeI32(struct.metrics.size());
for (long _iter4 : struct.metrics)
{
oprot.writeI64(_iter4);
}
}
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, sessionHeartbeat_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
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);
}
}
}
}
public static class sessionHeartbeat_result implements org.apache.thrift.TBase<sessionHeartbeat_result, sessionHeartbeat_result._Fields>, java.io.Serializable, Cloneable, Comparable<sessionHeartbeat_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sessionHeartbeat_result");
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 sessionHeartbeat_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new sessionHeartbeat_resultTupleSchemeFactory());
}
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 {
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 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.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(sessionHeartbeat_result.class, metaDataMap);
}
public sessionHeartbeat_result() {
}
public sessionHeartbeat_result(
alluxio.thrift.AlluxioTException e)
{
this();
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public sessionHeartbeat_result(sessionHeartbeat_result other) {
if (other.isSetE()) {
this.e = new alluxio.thrift.AlluxioTException(other.e);
}
}
public sessionHeartbeat_result deepCopy() {
return new sessionHeartbeat_result(this);
}
@Override
public void clear() {
this.e = null;
}
public alluxio.thrift.AlluxioTException getE() {
return this.e;
}
public sessionHeartbeat_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 E:
if (value == null) {
unsetE();
} else {
setE((alluxio.thrift.AlluxioTException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
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 E:
return isSetE();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof sessionHeartbeat_result)
return this.equals((sessionHeartbeat_result)that);
return false;
}
public boolean equals(sessionHeartbeat_result that) {
if (that == null)
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_e = true && (isSetE());
list.add(present_e);
if (present_e)
list.add(e);
return list.hashCode();
}
@Override
public int compareTo(sessionHeartbeat_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
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("sessionHeartbeat_result(");
boolean first = true;
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
}
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 sessionHeartbeat_resultStandardSchemeFactory implements SchemeFactory {
public sessionHeartbeat_resultStandardScheme getScheme() {
return new sessionHeartbeat_resultStandardScheme();
}
}
private static class sessionHeartbeat_resultStandardScheme extends StandardScheme<sessionHeartbeat_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, sessionHeartbeat_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 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, sessionHeartbeat_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.e != null) {
oprot.writeFieldBegin(E_FIELD_DESC);
struct.e.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class sessionHeartbeat_resultTupleSchemeFactory implements SchemeFactory {
public sessionHeartbeat_resultTupleScheme getScheme() {
return new sessionHeartbeat_resultTupleScheme();
}
}
private static class sessionHeartbeat_resultTupleScheme extends TupleScheme<sessionHeartbeat_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, sessionHeartbeat_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetE()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetE()) {
struct.e.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, sessionHeartbeat_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
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 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
/** 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");
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;
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)));
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)
{
this();
this.blockId = blockId;
setBlockIdIsSet(true);
this.sessionId = sessionId;
setSessionIdIsSet(true);
}
/**
* 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;
}
public unlockBlock_args deepCopy() {
return new unlockBlock_args(this);
}
@Override
public void clear() {
setBlockIdIsSet(false);
this.blockId = 0;
setSessionIdIsSet(false);
this.sessionId = 0;
}
/**
* 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);
}
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;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case BLOCK_ID:
return getBlockId();
case SESSION_ID:
return getSessionId();
}
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();
}
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;
}
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);
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;
}
}
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;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class 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;
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();
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);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetBlockId()) {
oprot.writeI64(struct.blockId);
}
if (struct.isSetSessionId()) {
oprot.writeI64(struct.sessionId);
}
}
@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(2);
if (incoming.get(0)) {
struct.blockId = iprot.readI64();
struct.setBlockIdIsSet(true);
}
if (incoming.get(1)) {
struct.sessionId = iprot.readI64();
struct.setSessionIdIsSet(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.BOOL, (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 boolean 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
private static final int __SUCCESS_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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
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(
boolean success,
alluxio.thrift.AlluxioTException e)
{
this();
this.success = success;
setSuccessIsSet(true);
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public unlockBlock_result(unlockBlock_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = 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() {
setSuccessIsSet(false);
this.success = false;
this.e = null;
}
public boolean isSuccess() {
return this.success;
}
public unlockBlock_result setSuccess(boolean success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
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((Boolean)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 isSuccess();
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;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != 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;
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:");
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
}
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_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.BOOL) {
struct.success = iprot.readBool();
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.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeBool(struct.success);
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()) {
oprot.writeBool(struct.success);
}
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 = iprot.readBool();
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
}
}
}
}
}