/**
* 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 FileSystemWorkerClientService {
/**
* This interface contains file system worker service endpoints for Alluxio clients.
*/
public interface Iface extends alluxio.thrift.AlluxioService.Iface {
/**
* Cancels a file which has not been completed in the under file system.
*
* @param sessionId the id of the current session
*
* @param tempUfsFileId the worker specific file id of the ufs file
*
* @param options the options for canceling the file
*/
public void cancelUfsFile(long sessionId, long tempUfsFileId, CancelUfsFileTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Closes a file in the under file system which was previously opened for reading.
*
*
* @param sessionId the id of the current session
*
* @param tempUfsFileId the worker specific file id of the ufs file
*
* @param options the options for closing the file
*/
public void closeUfsFile(long sessionId, long tempUfsFileId, CloseUfsFileTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Completes a file in the under file system.
*
* @param sessionId the id of the current session
*
* @param tempUfsFileId the worker specific file id of the ufs file
*
* @param options the options for completing the file
*/
public long completeUfsFile(long sessionId, long tempUfsFileId, CompleteUfsFileTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Creates a file in the under file system.
*
* @param sessionId the id of the current session
*
* @param ufsPath the path of the file in the ufs
*
* @param options the options for creating the file
*/
public long createUfsFile(long sessionId, String ufsPath, CreateUfsFileTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Opens an existing file in the under file system for reading.
*
* @param sessionId the id of the current session
*
* @param ufsPath the path of the file in the ufs
*
* @param options the options for opening the file
*/
public long openUfsFile(long sessionId, String ufsPath, OpenUfsFileTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Local session send heartbeat to local worker to keep its state.
*
* @param sessionId the id of the current session
*
* @param metrics the client 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;
}
public interface AsyncIface extends alluxio.thrift.AlluxioService .AsyncIface {
public void cancelUfsFile(long sessionId, long tempUfsFileId, CancelUfsFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void closeUfsFile(long sessionId, long tempUfsFileId, CloseUfsFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void completeUfsFile(long sessionId, long tempUfsFileId, CompleteUfsFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void createUfsFile(long sessionId, String ufsPath, CreateUfsFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void openUfsFile(long sessionId, String ufsPath, OpenUfsFileTOptions options, 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 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 cancelUfsFile(long sessionId, long tempUfsFileId, CancelUfsFileTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_cancelUfsFile(sessionId, tempUfsFileId, options);
recv_cancelUfsFile();
}
public void send_cancelUfsFile(long sessionId, long tempUfsFileId, CancelUfsFileTOptions options) throws org.apache.thrift.TException
{
cancelUfsFile_args args = new cancelUfsFile_args();
args.setSessionId(sessionId);
args.setTempUfsFileId(tempUfsFileId);
args.setOptions(options);
sendBase("cancelUfsFile", args);
}
public void recv_cancelUfsFile() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
cancelUfsFile_result result = new cancelUfsFile_result();
receiveBase(result, "cancelUfsFile");
if (result.e != null) {
throw result.e;
}
return;
}
public void closeUfsFile(long sessionId, long tempUfsFileId, CloseUfsFileTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_closeUfsFile(sessionId, tempUfsFileId, options);
recv_closeUfsFile();
}
public void send_closeUfsFile(long sessionId, long tempUfsFileId, CloseUfsFileTOptions options) throws org.apache.thrift.TException
{
closeUfsFile_args args = new closeUfsFile_args();
args.setSessionId(sessionId);
args.setTempUfsFileId(tempUfsFileId);
args.setOptions(options);
sendBase("closeUfsFile", args);
}
public void recv_closeUfsFile() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
closeUfsFile_result result = new closeUfsFile_result();
receiveBase(result, "closeUfsFile");
if (result.e != null) {
throw result.e;
}
return;
}
public long completeUfsFile(long sessionId, long tempUfsFileId, CompleteUfsFileTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_completeUfsFile(sessionId, tempUfsFileId, options);
return recv_completeUfsFile();
}
public void send_completeUfsFile(long sessionId, long tempUfsFileId, CompleteUfsFileTOptions options) throws org.apache.thrift.TException
{
completeUfsFile_args args = new completeUfsFile_args();
args.setSessionId(sessionId);
args.setTempUfsFileId(tempUfsFileId);
args.setOptions(options);
sendBase("completeUfsFile", args);
}
public long recv_completeUfsFile() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
completeUfsFile_result result = new completeUfsFile_result();
receiveBase(result, "completeUfsFile");
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, "completeUfsFile failed: unknown result");
}
public long createUfsFile(long sessionId, String ufsPath, CreateUfsFileTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_createUfsFile(sessionId, ufsPath, options);
return recv_createUfsFile();
}
public void send_createUfsFile(long sessionId, String ufsPath, CreateUfsFileTOptions options) throws org.apache.thrift.TException
{
createUfsFile_args args = new createUfsFile_args();
args.setSessionId(sessionId);
args.setUfsPath(ufsPath);
args.setOptions(options);
sendBase("createUfsFile", args);
}
public long recv_createUfsFile() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
createUfsFile_result result = new createUfsFile_result();
receiveBase(result, "createUfsFile");
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, "createUfsFile failed: unknown result");
}
public long openUfsFile(long sessionId, String ufsPath, OpenUfsFileTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_openUfsFile(sessionId, ufsPath, options);
return recv_openUfsFile();
}
public void send_openUfsFile(long sessionId, String ufsPath, OpenUfsFileTOptions options) throws org.apache.thrift.TException
{
openUfsFile_args args = new openUfsFile_args();
args.setSessionId(sessionId);
args.setUfsPath(ufsPath);
args.setOptions(options);
sendBase("openUfsFile", args);
}
public long recv_openUfsFile() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
openUfsFile_result result = new openUfsFile_result();
receiveBase(result, "openUfsFile");
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, "openUfsFile 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 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 cancelUfsFile(long sessionId, long tempUfsFileId, CancelUfsFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
cancelUfsFile_call method_call = new cancelUfsFile_call(sessionId, tempUfsFileId, options, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class cancelUfsFile_call extends org.apache.thrift.async.TAsyncMethodCall {
private long sessionId;
private long tempUfsFileId;
private CancelUfsFileTOptions options;
public cancelUfsFile_call(long sessionId, long tempUfsFileId, CancelUfsFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.sessionId = sessionId;
this.tempUfsFileId = tempUfsFileId;
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("cancelUfsFile", org.apache.thrift.protocol.TMessageType.CALL, 0));
cancelUfsFile_args args = new cancelUfsFile_args();
args.setSessionId(sessionId);
args.setTempUfsFileId(tempUfsFileId);
args.setOptions(options);
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_cancelUfsFile();
}
}
public void closeUfsFile(long sessionId, long tempUfsFileId, CloseUfsFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
closeUfsFile_call method_call = new closeUfsFile_call(sessionId, tempUfsFileId, options, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class closeUfsFile_call extends org.apache.thrift.async.TAsyncMethodCall {
private long sessionId;
private long tempUfsFileId;
private CloseUfsFileTOptions options;
public closeUfsFile_call(long sessionId, long tempUfsFileId, CloseUfsFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.sessionId = sessionId;
this.tempUfsFileId = tempUfsFileId;
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("closeUfsFile", org.apache.thrift.protocol.TMessageType.CALL, 0));
closeUfsFile_args args = new closeUfsFile_args();
args.setSessionId(sessionId);
args.setTempUfsFileId(tempUfsFileId);
args.setOptions(options);
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_closeUfsFile();
}
}
public void completeUfsFile(long sessionId, long tempUfsFileId, CompleteUfsFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
completeUfsFile_call method_call = new completeUfsFile_call(sessionId, tempUfsFileId, options, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class completeUfsFile_call extends org.apache.thrift.async.TAsyncMethodCall {
private long sessionId;
private long tempUfsFileId;
private CompleteUfsFileTOptions options;
public completeUfsFile_call(long sessionId, long tempUfsFileId, CompleteUfsFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.sessionId = sessionId;
this.tempUfsFileId = tempUfsFileId;
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("completeUfsFile", org.apache.thrift.protocol.TMessageType.CALL, 0));
completeUfsFile_args args = new completeUfsFile_args();
args.setSessionId(sessionId);
args.setTempUfsFileId(tempUfsFileId);
args.setOptions(options);
args.write(prot);
prot.writeMessageEnd();
}
public long 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_completeUfsFile();
}
}
public void createUfsFile(long sessionId, String ufsPath, CreateUfsFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
createUfsFile_call method_call = new createUfsFile_call(sessionId, ufsPath, options, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class createUfsFile_call extends org.apache.thrift.async.TAsyncMethodCall {
private long sessionId;
private String ufsPath;
private CreateUfsFileTOptions options;
public createUfsFile_call(long sessionId, String ufsPath, CreateUfsFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.sessionId = sessionId;
this.ufsPath = ufsPath;
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("createUfsFile", org.apache.thrift.protocol.TMessageType.CALL, 0));
createUfsFile_args args = new createUfsFile_args();
args.setSessionId(sessionId);
args.setUfsPath(ufsPath);
args.setOptions(options);
args.write(prot);
prot.writeMessageEnd();
}
public long 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_createUfsFile();
}
}
public void openUfsFile(long sessionId, String ufsPath, OpenUfsFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
openUfsFile_call method_call = new openUfsFile_call(sessionId, ufsPath, options, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class openUfsFile_call extends org.apache.thrift.async.TAsyncMethodCall {
private long sessionId;
private String ufsPath;
private OpenUfsFileTOptions options;
public openUfsFile_call(long sessionId, String ufsPath, OpenUfsFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.sessionId = sessionId;
this.ufsPath = ufsPath;
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("openUfsFile", org.apache.thrift.protocol.TMessageType.CALL, 0));
openUfsFile_args args = new openUfsFile_args();
args.setSessionId(sessionId);
args.setUfsPath(ufsPath);
args.setOptions(options);
args.write(prot);
prot.writeMessageEnd();
}
public long 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_openUfsFile();
}
}
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 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("cancelUfsFile", new cancelUfsFile());
processMap.put("closeUfsFile", new closeUfsFile());
processMap.put("completeUfsFile", new completeUfsFile());
processMap.put("createUfsFile", new createUfsFile());
processMap.put("openUfsFile", new openUfsFile());
processMap.put("sessionHeartbeat", new sessionHeartbeat());
return processMap;
}
public static class cancelUfsFile<I extends Iface> extends org.apache.thrift.ProcessFunction<I, cancelUfsFile_args> {
public cancelUfsFile() {
super("cancelUfsFile");
}
public cancelUfsFile_args getEmptyArgsInstance() {
return new cancelUfsFile_args();
}
protected boolean isOneway() {
return false;
}
public cancelUfsFile_result getResult(I iface, cancelUfsFile_args args) throws org.apache.thrift.TException {
cancelUfsFile_result result = new cancelUfsFile_result();
try {
iface.cancelUfsFile(args.sessionId, args.tempUfsFileId, args.options);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class closeUfsFile<I extends Iface> extends org.apache.thrift.ProcessFunction<I, closeUfsFile_args> {
public closeUfsFile() {
super("closeUfsFile");
}
public closeUfsFile_args getEmptyArgsInstance() {
return new closeUfsFile_args();
}
protected boolean isOneway() {
return false;
}
public closeUfsFile_result getResult(I iface, closeUfsFile_args args) throws org.apache.thrift.TException {
closeUfsFile_result result = new closeUfsFile_result();
try {
iface.closeUfsFile(args.sessionId, args.tempUfsFileId, args.options);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class completeUfsFile<I extends Iface> extends org.apache.thrift.ProcessFunction<I, completeUfsFile_args> {
public completeUfsFile() {
super("completeUfsFile");
}
public completeUfsFile_args getEmptyArgsInstance() {
return new completeUfsFile_args();
}
protected boolean isOneway() {
return false;
}
public completeUfsFile_result getResult(I iface, completeUfsFile_args args) throws org.apache.thrift.TException {
completeUfsFile_result result = new completeUfsFile_result();
try {
result.success = iface.completeUfsFile(args.sessionId, args.tempUfsFileId, args.options);
result.setSuccessIsSet(true);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class createUfsFile<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createUfsFile_args> {
public createUfsFile() {
super("createUfsFile");
}
public createUfsFile_args getEmptyArgsInstance() {
return new createUfsFile_args();
}
protected boolean isOneway() {
return false;
}
public createUfsFile_result getResult(I iface, createUfsFile_args args) throws org.apache.thrift.TException {
createUfsFile_result result = new createUfsFile_result();
try {
result.success = iface.createUfsFile(args.sessionId, args.ufsPath, args.options);
result.setSuccessIsSet(true);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class openUfsFile<I extends Iface> extends org.apache.thrift.ProcessFunction<I, openUfsFile_args> {
public openUfsFile() {
super("openUfsFile");
}
public openUfsFile_args getEmptyArgsInstance() {
return new openUfsFile_args();
}
protected boolean isOneway() {
return false;
}
public openUfsFile_result getResult(I iface, openUfsFile_args args) throws org.apache.thrift.TException {
openUfsFile_result result = new openUfsFile_result();
try {
result.success = iface.openUfsFile(args.sessionId, args.ufsPath, args.options);
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 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("cancelUfsFile", new cancelUfsFile());
processMap.put("closeUfsFile", new closeUfsFile());
processMap.put("completeUfsFile", new completeUfsFile());
processMap.put("createUfsFile", new createUfsFile());
processMap.put("openUfsFile", new openUfsFile());
processMap.put("sessionHeartbeat", new sessionHeartbeat());
return processMap;
}
public static class cancelUfsFile<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, cancelUfsFile_args, Void> {
public cancelUfsFile() {
super("cancelUfsFile");
}
public cancelUfsFile_args getEmptyArgsInstance() {
return new cancelUfsFile_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) {
cancelUfsFile_result result = new cancelUfsFile_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;
cancelUfsFile_result result = new cancelUfsFile_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, cancelUfsFile_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
iface.cancelUfsFile(args.sessionId, args.tempUfsFileId, args.options,resultHandler);
}
}
public static class closeUfsFile<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, closeUfsFile_args, Void> {
public closeUfsFile() {
super("closeUfsFile");
}
public closeUfsFile_args getEmptyArgsInstance() {
return new closeUfsFile_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) {
closeUfsFile_result result = new closeUfsFile_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;
closeUfsFile_result result = new closeUfsFile_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, closeUfsFile_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
iface.closeUfsFile(args.sessionId, args.tempUfsFileId, args.options,resultHandler);
}
}
public static class completeUfsFile<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, completeUfsFile_args, Long> {
public completeUfsFile() {
super("completeUfsFile");
}
public completeUfsFile_args getEmptyArgsInstance() {
return new completeUfsFile_args();
}
public AsyncMethodCallback<Long> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<Long>() {
public void onComplete(Long o) {
completeUfsFile_result result = new completeUfsFile_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;
completeUfsFile_result result = new completeUfsFile_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, completeUfsFile_args args, org.apache.thrift.async.AsyncMethodCallback<Long> resultHandler) throws TException {
iface.completeUfsFile(args.sessionId, args.tempUfsFileId, args.options,resultHandler);
}
}
public static class createUfsFile<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, createUfsFile_args, Long> {
public createUfsFile() {
super("createUfsFile");
}
public createUfsFile_args getEmptyArgsInstance() {
return new createUfsFile_args();
}
public AsyncMethodCallback<Long> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<Long>() {
public void onComplete(Long o) {
createUfsFile_result result = new createUfsFile_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;
createUfsFile_result result = new createUfsFile_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, createUfsFile_args args, org.apache.thrift.async.AsyncMethodCallback<Long> resultHandler) throws TException {
iface.createUfsFile(args.sessionId, args.ufsPath, args.options,resultHandler);
}
}
public static class openUfsFile<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, openUfsFile_args, Long> {
public openUfsFile() {
super("openUfsFile");
}
public openUfsFile_args getEmptyArgsInstance() {
return new openUfsFile_args();
}
public AsyncMethodCallback<Long> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<Long>() {
public void onComplete(Long o) {
openUfsFile_result result = new openUfsFile_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;
openUfsFile_result result = new openUfsFile_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, openUfsFile_args args, org.apache.thrift.async.AsyncMethodCallback<Long> resultHandler) throws TException {
iface.openUfsFile(args.sessionId, args.ufsPath, args.options,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 cancelUfsFile_args implements org.apache.thrift.TBase<cancelUfsFile_args, cancelUfsFile_args._Fields>, java.io.Serializable, Cloneable, Comparable<cancelUfsFile_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("cancelUfsFile_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 TEMP_UFS_FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("tempUfsFileId", 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 cancelUfsFile_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new cancelUfsFile_argsTupleSchemeFactory());
}
private long sessionId; // required
private long tempUfsFileId; // required
private CancelUfsFileTOptions options; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
/**
* the id of the current session
*/
SESSION_ID((short)1, "sessionId"),
/**
* the worker specific file id of the ufs file
*/
TEMP_UFS_FILE_ID((short)2, "tempUfsFileId"),
/**
* the options for canceling the file
*/
OPTIONS((short)3, "options");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // SESSION_ID
return SESSION_ID;
case 2: // TEMP_UFS_FILE_ID
return TEMP_UFS_FILE_ID;
case 3: // OPTIONS
return OPTIONS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __SESSIONID_ISSET_ID = 0;
private static final int __TEMPUFSFILEID_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.TEMP_UFS_FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("tempUfsFileId", 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, CancelUfsFileTOptions.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(cancelUfsFile_args.class, metaDataMap);
}
public cancelUfsFile_args() {
}
public cancelUfsFile_args(
long sessionId,
long tempUfsFileId,
CancelUfsFileTOptions options)
{
this();
this.sessionId = sessionId;
setSessionIdIsSet(true);
this.tempUfsFileId = tempUfsFileId;
setTempUfsFileIdIsSet(true);
this.options = options;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public cancelUfsFile_args(cancelUfsFile_args other) {
__isset_bitfield = other.__isset_bitfield;
this.sessionId = other.sessionId;
this.tempUfsFileId = other.tempUfsFileId;
if (other.isSetOptions()) {
this.options = new CancelUfsFileTOptions(other.options);
}
}
public cancelUfsFile_args deepCopy() {
return new cancelUfsFile_args(this);
}
@Override
public void clear() {
setSessionIdIsSet(false);
this.sessionId = 0;
setTempUfsFileIdIsSet(false);
this.tempUfsFileId = 0;
this.options = null;
}
/**
* the id of the current session
*/
public long getSessionId() {
return this.sessionId;
}
/**
* the id of the current session
*/
public cancelUfsFile_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 worker specific file id of the ufs file
*/
public long getTempUfsFileId() {
return this.tempUfsFileId;
}
/**
* the worker specific file id of the ufs file
*/
public cancelUfsFile_args setTempUfsFileId(long tempUfsFileId) {
this.tempUfsFileId = tempUfsFileId;
setTempUfsFileIdIsSet(true);
return this;
}
public void unsetTempUfsFileId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TEMPUFSFILEID_ISSET_ID);
}
/** Returns true if field tempUfsFileId is set (has been assigned a value) and false otherwise */
public boolean isSetTempUfsFileId() {
return EncodingUtils.testBit(__isset_bitfield, __TEMPUFSFILEID_ISSET_ID);
}
public void setTempUfsFileIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TEMPUFSFILEID_ISSET_ID, value);
}
/**
* the options for canceling the file
*/
public CancelUfsFileTOptions getOptions() {
return this.options;
}
/**
* the options for canceling the file
*/
public cancelUfsFile_args setOptions(CancelUfsFileTOptions options) {
this.options = options;
return this;
}
public void unsetOptions() {
this.options = null;
}
/** Returns true if field options is set (has been assigned a value) and false otherwise */
public boolean isSetOptions() {
return this.options != null;
}
public void setOptionsIsSet(boolean value) {
if (!value) {
this.options = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SESSION_ID:
if (value == null) {
unsetSessionId();
} else {
setSessionId((Long)value);
}
break;
case TEMP_UFS_FILE_ID:
if (value == null) {
unsetTempUfsFileId();
} else {
setTempUfsFileId((Long)value);
}
break;
case OPTIONS:
if (value == null) {
unsetOptions();
} else {
setOptions((CancelUfsFileTOptions)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SESSION_ID:
return getSessionId();
case TEMP_UFS_FILE_ID:
return getTempUfsFileId();
case OPTIONS:
return getOptions();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SESSION_ID:
return isSetSessionId();
case TEMP_UFS_FILE_ID:
return isSetTempUfsFileId();
case OPTIONS:
return isSetOptions();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof cancelUfsFile_args)
return this.equals((cancelUfsFile_args)that);
return false;
}
public boolean equals(cancelUfsFile_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_tempUfsFileId = true;
boolean that_present_tempUfsFileId = true;
if (this_present_tempUfsFileId || that_present_tempUfsFileId) {
if (!(this_present_tempUfsFileId && that_present_tempUfsFileId))
return false;
if (this.tempUfsFileId != that.tempUfsFileId)
return false;
}
boolean this_present_options = true && this.isSetOptions();
boolean that_present_options = true && that.isSetOptions();
if (this_present_options || that_present_options) {
if (!(this_present_options && that_present_options))
return false;
if (!this.options.equals(that.options))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_sessionId = true;
list.add(present_sessionId);
if (present_sessionId)
list.add(sessionId);
boolean present_tempUfsFileId = true;
list.add(present_tempUfsFileId);
if (present_tempUfsFileId)
list.add(tempUfsFileId);
boolean present_options = true && (isSetOptions());
list.add(present_options);
if (present_options)
list.add(options);
return list.hashCode();
}
@Override
public int compareTo(cancelUfsFile_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(isSetTempUfsFileId()).compareTo(other.isSetTempUfsFileId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTempUfsFileId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tempUfsFileId, other.tempUfsFileId);
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("cancelUfsFile_args(");
boolean first = true;
sb.append("sessionId:");
sb.append(this.sessionId);
first = false;
if (!first) sb.append(", ");
sb.append("tempUfsFileId:");
sb.append(this.tempUfsFileId);
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 cancelUfsFile_argsStandardSchemeFactory implements SchemeFactory {
public cancelUfsFile_argsStandardScheme getScheme() {
return new cancelUfsFile_argsStandardScheme();
}
}
private static class cancelUfsFile_argsStandardScheme extends StandardScheme<cancelUfsFile_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, cancelUfsFile_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: // TEMP_UFS_FILE_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.tempUfsFileId = iprot.readI64();
struct.setTempUfsFileIdIsSet(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 CancelUfsFileTOptions();
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, cancelUfsFile_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(TEMP_UFS_FILE_ID_FIELD_DESC);
oprot.writeI64(struct.tempUfsFileId);
oprot.writeFieldEnd();
if (struct.options != null) {
oprot.writeFieldBegin(OPTIONS_FIELD_DESC);
struct.options.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class cancelUfsFile_argsTupleSchemeFactory implements SchemeFactory {
public cancelUfsFile_argsTupleScheme getScheme() {
return new cancelUfsFile_argsTupleScheme();
}
}
private static class cancelUfsFile_argsTupleScheme extends TupleScheme<cancelUfsFile_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, cancelUfsFile_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSessionId()) {
optionals.set(0);
}
if (struct.isSetTempUfsFileId()) {
optionals.set(1);
}
if (struct.isSetOptions()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetSessionId()) {
oprot.writeI64(struct.sessionId);
}
if (struct.isSetTempUfsFileId()) {
oprot.writeI64(struct.tempUfsFileId);
}
if (struct.isSetOptions()) {
struct.options.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, cancelUfsFile_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.tempUfsFileId = iprot.readI64();
struct.setTempUfsFileIdIsSet(true);
}
if (incoming.get(2)) {
struct.options = new CancelUfsFileTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
}
}
}
}
public static class cancelUfsFile_result implements org.apache.thrift.TBase<cancelUfsFile_result, cancelUfsFile_result._Fields>, java.io.Serializable, Cloneable, Comparable<cancelUfsFile_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("cancelUfsFile_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 cancelUfsFile_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new cancelUfsFile_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(cancelUfsFile_result.class, metaDataMap);
}
public cancelUfsFile_result() {
}
public cancelUfsFile_result(
alluxio.thrift.AlluxioTException e)
{
this();
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public cancelUfsFile_result(cancelUfsFile_result other) {
if (other.isSetE()) {
this.e = new alluxio.thrift.AlluxioTException(other.e);
}
}
public cancelUfsFile_result deepCopy() {
return new cancelUfsFile_result(this);
}
@Override
public void clear() {
this.e = null;
}
public alluxio.thrift.AlluxioTException getE() {
return this.e;
}
public cancelUfsFile_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 cancelUfsFile_result)
return this.equals((cancelUfsFile_result)that);
return false;
}
public boolean equals(cancelUfsFile_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(cancelUfsFile_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("cancelUfsFile_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 cancelUfsFile_resultStandardSchemeFactory implements SchemeFactory {
public cancelUfsFile_resultStandardScheme getScheme() {
return new cancelUfsFile_resultStandardScheme();
}
}
private static class cancelUfsFile_resultStandardScheme extends StandardScheme<cancelUfsFile_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, cancelUfsFile_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, cancelUfsFile_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 cancelUfsFile_resultTupleSchemeFactory implements SchemeFactory {
public cancelUfsFile_resultTupleScheme getScheme() {
return new cancelUfsFile_resultTupleScheme();
}
}
private static class cancelUfsFile_resultTupleScheme extends TupleScheme<cancelUfsFile_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, cancelUfsFile_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, cancelUfsFile_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 closeUfsFile_args implements org.apache.thrift.TBase<closeUfsFile_args, closeUfsFile_args._Fields>, java.io.Serializable, Cloneable, Comparable<closeUfsFile_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeUfsFile_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 TEMP_UFS_FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("tempUfsFileId", 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 closeUfsFile_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new closeUfsFile_argsTupleSchemeFactory());
}
private long sessionId; // required
private long tempUfsFileId; // required
private CloseUfsFileTOptions options; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
/**
* the id of the current session
*/
SESSION_ID((short)1, "sessionId"),
/**
* the worker specific file id of the ufs file
*/
TEMP_UFS_FILE_ID((short)2, "tempUfsFileId"),
/**
* the options for closing the file
*/
OPTIONS((short)3, "options");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // SESSION_ID
return SESSION_ID;
case 2: // TEMP_UFS_FILE_ID
return TEMP_UFS_FILE_ID;
case 3: // OPTIONS
return OPTIONS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __SESSIONID_ISSET_ID = 0;
private static final int __TEMPUFSFILEID_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.TEMP_UFS_FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("tempUfsFileId", 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, CloseUfsFileTOptions.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeUfsFile_args.class, metaDataMap);
}
public closeUfsFile_args() {
}
public closeUfsFile_args(
long sessionId,
long tempUfsFileId,
CloseUfsFileTOptions options)
{
this();
this.sessionId = sessionId;
setSessionIdIsSet(true);
this.tempUfsFileId = tempUfsFileId;
setTempUfsFileIdIsSet(true);
this.options = options;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public closeUfsFile_args(closeUfsFile_args other) {
__isset_bitfield = other.__isset_bitfield;
this.sessionId = other.sessionId;
this.tempUfsFileId = other.tempUfsFileId;
if (other.isSetOptions()) {
this.options = new CloseUfsFileTOptions(other.options);
}
}
public closeUfsFile_args deepCopy() {
return new closeUfsFile_args(this);
}
@Override
public void clear() {
setSessionIdIsSet(false);
this.sessionId = 0;
setTempUfsFileIdIsSet(false);
this.tempUfsFileId = 0;
this.options = null;
}
/**
* the id of the current session
*/
public long getSessionId() {
return this.sessionId;
}
/**
* the id of the current session
*/
public closeUfsFile_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 worker specific file id of the ufs file
*/
public long getTempUfsFileId() {
return this.tempUfsFileId;
}
/**
* the worker specific file id of the ufs file
*/
public closeUfsFile_args setTempUfsFileId(long tempUfsFileId) {
this.tempUfsFileId = tempUfsFileId;
setTempUfsFileIdIsSet(true);
return this;
}
public void unsetTempUfsFileId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TEMPUFSFILEID_ISSET_ID);
}
/** Returns true if field tempUfsFileId is set (has been assigned a value) and false otherwise */
public boolean isSetTempUfsFileId() {
return EncodingUtils.testBit(__isset_bitfield, __TEMPUFSFILEID_ISSET_ID);
}
public void setTempUfsFileIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TEMPUFSFILEID_ISSET_ID, value);
}
/**
* the options for closing the file
*/
public CloseUfsFileTOptions getOptions() {
return this.options;
}
/**
* the options for closing the file
*/
public closeUfsFile_args setOptions(CloseUfsFileTOptions options) {
this.options = options;
return this;
}
public void unsetOptions() {
this.options = null;
}
/** Returns true if field options is set (has been assigned a value) and false otherwise */
public boolean isSetOptions() {
return this.options != null;
}
public void setOptionsIsSet(boolean value) {
if (!value) {
this.options = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SESSION_ID:
if (value == null) {
unsetSessionId();
} else {
setSessionId((Long)value);
}
break;
case TEMP_UFS_FILE_ID:
if (value == null) {
unsetTempUfsFileId();
} else {
setTempUfsFileId((Long)value);
}
break;
case OPTIONS:
if (value == null) {
unsetOptions();
} else {
setOptions((CloseUfsFileTOptions)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SESSION_ID:
return getSessionId();
case TEMP_UFS_FILE_ID:
return getTempUfsFileId();
case OPTIONS:
return getOptions();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SESSION_ID:
return isSetSessionId();
case TEMP_UFS_FILE_ID:
return isSetTempUfsFileId();
case OPTIONS:
return isSetOptions();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof closeUfsFile_args)
return this.equals((closeUfsFile_args)that);
return false;
}
public boolean equals(closeUfsFile_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_tempUfsFileId = true;
boolean that_present_tempUfsFileId = true;
if (this_present_tempUfsFileId || that_present_tempUfsFileId) {
if (!(this_present_tempUfsFileId && that_present_tempUfsFileId))
return false;
if (this.tempUfsFileId != that.tempUfsFileId)
return false;
}
boolean this_present_options = true && this.isSetOptions();
boolean that_present_options = true && that.isSetOptions();
if (this_present_options || that_present_options) {
if (!(this_present_options && that_present_options))
return false;
if (!this.options.equals(that.options))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_sessionId = true;
list.add(present_sessionId);
if (present_sessionId)
list.add(sessionId);
boolean present_tempUfsFileId = true;
list.add(present_tempUfsFileId);
if (present_tempUfsFileId)
list.add(tempUfsFileId);
boolean present_options = true && (isSetOptions());
list.add(present_options);
if (present_options)
list.add(options);
return list.hashCode();
}
@Override
public int compareTo(closeUfsFile_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(isSetTempUfsFileId()).compareTo(other.isSetTempUfsFileId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTempUfsFileId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tempUfsFileId, other.tempUfsFileId);
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("closeUfsFile_args(");
boolean first = true;
sb.append("sessionId:");
sb.append(this.sessionId);
first = false;
if (!first) sb.append(", ");
sb.append("tempUfsFileId:");
sb.append(this.tempUfsFileId);
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 closeUfsFile_argsStandardSchemeFactory implements SchemeFactory {
public closeUfsFile_argsStandardScheme getScheme() {
return new closeUfsFile_argsStandardScheme();
}
}
private static class closeUfsFile_argsStandardScheme extends StandardScheme<closeUfsFile_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, closeUfsFile_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: // TEMP_UFS_FILE_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.tempUfsFileId = iprot.readI64();
struct.setTempUfsFileIdIsSet(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 CloseUfsFileTOptions();
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, closeUfsFile_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(TEMP_UFS_FILE_ID_FIELD_DESC);
oprot.writeI64(struct.tempUfsFileId);
oprot.writeFieldEnd();
if (struct.options != null) {
oprot.writeFieldBegin(OPTIONS_FIELD_DESC);
struct.options.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class closeUfsFile_argsTupleSchemeFactory implements SchemeFactory {
public closeUfsFile_argsTupleScheme getScheme() {
return new closeUfsFile_argsTupleScheme();
}
}
private static class closeUfsFile_argsTupleScheme extends TupleScheme<closeUfsFile_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, closeUfsFile_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSessionId()) {
optionals.set(0);
}
if (struct.isSetTempUfsFileId()) {
optionals.set(1);
}
if (struct.isSetOptions()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetSessionId()) {
oprot.writeI64(struct.sessionId);
}
if (struct.isSetTempUfsFileId()) {
oprot.writeI64(struct.tempUfsFileId);
}
if (struct.isSetOptions()) {
struct.options.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, closeUfsFile_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.tempUfsFileId = iprot.readI64();
struct.setTempUfsFileIdIsSet(true);
}
if (incoming.get(2)) {
struct.options = new CloseUfsFileTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
}
}
}
}
public static class closeUfsFile_result implements org.apache.thrift.TBase<closeUfsFile_result, closeUfsFile_result._Fields>, java.io.Serializable, Cloneable, Comparable<closeUfsFile_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeUfsFile_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 closeUfsFile_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new closeUfsFile_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(closeUfsFile_result.class, metaDataMap);
}
public closeUfsFile_result() {
}
public closeUfsFile_result(
alluxio.thrift.AlluxioTException e)
{
this();
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public closeUfsFile_result(closeUfsFile_result other) {
if (other.isSetE()) {
this.e = new alluxio.thrift.AlluxioTException(other.e);
}
}
public closeUfsFile_result deepCopy() {
return new closeUfsFile_result(this);
}
@Override
public void clear() {
this.e = null;
}
public alluxio.thrift.AlluxioTException getE() {
return this.e;
}
public closeUfsFile_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 closeUfsFile_result)
return this.equals((closeUfsFile_result)that);
return false;
}
public boolean equals(closeUfsFile_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(closeUfsFile_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("closeUfsFile_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 closeUfsFile_resultStandardSchemeFactory implements SchemeFactory {
public closeUfsFile_resultStandardScheme getScheme() {
return new closeUfsFile_resultStandardScheme();
}
}
private static class closeUfsFile_resultStandardScheme extends StandardScheme<closeUfsFile_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, closeUfsFile_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, closeUfsFile_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 closeUfsFile_resultTupleSchemeFactory implements SchemeFactory {
public closeUfsFile_resultTupleScheme getScheme() {
return new closeUfsFile_resultTupleScheme();
}
}
private static class closeUfsFile_resultTupleScheme extends TupleScheme<closeUfsFile_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, closeUfsFile_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, closeUfsFile_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 completeUfsFile_args implements org.apache.thrift.TBase<completeUfsFile_args, completeUfsFile_args._Fields>, java.io.Serializable, Cloneable, Comparable<completeUfsFile_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("completeUfsFile_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 TEMP_UFS_FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("tempUfsFileId", 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 completeUfsFile_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new completeUfsFile_argsTupleSchemeFactory());
}
private long sessionId; // required
private long tempUfsFileId; // required
private CompleteUfsFileTOptions options; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
/**
* the id of the current session
*/
SESSION_ID((short)1, "sessionId"),
/**
* the worker specific file id of the ufs file
*/
TEMP_UFS_FILE_ID((short)2, "tempUfsFileId"),
/**
* the options for completing the file
*/
OPTIONS((short)3, "options");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // SESSION_ID
return SESSION_ID;
case 2: // TEMP_UFS_FILE_ID
return TEMP_UFS_FILE_ID;
case 3: // OPTIONS
return OPTIONS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __SESSIONID_ISSET_ID = 0;
private static final int __TEMPUFSFILEID_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.TEMP_UFS_FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("tempUfsFileId", 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, CompleteUfsFileTOptions.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(completeUfsFile_args.class, metaDataMap);
}
public completeUfsFile_args() {
}
public completeUfsFile_args(
long sessionId,
long tempUfsFileId,
CompleteUfsFileTOptions options)
{
this();
this.sessionId = sessionId;
setSessionIdIsSet(true);
this.tempUfsFileId = tempUfsFileId;
setTempUfsFileIdIsSet(true);
this.options = options;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public completeUfsFile_args(completeUfsFile_args other) {
__isset_bitfield = other.__isset_bitfield;
this.sessionId = other.sessionId;
this.tempUfsFileId = other.tempUfsFileId;
if (other.isSetOptions()) {
this.options = new CompleteUfsFileTOptions(other.options);
}
}
public completeUfsFile_args deepCopy() {
return new completeUfsFile_args(this);
}
@Override
public void clear() {
setSessionIdIsSet(false);
this.sessionId = 0;
setTempUfsFileIdIsSet(false);
this.tempUfsFileId = 0;
this.options = null;
}
/**
* the id of the current session
*/
public long getSessionId() {
return this.sessionId;
}
/**
* the id of the current session
*/
public completeUfsFile_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 worker specific file id of the ufs file
*/
public long getTempUfsFileId() {
return this.tempUfsFileId;
}
/**
* the worker specific file id of the ufs file
*/
public completeUfsFile_args setTempUfsFileId(long tempUfsFileId) {
this.tempUfsFileId = tempUfsFileId;
setTempUfsFileIdIsSet(true);
return this;
}
public void unsetTempUfsFileId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TEMPUFSFILEID_ISSET_ID);
}
/** Returns true if field tempUfsFileId is set (has been assigned a value) and false otherwise */
public boolean isSetTempUfsFileId() {
return EncodingUtils.testBit(__isset_bitfield, __TEMPUFSFILEID_ISSET_ID);
}
public void setTempUfsFileIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TEMPUFSFILEID_ISSET_ID, value);
}
/**
* the options for completing the file
*/
public CompleteUfsFileTOptions getOptions() {
return this.options;
}
/**
* the options for completing the file
*/
public completeUfsFile_args setOptions(CompleteUfsFileTOptions options) {
this.options = options;
return this;
}
public void unsetOptions() {
this.options = null;
}
/** Returns true if field options is set (has been assigned a value) and false otherwise */
public boolean isSetOptions() {
return this.options != null;
}
public void setOptionsIsSet(boolean value) {
if (!value) {
this.options = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SESSION_ID:
if (value == null) {
unsetSessionId();
} else {
setSessionId((Long)value);
}
break;
case TEMP_UFS_FILE_ID:
if (value == null) {
unsetTempUfsFileId();
} else {
setTempUfsFileId((Long)value);
}
break;
case OPTIONS:
if (value == null) {
unsetOptions();
} else {
setOptions((CompleteUfsFileTOptions)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SESSION_ID:
return getSessionId();
case TEMP_UFS_FILE_ID:
return getTempUfsFileId();
case OPTIONS:
return getOptions();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SESSION_ID:
return isSetSessionId();
case TEMP_UFS_FILE_ID:
return isSetTempUfsFileId();
case OPTIONS:
return isSetOptions();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof completeUfsFile_args)
return this.equals((completeUfsFile_args)that);
return false;
}
public boolean equals(completeUfsFile_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_tempUfsFileId = true;
boolean that_present_tempUfsFileId = true;
if (this_present_tempUfsFileId || that_present_tempUfsFileId) {
if (!(this_present_tempUfsFileId && that_present_tempUfsFileId))
return false;
if (this.tempUfsFileId != that.tempUfsFileId)
return false;
}
boolean this_present_options = true && this.isSetOptions();
boolean that_present_options = true && that.isSetOptions();
if (this_present_options || that_present_options) {
if (!(this_present_options && that_present_options))
return false;
if (!this.options.equals(that.options))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_sessionId = true;
list.add(present_sessionId);
if (present_sessionId)
list.add(sessionId);
boolean present_tempUfsFileId = true;
list.add(present_tempUfsFileId);
if (present_tempUfsFileId)
list.add(tempUfsFileId);
boolean present_options = true && (isSetOptions());
list.add(present_options);
if (present_options)
list.add(options);
return list.hashCode();
}
@Override
public int compareTo(completeUfsFile_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(isSetTempUfsFileId()).compareTo(other.isSetTempUfsFileId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTempUfsFileId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tempUfsFileId, other.tempUfsFileId);
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("completeUfsFile_args(");
boolean first = true;
sb.append("sessionId:");
sb.append(this.sessionId);
first = false;
if (!first) sb.append(", ");
sb.append("tempUfsFileId:");
sb.append(this.tempUfsFileId);
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 completeUfsFile_argsStandardSchemeFactory implements SchemeFactory {
public completeUfsFile_argsStandardScheme getScheme() {
return new completeUfsFile_argsStandardScheme();
}
}
private static class completeUfsFile_argsStandardScheme extends StandardScheme<completeUfsFile_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, completeUfsFile_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: // TEMP_UFS_FILE_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.tempUfsFileId = iprot.readI64();
struct.setTempUfsFileIdIsSet(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 CompleteUfsFileTOptions();
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, completeUfsFile_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(TEMP_UFS_FILE_ID_FIELD_DESC);
oprot.writeI64(struct.tempUfsFileId);
oprot.writeFieldEnd();
if (struct.options != null) {
oprot.writeFieldBegin(OPTIONS_FIELD_DESC);
struct.options.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class completeUfsFile_argsTupleSchemeFactory implements SchemeFactory {
public completeUfsFile_argsTupleScheme getScheme() {
return new completeUfsFile_argsTupleScheme();
}
}
private static class completeUfsFile_argsTupleScheme extends TupleScheme<completeUfsFile_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, completeUfsFile_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSessionId()) {
optionals.set(0);
}
if (struct.isSetTempUfsFileId()) {
optionals.set(1);
}
if (struct.isSetOptions()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetSessionId()) {
oprot.writeI64(struct.sessionId);
}
if (struct.isSetTempUfsFileId()) {
oprot.writeI64(struct.tempUfsFileId);
}
if (struct.isSetOptions()) {
struct.options.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, completeUfsFile_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.tempUfsFileId = iprot.readI64();
struct.setTempUfsFileIdIsSet(true);
}
if (incoming.get(2)) {
struct.options = new CompleteUfsFileTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
}
}
}
}
public static class completeUfsFile_result implements org.apache.thrift.TBase<completeUfsFile_result, completeUfsFile_result._Fields>, java.io.Serializable, Cloneable, Comparable<completeUfsFile_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("completeUfsFile_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (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 completeUfsFile_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new completeUfsFile_resultTupleSchemeFactory());
}
private long 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.I64)));
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(completeUfsFile_result.class, metaDataMap);
}
public completeUfsFile_result() {
}
public completeUfsFile_result(
long success,
alluxio.thrift.AlluxioTException e)
{
this();
this.success = success;
setSuccessIsSet(true);
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public completeUfsFile_result(completeUfsFile_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = other.success;
if (other.isSetE()) {
this.e = new alluxio.thrift.AlluxioTException(other.e);
}
}
public completeUfsFile_result deepCopy() {
return new completeUfsFile_result(this);
}
@Override
public void clear() {
setSuccessIsSet(false);
this.success = 0;
this.e = null;
}
public long getSuccess() {
return this.success;
}
public completeUfsFile_result setSuccess(long 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 completeUfsFile_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((Long)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 completeUfsFile_result)
return this.equals((completeUfsFile_result)that);
return false;
}
public boolean equals(completeUfsFile_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(completeUfsFile_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("completeUfsFile_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 completeUfsFile_resultStandardSchemeFactory implements SchemeFactory {
public completeUfsFile_resultStandardScheme getScheme() {
return new completeUfsFile_resultStandardScheme();
}
}
private static class completeUfsFile_resultStandardScheme extends StandardScheme<completeUfsFile_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, completeUfsFile_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.I64) {
struct.success = iprot.readI64();
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, completeUfsFile_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeI64(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 completeUfsFile_resultTupleSchemeFactory implements SchemeFactory {
public completeUfsFile_resultTupleScheme getScheme() {
return new completeUfsFile_resultTupleScheme();
}
}
private static class completeUfsFile_resultTupleScheme extends TupleScheme<completeUfsFile_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, completeUfsFile_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.writeI64(struct.success);
}
if (struct.isSetE()) {
struct.e.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, completeUfsFile_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = iprot.readI64();
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
}
}
}
}
public static class createUfsFile_args implements org.apache.thrift.TBase<createUfsFile_args, createUfsFile_args._Fields>, java.io.Serializable, Cloneable, Comparable<createUfsFile_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createUfsFile_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 UFS_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("ufsPath", org.apache.thrift.protocol.TType.STRING, (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 createUfsFile_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new createUfsFile_argsTupleSchemeFactory());
}
private long sessionId; // required
private String ufsPath; // required
private CreateUfsFileTOptions options; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
/**
* the id of the current session
*/
SESSION_ID((short)1, "sessionId"),
/**
* the path of the file in the ufs
*/
UFS_PATH((short)2, "ufsPath"),
/**
* the options for creating the file
*/
OPTIONS((short)3, "options");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // SESSION_ID
return SESSION_ID;
case 2: // UFS_PATH
return UFS_PATH;
case 3: // OPTIONS
return OPTIONS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __SESSIONID_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.UFS_PATH, new org.apache.thrift.meta_data.FieldMetaData("ufsPath", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
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, CreateUfsFileTOptions.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createUfsFile_args.class, metaDataMap);
}
public createUfsFile_args() {
}
public createUfsFile_args(
long sessionId,
String ufsPath,
CreateUfsFileTOptions options)
{
this();
this.sessionId = sessionId;
setSessionIdIsSet(true);
this.ufsPath = ufsPath;
this.options = options;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public createUfsFile_args(createUfsFile_args other) {
__isset_bitfield = other.__isset_bitfield;
this.sessionId = other.sessionId;
if (other.isSetUfsPath()) {
this.ufsPath = other.ufsPath;
}
if (other.isSetOptions()) {
this.options = new CreateUfsFileTOptions(other.options);
}
}
public createUfsFile_args deepCopy() {
return new createUfsFile_args(this);
}
@Override
public void clear() {
setSessionIdIsSet(false);
this.sessionId = 0;
this.ufsPath = null;
this.options = null;
}
/**
* the id of the current session
*/
public long getSessionId() {
return this.sessionId;
}
/**
* the id of the current session
*/
public createUfsFile_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 path of the file in the ufs
*/
public String getUfsPath() {
return this.ufsPath;
}
/**
* the path of the file in the ufs
*/
public createUfsFile_args setUfsPath(String ufsPath) {
this.ufsPath = ufsPath;
return this;
}
public void unsetUfsPath() {
this.ufsPath = null;
}
/** Returns true if field ufsPath is set (has been assigned a value) and false otherwise */
public boolean isSetUfsPath() {
return this.ufsPath != null;
}
public void setUfsPathIsSet(boolean value) {
if (!value) {
this.ufsPath = null;
}
}
/**
* the options for creating the file
*/
public CreateUfsFileTOptions getOptions() {
return this.options;
}
/**
* the options for creating the file
*/
public createUfsFile_args setOptions(CreateUfsFileTOptions options) {
this.options = options;
return this;
}
public void unsetOptions() {
this.options = null;
}
/** Returns true if field options is set (has been assigned a value) and false otherwise */
public boolean isSetOptions() {
return this.options != null;
}
public void setOptionsIsSet(boolean value) {
if (!value) {
this.options = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SESSION_ID:
if (value == null) {
unsetSessionId();
} else {
setSessionId((Long)value);
}
break;
case UFS_PATH:
if (value == null) {
unsetUfsPath();
} else {
setUfsPath((String)value);
}
break;
case OPTIONS:
if (value == null) {
unsetOptions();
} else {
setOptions((CreateUfsFileTOptions)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SESSION_ID:
return getSessionId();
case UFS_PATH:
return getUfsPath();
case OPTIONS:
return getOptions();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SESSION_ID:
return isSetSessionId();
case UFS_PATH:
return isSetUfsPath();
case OPTIONS:
return isSetOptions();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof createUfsFile_args)
return this.equals((createUfsFile_args)that);
return false;
}
public boolean equals(createUfsFile_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_ufsPath = true && this.isSetUfsPath();
boolean that_present_ufsPath = true && that.isSetUfsPath();
if (this_present_ufsPath || that_present_ufsPath) {
if (!(this_present_ufsPath && that_present_ufsPath))
return false;
if (!this.ufsPath.equals(that.ufsPath))
return false;
}
boolean this_present_options = true && this.isSetOptions();
boolean that_present_options = true && that.isSetOptions();
if (this_present_options || that_present_options) {
if (!(this_present_options && that_present_options))
return false;
if (!this.options.equals(that.options))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_sessionId = true;
list.add(present_sessionId);
if (present_sessionId)
list.add(sessionId);
boolean present_ufsPath = true && (isSetUfsPath());
list.add(present_ufsPath);
if (present_ufsPath)
list.add(ufsPath);
boolean present_options = true && (isSetOptions());
list.add(present_options);
if (present_options)
list.add(options);
return list.hashCode();
}
@Override
public int compareTo(createUfsFile_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(isSetUfsPath()).compareTo(other.isSetUfsPath());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUfsPath()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ufsPath, other.ufsPath);
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("createUfsFile_args(");
boolean first = true;
sb.append("sessionId:");
sb.append(this.sessionId);
first = false;
if (!first) sb.append(", ");
sb.append("ufsPath:");
if (this.ufsPath == null) {
sb.append("null");
} else {
sb.append(this.ufsPath);
}
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 createUfsFile_argsStandardSchemeFactory implements SchemeFactory {
public createUfsFile_argsStandardScheme getScheme() {
return new createUfsFile_argsStandardScheme();
}
}
private static class createUfsFile_argsStandardScheme extends StandardScheme<createUfsFile_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, createUfsFile_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: // UFS_PATH
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.ufsPath = iprot.readString();
struct.setUfsPathIsSet(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 CreateUfsFileTOptions();
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, createUfsFile_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.ufsPath != null) {
oprot.writeFieldBegin(UFS_PATH_FIELD_DESC);
oprot.writeString(struct.ufsPath);
oprot.writeFieldEnd();
}
if (struct.options != null) {
oprot.writeFieldBegin(OPTIONS_FIELD_DESC);
struct.options.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class createUfsFile_argsTupleSchemeFactory implements SchemeFactory {
public createUfsFile_argsTupleScheme getScheme() {
return new createUfsFile_argsTupleScheme();
}
}
private static class createUfsFile_argsTupleScheme extends TupleScheme<createUfsFile_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, createUfsFile_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSessionId()) {
optionals.set(0);
}
if (struct.isSetUfsPath()) {
optionals.set(1);
}
if (struct.isSetOptions()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetSessionId()) {
oprot.writeI64(struct.sessionId);
}
if (struct.isSetUfsPath()) {
oprot.writeString(struct.ufsPath);
}
if (struct.isSetOptions()) {
struct.options.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, createUfsFile_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.ufsPath = iprot.readString();
struct.setUfsPathIsSet(true);
}
if (incoming.get(2)) {
struct.options = new CreateUfsFileTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
}
}
}
}
public static class createUfsFile_result implements org.apache.thrift.TBase<createUfsFile_result, createUfsFile_result._Fields>, java.io.Serializable, Cloneable, Comparable<createUfsFile_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createUfsFile_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (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 createUfsFile_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new createUfsFile_resultTupleSchemeFactory());
}
private long 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.I64)));
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(createUfsFile_result.class, metaDataMap);
}
public createUfsFile_result() {
}
public createUfsFile_result(
long success,
alluxio.thrift.AlluxioTException e)
{
this();
this.success = success;
setSuccessIsSet(true);
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public createUfsFile_result(createUfsFile_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = other.success;
if (other.isSetE()) {
this.e = new alluxio.thrift.AlluxioTException(other.e);
}
}
public createUfsFile_result deepCopy() {
return new createUfsFile_result(this);
}
@Override
public void clear() {
setSuccessIsSet(false);
this.success = 0;
this.e = null;
}
public long getSuccess() {
return this.success;
}
public createUfsFile_result setSuccess(long 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 createUfsFile_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((Long)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 createUfsFile_result)
return this.equals((createUfsFile_result)that);
return false;
}
public boolean equals(createUfsFile_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(createUfsFile_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("createUfsFile_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 createUfsFile_resultStandardSchemeFactory implements SchemeFactory {
public createUfsFile_resultStandardScheme getScheme() {
return new createUfsFile_resultStandardScheme();
}
}
private static class createUfsFile_resultStandardScheme extends StandardScheme<createUfsFile_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, createUfsFile_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.I64) {
struct.success = iprot.readI64();
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, createUfsFile_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeI64(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 createUfsFile_resultTupleSchemeFactory implements SchemeFactory {
public createUfsFile_resultTupleScheme getScheme() {
return new createUfsFile_resultTupleScheme();
}
}
private static class createUfsFile_resultTupleScheme extends TupleScheme<createUfsFile_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, createUfsFile_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.writeI64(struct.success);
}
if (struct.isSetE()) {
struct.e.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, createUfsFile_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = iprot.readI64();
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.e = new alluxio.thrift.AlluxioTException();
struct.e.read(iprot);
struct.setEIsSet(true);
}
}
}
}
public static class openUfsFile_args implements org.apache.thrift.TBase<openUfsFile_args, openUfsFile_args._Fields>, java.io.Serializable, Cloneable, Comparable<openUfsFile_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("openUfsFile_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 UFS_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("ufsPath", org.apache.thrift.protocol.TType.STRING, (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 openUfsFile_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new openUfsFile_argsTupleSchemeFactory());
}
private long sessionId; // required
private String ufsPath; // required
private OpenUfsFileTOptions options; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
/**
* the id of the current session
*/
SESSION_ID((short)1, "sessionId"),
/**
* the path of the file in the ufs
*/
UFS_PATH((short)2, "ufsPath"),
/**
* the options for opening the file
*/
OPTIONS((short)3, "options");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // SESSION_ID
return SESSION_ID;
case 2: // UFS_PATH
return UFS_PATH;
case 3: // OPTIONS
return OPTIONS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __SESSIONID_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.UFS_PATH, new org.apache.thrift.meta_data.FieldMetaData("ufsPath", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
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, OpenUfsFileTOptions.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(openUfsFile_args.class, metaDataMap);
}
public openUfsFile_args() {
}
public openUfsFile_args(
long sessionId,
String ufsPath,
OpenUfsFileTOptions options)
{
this();
this.sessionId = sessionId;
setSessionIdIsSet(true);
this.ufsPath = ufsPath;
this.options = options;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public openUfsFile_args(openUfsFile_args other) {
__isset_bitfield = other.__isset_bitfield;
this.sessionId = other.sessionId;
if (other.isSetUfsPath()) {
this.ufsPath = other.ufsPath;
}
if (other.isSetOptions()) {
this.options = new OpenUfsFileTOptions(other.options);
}
}
public openUfsFile_args deepCopy() {
return new openUfsFile_args(this);
}
@Override
public void clear() {
setSessionIdIsSet(false);
this.sessionId = 0;
this.ufsPath = null;
this.options = null;
}
/**
* the id of the current session
*/
public long getSessionId() {
return this.sessionId;
}
/**
* the id of the current session
*/
public openUfsFile_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 path of the file in the ufs
*/
public String getUfsPath() {
return this.ufsPath;
}
/**
* the path of the file in the ufs
*/
public openUfsFile_args setUfsPath(String ufsPath) {
this.ufsPath = ufsPath;
return this;
}
public void unsetUfsPath() {
this.ufsPath = null;
}
/** Returns true if field ufsPath is set (has been assigned a value) and false otherwise */
public boolean isSetUfsPath() {
return this.ufsPath != null;
}
public void setUfsPathIsSet(boolean value) {
if (!value) {
this.ufsPath = null;
}
}
/**
* the options for opening the file
*/
public OpenUfsFileTOptions getOptions() {
return this.options;
}
/**
* the options for opening the file
*/
public openUfsFile_args setOptions(OpenUfsFileTOptions options) {
this.options = options;
return this;
}
public void unsetOptions() {
this.options = null;
}
/** Returns true if field options is set (has been assigned a value) and false otherwise */
public boolean isSetOptions() {
return this.options != null;
}
public void setOptionsIsSet(boolean value) {
if (!value) {
this.options = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SESSION_ID:
if (value == null) {
unsetSessionId();
} else {
setSessionId((Long)value);
}
break;
case UFS_PATH:
if (value == null) {
unsetUfsPath();
} else {
setUfsPath((String)value);
}
break;
case OPTIONS:
if (value == null) {
unsetOptions();
} else {
setOptions((OpenUfsFileTOptions)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SESSION_ID:
return getSessionId();
case UFS_PATH:
return getUfsPath();
case OPTIONS:
return getOptions();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SESSION_ID:
return isSetSessionId();
case UFS_PATH:
return isSetUfsPath();
case OPTIONS:
return isSetOptions();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof openUfsFile_args)
return this.equals((openUfsFile_args)that);
return false;
}
public boolean equals(openUfsFile_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_ufsPath = true && this.isSetUfsPath();
boolean that_present_ufsPath = true && that.isSetUfsPath();
if (this_present_ufsPath || that_present_ufsPath) {
if (!(this_present_ufsPath && that_present_ufsPath))
return false;
if (!this.ufsPath.equals(that.ufsPath))
return false;
}
boolean this_present_options = true && this.isSetOptions();
boolean that_present_options = true && that.isSetOptions();
if (this_present_options || that_present_options) {
if (!(this_present_options && that_present_options))
return false;
if (!this.options.equals(that.options))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_sessionId = true;
list.add(present_sessionId);
if (present_sessionId)
list.add(sessionId);
boolean present_ufsPath = true && (isSetUfsPath());
list.add(present_ufsPath);
if (present_ufsPath)
list.add(ufsPath);
boolean present_options = true && (isSetOptions());
list.add(present_options);
if (present_options)
list.add(options);
return list.hashCode();
}
@Override
public int compareTo(openUfsFile_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(isSetUfsPath()).compareTo(other.isSetUfsPath());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUfsPath()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ufsPath, other.ufsPath);
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("openUfsFile_args(");
boolean first = true;
sb.append("sessionId:");
sb.append(this.sessionId);
first = false;
if (!first) sb.append(", ");
sb.append("ufsPath:");
if (this.ufsPath == null) {
sb.append("null");
} else {
sb.append(this.ufsPath);
}
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 openUfsFile_argsStandardSchemeFactory implements SchemeFactory {
public openUfsFile_argsStandardScheme getScheme() {
return new openUfsFile_argsStandardScheme();
}
}
private static class openUfsFile_argsStandardScheme extends StandardScheme<openUfsFile_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, openUfsFile_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: // UFS_PATH
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.ufsPath = iprot.readString();
struct.setUfsPathIsSet(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 OpenUfsFileTOptions();
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, openUfsFile_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.ufsPath != null) {
oprot.writeFieldBegin(UFS_PATH_FIELD_DESC);
oprot.writeString(struct.ufsPath);
oprot.writeFieldEnd();
}
if (struct.options != null) {
oprot.writeFieldBegin(OPTIONS_FIELD_DESC);
struct.options.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class openUfsFile_argsTupleSchemeFactory implements SchemeFactory {
public openUfsFile_argsTupleScheme getScheme() {
return new openUfsFile_argsTupleScheme();
}
}
private static class openUfsFile_argsTupleScheme extends TupleScheme<openUfsFile_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, openUfsFile_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSessionId()) {
optionals.set(0);
}
if (struct.isSetUfsPath()) {
optionals.set(1);
}
if (struct.isSetOptions()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetSessionId()) {
oprot.writeI64(struct.sessionId);
}
if (struct.isSetUfsPath()) {
oprot.writeString(struct.ufsPath);
}
if (struct.isSetOptions()) {
struct.options.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, openUfsFile_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.ufsPath = iprot.readString();
struct.setUfsPathIsSet(true);
}
if (incoming.get(2)) {
struct.options = new OpenUfsFileTOptions();
struct.options.read(iprot);
struct.setOptionsIsSet(true);
}
}
}
}
public static class openUfsFile_result implements org.apache.thrift.TBase<openUfsFile_result, openUfsFile_result._Fields>, java.io.Serializable, Cloneable, Comparable<openUfsFile_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("openUfsFile_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (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 openUfsFile_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new openUfsFile_resultTupleSchemeFactory());
}
private long 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.I64)));
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(openUfsFile_result.class, metaDataMap);
}
public openUfsFile_result() {
}
public openUfsFile_result(
long success,
alluxio.thrift.AlluxioTException e)
{
this();
this.success = success;
setSuccessIsSet(true);
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public openUfsFile_result(openUfsFile_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = other.success;
if (other.isSetE()) {
this.e = new alluxio.thrift.AlluxioTException(other.e);
}
}
public openUfsFile_result deepCopy() {
return new openUfsFile_result(this);
}
@Override
public void clear() {
setSuccessIsSet(false);
this.success = 0;
this.e = null;
}
public long getSuccess() {
return this.success;
}
public openUfsFile_result setSuccess(long 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 openUfsFile_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((Long)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 openUfsFile_result)
return this.equals((openUfsFile_result)that);
return false;
}
public boolean equals(openUfsFile_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(openUfsFile_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("openUfsFile_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 openUfsFile_resultStandardSchemeFactory implements SchemeFactory {
public openUfsFile_resultStandardScheme getScheme() {
return new openUfsFile_resultStandardScheme();
}
}
private static class openUfsFile_resultStandardScheme extends StandardScheme<openUfsFile_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, openUfsFile_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.I64) {
struct.success = iprot.readI64();
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, openUfsFile_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeI64(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 openUfsFile_resultTupleSchemeFactory implements SchemeFactory {
public openUfsFile_resultTupleScheme getScheme() {
return new openUfsFile_resultTupleScheme();
}
}
private static class openUfsFile_resultTupleScheme extends TupleScheme<openUfsFile_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, openUfsFile_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.writeI64(struct.success);
}
if (struct.isSetE()) {
struct.e.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, openUfsFile_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = iprot.readI64();
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"),
/**
* the client metrics. 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);
}
/**
* the client metrics. deprecated since 1.3.0 and will be removed in 2.0
*/
public List<Long> getMetrics() {
return this.metrics;
}
/**
* the client 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);
}
}
}
}
}