diff --git a/common/src/main/java/tachyon/Constants.java b/common/src/main/java/tachyon/Constants.java index 96f96a87023a..fb127e701e52 100644 --- a/common/src/main/java/tachyon/Constants.java +++ b/common/src/main/java/tachyon/Constants.java @@ -78,6 +78,7 @@ public class Constants { public static final String BLOCK_MASTER_SERVICE_NAME = "BlockMaster"; public static final String FILE_SYSTEM_MASTER_SERVICE_NAME = "FileSystemMaster"; public static final String RAW_TABLE_MASTER_SERVICE_NAME = "RawTableMaster"; + public static final String LINEAGE_MASTER_SERVICE_NAME = "LineageMaster"; /** * Version 1 [Before 0.5.0] Customized ser/de based.
diff --git a/common/src/main/java/tachyon/thrift/BlockInfo.java b/common/src/main/java/tachyon/thrift/BlockInfo.java index 5e6b129ec9f8..7089a34af819 100644 --- a/common/src/main/java/tachyon/thrift/BlockInfo.java +++ b/common/src/main/java/tachyon/thrift/BlockInfo.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class BlockInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BlockInfo"); diff --git a/common/src/main/java/tachyon/thrift/BlockInfoException.java b/common/src/main/java/tachyon/thrift/BlockInfoException.java index f5366020c654..1bb3ab3c1030 100644 --- a/common/src/main/java/tachyon/thrift/BlockInfoException.java +++ b/common/src/main/java/tachyon/thrift/BlockInfoException.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class BlockInfoException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BlockInfoException"); diff --git a/common/src/main/java/tachyon/thrift/BlockLocation.java b/common/src/main/java/tachyon/thrift/BlockLocation.java index d6104a60219d..babc1e24fc2a 100644 --- a/common/src/main/java/tachyon/thrift/BlockLocation.java +++ b/common/src/main/java/tachyon/thrift/BlockLocation.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class BlockLocation implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BlockLocation"); diff --git a/common/src/main/java/tachyon/thrift/BlockMasterService.java b/common/src/main/java/tachyon/thrift/BlockMasterService.java index ac427e655fc9..fb89c8e2d469 100644 --- a/common/src/main/java/tachyon/thrift/BlockMasterService.java +++ b/common/src/main/java/tachyon/thrift/BlockMasterService.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class BlockMasterService { public interface Iface { diff --git a/common/src/main/java/tachyon/thrift/Command.java b/common/src/main/java/tachyon/thrift/Command.java index 2e05c82b5741..8e7746c30a91 100644 --- a/common/src/main/java/tachyon/thrift/Command.java +++ b/common/src/main/java/tachyon/thrift/Command.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class Command implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Command"); diff --git a/common/src/main/java/tachyon/thrift/DependencyDoesNotExistException.java b/common/src/main/java/tachyon/thrift/DependencyDoesNotExistException.java index ff533d0908ab..7ceb298df5aa 100644 --- a/common/src/main/java/tachyon/thrift/DependencyDoesNotExistException.java +++ b/common/src/main/java/tachyon/thrift/DependencyDoesNotExistException.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class DependencyDoesNotExistException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DependencyDoesNotExistException"); diff --git a/common/src/main/java/tachyon/thrift/DependencyInfo.java b/common/src/main/java/tachyon/thrift/DependencyInfo.java index f878bd0ff398..e600ddd30280 100644 --- a/common/src/main/java/tachyon/thrift/DependencyInfo.java +++ b/common/src/main/java/tachyon/thrift/DependencyInfo.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class DependencyInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DependencyInfo"); diff --git a/common/src/main/java/tachyon/thrift/FailedToCheckpointException.java b/common/src/main/java/tachyon/thrift/FailedToCheckpointException.java index eeed3c7632eb..5a02d955b47c 100644 --- a/common/src/main/java/tachyon/thrift/FailedToCheckpointException.java +++ b/common/src/main/java/tachyon/thrift/FailedToCheckpointException.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class FailedToCheckpointException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FailedToCheckpointException"); diff --git a/common/src/main/java/tachyon/thrift/FileAlreadyExistException.java b/common/src/main/java/tachyon/thrift/FileAlreadyExistException.java index 5e1376198f35..b426df7199cd 100644 --- a/common/src/main/java/tachyon/thrift/FileAlreadyExistException.java +++ b/common/src/main/java/tachyon/thrift/FileAlreadyExistException.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class FileAlreadyExistException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FileAlreadyExistException"); diff --git a/common/src/main/java/tachyon/thrift/FileBlockInfo.java b/common/src/main/java/tachyon/thrift/FileBlockInfo.java index 63328572ac7b..f61f38ab9d67 100644 --- a/common/src/main/java/tachyon/thrift/FileBlockInfo.java +++ b/common/src/main/java/tachyon/thrift/FileBlockInfo.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class FileBlockInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FileBlockInfo"); diff --git a/common/src/main/java/tachyon/thrift/FileDoesNotExistException.java b/common/src/main/java/tachyon/thrift/FileDoesNotExistException.java index f5677ea8f510..2e0524c963f6 100644 --- a/common/src/main/java/tachyon/thrift/FileDoesNotExistException.java +++ b/common/src/main/java/tachyon/thrift/FileDoesNotExistException.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class FileDoesNotExistException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FileDoesNotExistException"); diff --git a/common/src/main/java/tachyon/thrift/FileInfo.java b/common/src/main/java/tachyon/thrift/FileInfo.java index 38d606475ae3..e5dd9fd57514 100644 --- a/common/src/main/java/tachyon/thrift/FileInfo.java +++ b/common/src/main/java/tachyon/thrift/FileInfo.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class FileInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FileInfo"); diff --git a/common/src/main/java/tachyon/thrift/FileSystemMasterService.java b/common/src/main/java/tachyon/thrift/FileSystemMasterService.java index 978966d8d52f..3086915b1e3f 100644 --- a/common/src/main/java/tachyon/thrift/FileSystemMasterService.java +++ b/common/src/main/java/tachyon/thrift/FileSystemMasterService.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class FileSystemMasterService { public interface Iface { diff --git a/common/src/main/java/tachyon/thrift/InvalidPathException.java b/common/src/main/java/tachyon/thrift/InvalidPathException.java index 9702510d44be..756933730b92 100644 --- a/common/src/main/java/tachyon/thrift/InvalidPathException.java +++ b/common/src/main/java/tachyon/thrift/InvalidPathException.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class InvalidPathException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InvalidPathException"); diff --git a/common/src/main/java/tachyon/thrift/LineageMasterService.java b/common/src/main/java/tachyon/thrift/LineageMasterService.java new file mode 100644 index 000000000000..da1dceb45ada --- /dev/null +++ b/common/src/main/java/tachyon/thrift/LineageMasterService.java @@ -0,0 +1,2156 @@ +/** + * Autogenerated by Thrift Compiler (0.9.2) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package tachyon.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.2)", date = "2015-9-15") +public class LineageMasterService { + + public interface Iface { + + public long createLineage(List inputFiles, List outputFiles, ByteBuffer job) throws org.apache.thrift.TException; + + public boolean deleteLineage(long lineageId) throws org.apache.thrift.TException; + + } + + public interface AsyncIface { + + public void createLineage(List inputFiles, List outputFiles, ByteBuffer job, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void deleteLineage(long lineageId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + } + + public static class Client extends org.apache.thrift.TServiceClient implements Iface { + public static class Factory implements org.apache.thrift.TServiceClientFactory { + 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 long createLineage(List inputFiles, List outputFiles, ByteBuffer job) throws org.apache.thrift.TException + { + send_createLineage(inputFiles, outputFiles, job); + return recv_createLineage(); + } + + public void send_createLineage(List inputFiles, List outputFiles, ByteBuffer job) throws org.apache.thrift.TException + { + createLineage_args args = new createLineage_args(); + args.setInputFiles(inputFiles); + args.setOutputFiles(outputFiles); + args.setJob(job); + sendBase("createLineage", args); + } + + public long recv_createLineage() throws org.apache.thrift.TException + { + createLineage_result result = new createLineage_result(); + receiveBase(result, "createLineage"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createLineage failed: unknown result"); + } + + public boolean deleteLineage(long lineageId) throws org.apache.thrift.TException + { + send_deleteLineage(lineageId); + return recv_deleteLineage(); + } + + public void send_deleteLineage(long lineageId) throws org.apache.thrift.TException + { + deleteLineage_args args = new deleteLineage_args(); + args.setLineageId(lineageId); + sendBase("deleteLineage", args); + } + + public boolean recv_deleteLineage() throws org.apache.thrift.TException + { + deleteLineage_result result = new deleteLineage_result(); + receiveBase(result, "deleteLineage"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteLineage failed: unknown result"); + } + + } + public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { + public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { + 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 createLineage(List inputFiles, List outputFiles, ByteBuffer job, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + createLineage_call method_call = new createLineage_call(inputFiles, outputFiles, job, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class createLineage_call extends org.apache.thrift.async.TAsyncMethodCall { + private List inputFiles; + private List outputFiles; + private ByteBuffer job; + public createLineage_call(List inputFiles, List outputFiles, ByteBuffer job, 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.inputFiles = inputFiles; + this.outputFiles = outputFiles; + this.job = job; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createLineage", org.apache.thrift.protocol.TMessageType.CALL, 0)); + createLineage_args args = new createLineage_args(); + args.setInputFiles(inputFiles); + args.setOutputFiles(outputFiles); + args.setJob(job); + args.write(prot); + prot.writeMessageEnd(); + } + + public long getResult() throws 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_createLineage(); + } + } + + public void deleteLineage(long lineageId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + deleteLineage_call method_call = new deleteLineage_call(lineageId, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class deleteLineage_call extends org.apache.thrift.async.TAsyncMethodCall { + private long lineageId; + public deleteLineage_call(long lineageId, 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.lineageId = lineageId; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteLineage", org.apache.thrift.protocol.TMessageType.CALL, 0)); + deleteLineage_args args = new deleteLineage_args(); + args.setLineageId(lineageId); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws 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_deleteLineage(); + } + } + + } + + public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); + public Processor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected Processor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("createLineage", new createLineage()); + processMap.put("deleteLineage", new deleteLineage()); + return processMap; + } + + public static class createLineage extends org.apache.thrift.ProcessFunction { + public createLineage() { + super("createLineage"); + } + + public createLineage_args getEmptyArgsInstance() { + return new createLineage_args(); + } + + protected boolean isOneway() { + return false; + } + + public createLineage_result getResult(I iface, createLineage_args args) throws org.apache.thrift.TException { + createLineage_result result = new createLineage_result(); + result.success = iface.createLineage(args.inputFiles, args.outputFiles, args.job); + result.setSuccessIsSet(true); + return result; + } + } + + public static class deleteLineage extends org.apache.thrift.ProcessFunction { + public deleteLineage() { + super("deleteLineage"); + } + + public deleteLineage_args getEmptyArgsInstance() { + return new deleteLineage_args(); + } + + protected boolean isOneway() { + return false; + } + + public deleteLineage_result getResult(I iface, deleteLineage_args args) throws org.apache.thrift.TException { + deleteLineage_result result = new deleteLineage_result(); + result.success = iface.deleteLineage(args.lineageId); + result.setSuccessIsSet(true); + return result; + } + } + + } + + public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); + public AsyncProcessor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected AsyncProcessor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("createLineage", new createLineage()); + processMap.put("deleteLineage", new deleteLineage()); + return processMap; + } + + public static class createLineage extends org.apache.thrift.AsyncProcessFunction { + public createLineage() { + super("createLineage"); + } + + public createLineage_args getEmptyArgsInstance() { + return new createLineage_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Long o) { + createLineage_result result = new createLineage_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; + createLineage_result result = new createLineage_result(); + { + 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, createLineage_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.createLineage(args.inputFiles, args.outputFiles, args.job,resultHandler); + } + } + + public static class deleteLineage extends org.apache.thrift.AsyncProcessFunction { + public deleteLineage() { + super("deleteLineage"); + } + + public deleteLineage_args getEmptyArgsInstance() { + return new deleteLineage_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Boolean o) { + deleteLineage_result result = new deleteLineage_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; + deleteLineage_result result = new deleteLineage_result(); + { + 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, deleteLineage_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.deleteLineage(args.lineageId,resultHandler); + } + } + + } + + public static class createLineage_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createLineage_args"); + + private static final org.apache.thrift.protocol.TField INPUT_FILES_FIELD_DESC = new org.apache.thrift.protocol.TField("inputFiles", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField OUTPUT_FILES_FIELD_DESC = new org.apache.thrift.protocol.TField("outputFiles", org.apache.thrift.protocol.TType.LIST, (short)2); + private static final org.apache.thrift.protocol.TField JOB_FIELD_DESC = new org.apache.thrift.protocol.TField("job", org.apache.thrift.protocol.TType.STRING, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new createLineage_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new createLineage_argsTupleSchemeFactory()); + } + + public List inputFiles; // required + public List outputFiles; // required + public ByteBuffer job; // 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 { + INPUT_FILES((short)1, "inputFiles"), + OUTPUT_FILES((short)2, "outputFiles"), + JOB((short)3, "job"); + + private static final Map byName = new HashMap(); + + 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: // INPUT_FILES + return INPUT_FILES; + case 2: // OUTPUT_FILES + return OUTPUT_FILES; + case 3: // JOB + return JOB; + 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.INPUT_FILES, new org.apache.thrift.meta_data.FieldMetaData("inputFiles", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); + tmpMap.put(_Fields.OUTPUT_FILES, new org.apache.thrift.meta_data.FieldMetaData("outputFiles", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); + tmpMap.put(_Fields.JOB, new org.apache.thrift.meta_data.FieldMetaData("job", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createLineage_args.class, metaDataMap); + } + + public createLineage_args() { + } + + public createLineage_args( + List inputFiles, + List outputFiles, + ByteBuffer job) + { + this(); + this.inputFiles = inputFiles; + this.outputFiles = outputFiles; + this.job = org.apache.thrift.TBaseHelper.copyBinary(job); + } + + /** + * Performs a deep copy on other. + */ + public createLineage_args(createLineage_args other) { + if (other.isSetInputFiles()) { + List __this__inputFiles = new ArrayList(other.inputFiles); + this.inputFiles = __this__inputFiles; + } + if (other.isSetOutputFiles()) { + List __this__outputFiles = new ArrayList(other.outputFiles); + this.outputFiles = __this__outputFiles; + } + if (other.isSetJob()) { + this.job = org.apache.thrift.TBaseHelper.copyBinary(other.job); + } + } + + public createLineage_args deepCopy() { + return new createLineage_args(this); + } + + @Override + public void clear() { + this.inputFiles = null; + this.outputFiles = null; + this.job = null; + } + + public int getInputFilesSize() { + return (this.inputFiles == null) ? 0 : this.inputFiles.size(); + } + + public java.util.Iterator getInputFilesIterator() { + return (this.inputFiles == null) ? null : this.inputFiles.iterator(); + } + + public void addToInputFiles(long elem) { + if (this.inputFiles == null) { + this.inputFiles = new ArrayList(); + } + this.inputFiles.add(elem); + } + + public List getInputFiles() { + return this.inputFiles; + } + + public createLineage_args setInputFiles(List inputFiles) { + this.inputFiles = inputFiles; + return this; + } + + public void unsetInputFiles() { + this.inputFiles = null; + } + + /** Returns true if field inputFiles is set (has been assigned a value) and false otherwise */ + public boolean isSetInputFiles() { + return this.inputFiles != null; + } + + public void setInputFilesIsSet(boolean value) { + if (!value) { + this.inputFiles = null; + } + } + + public int getOutputFilesSize() { + return (this.outputFiles == null) ? 0 : this.outputFiles.size(); + } + + public java.util.Iterator getOutputFilesIterator() { + return (this.outputFiles == null) ? null : this.outputFiles.iterator(); + } + + public void addToOutputFiles(long elem) { + if (this.outputFiles == null) { + this.outputFiles = new ArrayList(); + } + this.outputFiles.add(elem); + } + + public List getOutputFiles() { + return this.outputFiles; + } + + public createLineage_args setOutputFiles(List outputFiles) { + this.outputFiles = outputFiles; + return this; + } + + public void unsetOutputFiles() { + this.outputFiles = null; + } + + /** Returns true if field outputFiles is set (has been assigned a value) and false otherwise */ + public boolean isSetOutputFiles() { + return this.outputFiles != null; + } + + public void setOutputFilesIsSet(boolean value) { + if (!value) { + this.outputFiles = null; + } + } + + public byte[] getJob() { + setJob(org.apache.thrift.TBaseHelper.rightSize(job)); + return job == null ? null : job.array(); + } + + public ByteBuffer bufferForJob() { + return org.apache.thrift.TBaseHelper.copyBinary(job); + } + + public createLineage_args setJob(byte[] job) { + this.job = job == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(job, job.length)); + return this; + } + + public createLineage_args setJob(ByteBuffer job) { + this.job = org.apache.thrift.TBaseHelper.copyBinary(job); + return this; + } + + public void unsetJob() { + this.job = null; + } + + /** Returns true if field job is set (has been assigned a value) and false otherwise */ + public boolean isSetJob() { + return this.job != null; + } + + public void setJobIsSet(boolean value) { + if (!value) { + this.job = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case INPUT_FILES: + if (value == null) { + unsetInputFiles(); + } else { + setInputFiles((List)value); + } + break; + + case OUTPUT_FILES: + if (value == null) { + unsetOutputFiles(); + } else { + setOutputFiles((List)value); + } + break; + + case JOB: + if (value == null) { + unsetJob(); + } else { + setJob((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case INPUT_FILES: + return getInputFiles(); + + case OUTPUT_FILES: + return getOutputFiles(); + + case JOB: + return getJob(); + + } + 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 INPUT_FILES: + return isSetInputFiles(); + case OUTPUT_FILES: + return isSetOutputFiles(); + case JOB: + return isSetJob(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof createLineage_args) + return this.equals((createLineage_args)that); + return false; + } + + public boolean equals(createLineage_args that) { + if (that == null) + return false; + + boolean this_present_inputFiles = true && this.isSetInputFiles(); + boolean that_present_inputFiles = true && that.isSetInputFiles(); + if (this_present_inputFiles || that_present_inputFiles) { + if (!(this_present_inputFiles && that_present_inputFiles)) + return false; + if (!this.inputFiles.equals(that.inputFiles)) + return false; + } + + boolean this_present_outputFiles = true && this.isSetOutputFiles(); + boolean that_present_outputFiles = true && that.isSetOutputFiles(); + if (this_present_outputFiles || that_present_outputFiles) { + if (!(this_present_outputFiles && that_present_outputFiles)) + return false; + if (!this.outputFiles.equals(that.outputFiles)) + return false; + } + + boolean this_present_job = true && this.isSetJob(); + boolean that_present_job = true && that.isSetJob(); + if (this_present_job || that_present_job) { + if (!(this_present_job && that_present_job)) + return false; + if (!this.job.equals(that.job)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_inputFiles = true && (isSetInputFiles()); + list.add(present_inputFiles); + if (present_inputFiles) + list.add(inputFiles); + + boolean present_outputFiles = true && (isSetOutputFiles()); + list.add(present_outputFiles); + if (present_outputFiles) + list.add(outputFiles); + + boolean present_job = true && (isSetJob()); + list.add(present_job); + if (present_job) + list.add(job); + + return list.hashCode(); + } + + @Override + public int compareTo(createLineage_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetInputFiles()).compareTo(other.isSetInputFiles()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetInputFiles()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inputFiles, other.inputFiles); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOutputFiles()).compareTo(other.isSetOutputFiles()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOutputFiles()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.outputFiles, other.outputFiles); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetJob()).compareTo(other.isSetJob()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetJob()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.job, other.job); + 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("createLineage_args("); + boolean first = true; + + sb.append("inputFiles:"); + if (this.inputFiles == null) { + sb.append("null"); + } else { + sb.append(this.inputFiles); + } + first = false; + if (!first) sb.append(", "); + sb.append("outputFiles:"); + if (this.outputFiles == null) { + sb.append("null"); + } else { + sb.append(this.outputFiles); + } + first = false; + if (!first) sb.append(", "); + sb.append("job:"); + if (this.job == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.job, sb); + } + 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 createLineage_argsStandardSchemeFactory implements SchemeFactory { + public createLineage_argsStandardScheme getScheme() { + return new createLineage_argsStandardScheme(); + } + } + + private static class createLineage_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, createLineage_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: // INPUT_FILES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list188 = iprot.readListBegin(); + struct.inputFiles = new ArrayList(_list188.size); + long _elem189; + for (int _i190 = 0; _i190 < _list188.size; ++_i190) + { + _elem189 = iprot.readI64(); + struct.inputFiles.add(_elem189); + } + iprot.readListEnd(); + } + struct.setInputFilesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // OUTPUT_FILES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list191 = iprot.readListBegin(); + struct.outputFiles = new ArrayList(_list191.size); + long _elem192; + for (int _i193 = 0; _i193 < _list191.size; ++_i193) + { + _elem192 = iprot.readI64(); + struct.outputFiles.add(_elem192); + } + iprot.readListEnd(); + } + struct.setOutputFilesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // JOB + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.job = iprot.readBinary(); + struct.setJobIsSet(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, createLineage_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.inputFiles != null) { + oprot.writeFieldBegin(INPUT_FILES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.inputFiles.size())); + for (long _iter194 : struct.inputFiles) + { + oprot.writeI64(_iter194); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.outputFiles != null) { + oprot.writeFieldBegin(OUTPUT_FILES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.outputFiles.size())); + for (long _iter195 : struct.outputFiles) + { + oprot.writeI64(_iter195); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.job != null) { + oprot.writeFieldBegin(JOB_FIELD_DESC); + oprot.writeBinary(struct.job); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class createLineage_argsTupleSchemeFactory implements SchemeFactory { + public createLineage_argsTupleScheme getScheme() { + return new createLineage_argsTupleScheme(); + } + } + + private static class createLineage_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, createLineage_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetInputFiles()) { + optionals.set(0); + } + if (struct.isSetOutputFiles()) { + optionals.set(1); + } + if (struct.isSetJob()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetInputFiles()) { + { + oprot.writeI32(struct.inputFiles.size()); + for (long _iter196 : struct.inputFiles) + { + oprot.writeI64(_iter196); + } + } + } + if (struct.isSetOutputFiles()) { + { + oprot.writeI32(struct.outputFiles.size()); + for (long _iter197 : struct.outputFiles) + { + oprot.writeI64(_iter197); + } + } + } + if (struct.isSetJob()) { + oprot.writeBinary(struct.job); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, createLineage_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list198 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); + struct.inputFiles = new ArrayList(_list198.size); + long _elem199; + for (int _i200 = 0; _i200 < _list198.size; ++_i200) + { + _elem199 = iprot.readI64(); + struct.inputFiles.add(_elem199); + } + } + struct.setInputFilesIsSet(true); + } + if (incoming.get(1)) { + { + org.apache.thrift.protocol.TList _list201 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); + struct.outputFiles = new ArrayList(_list201.size); + long _elem202; + for (int _i203 = 0; _i203 < _list201.size; ++_i203) + { + _elem202 = iprot.readI64(); + struct.outputFiles.add(_elem202); + } + } + struct.setOutputFilesIsSet(true); + } + if (incoming.get(2)) { + struct.job = iprot.readBinary(); + struct.setJobIsSet(true); + } + } + } + + } + + public static class createLineage_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createLineage_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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new createLineage_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new createLineage_resultTupleSchemeFactory()); + } + + public long success; // 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"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + 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))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createLineage_result.class, metaDataMap); + } + + public createLineage_result() { + } + + public createLineage_result( + long success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public createLineage_result(createLineage_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public createLineage_result deepCopy() { + return new createLineage_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = 0; + } + + public long getSuccess() { + return this.success; + } + + public createLineage_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 void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Long.valueOf(getSuccess()); + + } + 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(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof createLineage_result) + return this.equals((createLineage_result)that); + return false; + } + + public boolean equals(createLineage_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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true; + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(createLineage_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; + } + } + 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("createLineage_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + 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 createLineage_resultStandardSchemeFactory implements SchemeFactory { + public createLineage_resultStandardScheme getScheme() { + return new createLineage_resultStandardScheme(); + } + } + + private static class createLineage_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, createLineage_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; + 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, createLineage_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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class createLineage_resultTupleSchemeFactory implements SchemeFactory { + public createLineage_resultTupleScheme getScheme() { + return new createLineage_resultTupleScheme(); + } + } + + private static class createLineage_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, createLineage_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeI64(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, createLineage_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class deleteLineage_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteLineage_args"); + + private static final org.apache.thrift.protocol.TField LINEAGE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("lineageId", org.apache.thrift.protocol.TType.I64, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteLineage_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteLineage_argsTupleSchemeFactory()); + } + + public long lineageId; // 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 { + LINEAGE_ID((short)1, "lineageId"); + + private static final Map byName = new HashMap(); + + 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: // LINEAGE_ID + return LINEAGE_ID; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __LINEAGEID_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.LINEAGE_ID, new org.apache.thrift.meta_data.FieldMetaData("lineageId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteLineage_args.class, metaDataMap); + } + + public deleteLineage_args() { + } + + public deleteLineage_args( + long lineageId) + { + this(); + this.lineageId = lineageId; + setLineageIdIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public deleteLineage_args(deleteLineage_args other) { + __isset_bitfield = other.__isset_bitfield; + this.lineageId = other.lineageId; + } + + public deleteLineage_args deepCopy() { + return new deleteLineage_args(this); + } + + @Override + public void clear() { + setLineageIdIsSet(false); + this.lineageId = 0; + } + + public long getLineageId() { + return this.lineageId; + } + + public deleteLineage_args setLineageId(long lineageId) { + this.lineageId = lineageId; + setLineageIdIsSet(true); + return this; + } + + public void unsetLineageId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LINEAGEID_ISSET_ID); + } + + /** Returns true if field lineageId is set (has been assigned a value) and false otherwise */ + public boolean isSetLineageId() { + return EncodingUtils.testBit(__isset_bitfield, __LINEAGEID_ISSET_ID); + } + + public void setLineageIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LINEAGEID_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case LINEAGE_ID: + if (value == null) { + unsetLineageId(); + } else { + setLineageId((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case LINEAGE_ID: + return Long.valueOf(getLineageId()); + + } + 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 LINEAGE_ID: + return isSetLineageId(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteLineage_args) + return this.equals((deleteLineage_args)that); + return false; + } + + public boolean equals(deleteLineage_args that) { + if (that == null) + return false; + + boolean this_present_lineageId = true; + boolean that_present_lineageId = true; + if (this_present_lineageId || that_present_lineageId) { + if (!(this_present_lineageId && that_present_lineageId)) + return false; + if (this.lineageId != that.lineageId) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_lineageId = true; + list.add(present_lineageId); + if (present_lineageId) + list.add(lineageId); + + return list.hashCode(); + } + + @Override + public int compareTo(deleteLineage_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetLineageId()).compareTo(other.isSetLineageId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLineageId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lineageId, other.lineageId); + 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("deleteLineage_args("); + boolean first = true; + + sb.append("lineageId:"); + sb.append(this.lineageId); + 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 deleteLineage_argsStandardSchemeFactory implements SchemeFactory { + public deleteLineage_argsStandardScheme getScheme() { + return new deleteLineage_argsStandardScheme(); + } + } + + private static class deleteLineage_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteLineage_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: // LINEAGE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.lineageId = iprot.readI64(); + struct.setLineageIdIsSet(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, deleteLineage_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(LINEAGE_ID_FIELD_DESC); + oprot.writeI64(struct.lineageId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteLineage_argsTupleSchemeFactory implements SchemeFactory { + public deleteLineage_argsTupleScheme getScheme() { + return new deleteLineage_argsTupleScheme(); + } + } + + private static class deleteLineage_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteLineage_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetLineageId()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetLineageId()) { + oprot.writeI64(struct.lineageId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteLineage_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.lineageId = iprot.readI64(); + struct.setLineageIdIsSet(true); + } + } + } + + } + + public static class deleteLineage_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteLineage_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteLineage_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteLineage_resultTupleSchemeFactory()); + } + + public boolean success; // 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"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteLineage_result.class, metaDataMap); + } + + public deleteLineage_result() { + } + + public deleteLineage_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public deleteLineage_result(deleteLineage_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public deleteLineage_result deepCopy() { + return new deleteLineage_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public deleteLineage_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + } + 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(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteLineage_result) + return this.equals((deleteLineage_result)that); + return false; + } + + public boolean equals(deleteLineage_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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true; + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(deleteLineage_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; + } + } + 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("deleteLineage_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + 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 deleteLineage_resultStandardSchemeFactory implements SchemeFactory { + public deleteLineage_resultStandardScheme getScheme() { + return new deleteLineage_resultStandardScheme(); + } + } + + private static class deleteLineage_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteLineage_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + 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, deleteLineage_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteLineage_resultTupleSchemeFactory implements SchemeFactory { + public deleteLineage_resultTupleScheme getScheme() { + return new deleteLineage_resultTupleScheme(); + } + } + + private static class deleteLineage_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteLineage_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteLineage_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + } + +} diff --git a/common/src/main/java/tachyon/thrift/NetAddress.java b/common/src/main/java/tachyon/thrift/NetAddress.java index 7504676e645b..8fb0af93cff0 100644 --- a/common/src/main/java/tachyon/thrift/NetAddress.java +++ b/common/src/main/java/tachyon/thrift/NetAddress.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class NetAddress implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("NetAddress"); diff --git a/common/src/main/java/tachyon/thrift/NoWorkerException.java b/common/src/main/java/tachyon/thrift/NoWorkerException.java index 9cbc94cc62a0..6989346c7cf9 100644 --- a/common/src/main/java/tachyon/thrift/NoWorkerException.java +++ b/common/src/main/java/tachyon/thrift/NoWorkerException.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class NoWorkerException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("NoWorkerException"); diff --git a/common/src/main/java/tachyon/thrift/OutOfSpaceException.java b/common/src/main/java/tachyon/thrift/OutOfSpaceException.java index 0c157f1f4070..31813fade16e 100644 --- a/common/src/main/java/tachyon/thrift/OutOfSpaceException.java +++ b/common/src/main/java/tachyon/thrift/OutOfSpaceException.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class OutOfSpaceException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OutOfSpaceException"); diff --git a/common/src/main/java/tachyon/thrift/RawTableInfo.java b/common/src/main/java/tachyon/thrift/RawTableInfo.java index f337d30ddb55..95790694b249 100644 --- a/common/src/main/java/tachyon/thrift/RawTableInfo.java +++ b/common/src/main/java/tachyon/thrift/RawTableInfo.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class RawTableInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RawTableInfo"); diff --git a/common/src/main/java/tachyon/thrift/RawTableMasterService.java b/common/src/main/java/tachyon/thrift/RawTableMasterService.java index 9d905d31e68b..b55d28ed677b 100644 --- a/common/src/main/java/tachyon/thrift/RawTableMasterService.java +++ b/common/src/main/java/tachyon/thrift/RawTableMasterService.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class RawTableMasterService { public interface Iface { diff --git a/common/src/main/java/tachyon/thrift/SuspectedFileSizeException.java b/common/src/main/java/tachyon/thrift/SuspectedFileSizeException.java index c05551e4c4ab..34ded84aba09 100644 --- a/common/src/main/java/tachyon/thrift/SuspectedFileSizeException.java +++ b/common/src/main/java/tachyon/thrift/SuspectedFileSizeException.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class SuspectedFileSizeException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SuspectedFileSizeException"); diff --git a/common/src/main/java/tachyon/thrift/TableColumnException.java b/common/src/main/java/tachyon/thrift/TableColumnException.java index acc30fea99c4..721959d93aa0 100644 --- a/common/src/main/java/tachyon/thrift/TableColumnException.java +++ b/common/src/main/java/tachyon/thrift/TableColumnException.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class TableColumnException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TableColumnException"); diff --git a/common/src/main/java/tachyon/thrift/TableDoesNotExistException.java b/common/src/main/java/tachyon/thrift/TableDoesNotExistException.java index 03d2dfadec94..61b7e166792a 100644 --- a/common/src/main/java/tachyon/thrift/TableDoesNotExistException.java +++ b/common/src/main/java/tachyon/thrift/TableDoesNotExistException.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class TableDoesNotExistException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TableDoesNotExistException"); diff --git a/common/src/main/java/tachyon/thrift/TachyonException.java b/common/src/main/java/tachyon/thrift/TachyonException.java index a0c87a5816cf..b4146faa6d8c 100644 --- a/common/src/main/java/tachyon/thrift/TachyonException.java +++ b/common/src/main/java/tachyon/thrift/TachyonException.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class TachyonException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TachyonException"); diff --git a/common/src/main/java/tachyon/thrift/WorkerInfo.java b/common/src/main/java/tachyon/thrift/WorkerInfo.java index d4c4c8ab5fff..9bba22cb8105 100644 --- a/common/src/main/java/tachyon/thrift/WorkerInfo.java +++ b/common/src/main/java/tachyon/thrift/WorkerInfo.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class WorkerInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WorkerInfo"); diff --git a/common/src/main/java/tachyon/thrift/WorkerService.java b/common/src/main/java/tachyon/thrift/WorkerService.java index c42dcef5b972..e5a67d3f50d3 100644 --- a/common/src/main/java/tachyon/thrift/WorkerService.java +++ b/common/src/main/java/tachyon/thrift/WorkerService.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-12") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-9-15") public class WorkerService { public interface Iface { @@ -11883,13 +11883,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, sessionHeartbeat_ar case 2: // METRICS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list188 = iprot.readListBegin(); - struct.metrics = new ArrayList(_list188.size); - long _elem189; - for (int _i190 = 0; _i190 < _list188.size; ++_i190) + org.apache.thrift.protocol.TList _list204 = iprot.readListBegin(); + struct.metrics = new ArrayList(_list204.size); + long _elem205; + for (int _i206 = 0; _i206 < _list204.size; ++_i206) { - _elem189 = iprot.readI64(); - struct.metrics.add(_elem189); + _elem205 = iprot.readI64(); + struct.metrics.add(_elem205); } iprot.readListEnd(); } @@ -11920,9 +11920,9 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, sessionHeartbeat_a oprot.writeFieldBegin(METRICS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.metrics.size())); - for (long _iter191 : struct.metrics) + for (long _iter207 : struct.metrics) { - oprot.writeI64(_iter191); + oprot.writeI64(_iter207); } oprot.writeListEnd(); } @@ -11959,9 +11959,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, sessionHeartbeat_ar if (struct.isSetMetrics()) { { oprot.writeI32(struct.metrics.size()); - for (long _iter192 : struct.metrics) + for (long _iter208 : struct.metrics) { - oprot.writeI64(_iter192); + oprot.writeI64(_iter208); } } } @@ -11977,13 +11977,13 @@ public void read(org.apache.thrift.protocol.TProtocol prot, sessionHeartbeat_arg } if (incoming.get(1)) { { - org.apache.thrift.protocol.TList _list193 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); - struct.metrics = new ArrayList(_list193.size); - long _elem194; - for (int _i195 = 0; _i195 < _list193.size; ++_i195) + org.apache.thrift.protocol.TList _list209 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); + struct.metrics = new ArrayList(_list209.size); + long _elem210; + for (int _i211 = 0; _i211 < _list209.size; ++_i211) { - _elem194 = iprot.readI64(); - struct.metrics.add(_elem194); + _elem210 = iprot.readI64(); + struct.metrics.add(_elem210); } } struct.setMetricsIsSet(true); diff --git a/common/src/thrift/tachyon.thrift b/common/src/thrift/tachyon.thrift index 269777fe4e4c..39cf83369255 100644 --- a/common/src/thrift/tachyon.thrift +++ b/common/src/thrift/tachyon.thrift @@ -245,6 +245,12 @@ service FileSystemMasterService { throws (1: DependencyDoesNotExistException ddnee) } +service LineageMasterService { + i64 createLineage(1: list inputFiles, 2: list outputFiles, 3: binary job) + + bool deleteLineage(1: i64 lineageId) +} + service RawTableMasterService { i64 createRawTable(1: string path, 2: i32 columns, 3: binary metadata) throws (1: FileAlreadyExistException faee, 2: InvalidPathException ipe, 3: TableColumnException tce, diff --git a/servers/src/main/java/tachyon/master/lineage/LineageMaster.java b/servers/src/main/java/tachyon/master/lineage/LineageMaster.java index ef3b54660b23..f668cb150342 100644 --- a/servers/src/main/java/tachyon/master/lineage/LineageMaster.java +++ b/servers/src/main/java/tachyon/master/lineage/LineageMaster.java @@ -15,10 +15,65 @@ package tachyon.master.lineage; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.Executors; + +import org.apache.thrift.TProcessor; + +import tachyon.Constants; +import tachyon.client.file.TachyonFile; +import tachyon.job.Job; +import tachyon.master.MasterBase; +import tachyon.master.journal.Journal; +import tachyon.master.journal.JournalEntry; +import tachyon.master.journal.JournalOutputStream; +import tachyon.master.lineage.meta.LineageStore; +import tachyon.thrift.LineageMasterService; +import tachyon.util.ThreadFactoryUtils; + /** * The lineage master stores the lineage metadata in Tachyon, and it contains the components that * manage all lineage-related activities. */ -public final class LineageMaster { +public final class LineageMaster extends MasterBase { + private final LineageStore mLineageStore; + + public LineageMaster(Journal journal) { + super(journal, + Executors.newFixedThreadPool(2, ThreadFactoryUtils.build("file-system-master-%d", true))); + + mLineageStore = new LineageStore(); + } + + @Override + public TProcessor getProcessor() { + return new LineageMasterService.Processor( + new LineageMasterServiceHandler(this)); + } + + @Override + public String getServiceName() { + return Constants.LINEAGE_MASTER_SERVICE_NAME; + } + + @Override + public void processJournalEntry(JournalEntry entry) throws IOException { + // TODO add journal support + } + + @Override + public void streamToJournalCheckpoint(JournalOutputStream outputStream) throws IOException { + // TODO add journal support + } + + public long createLineage(List inputFiles, List outputFiles, Job job) { + // TODO create lineage + return -1; + } + public boolean deleteLineage(long lineageId) { + // TODO delete lineage + return false; + } } diff --git a/servers/src/main/java/tachyon/master/lineage/LineageMasterServiceHandler.java b/servers/src/main/java/tachyon/master/lineage/LineageMasterServiceHandler.java new file mode 100644 index 000000000000..972844f35883 --- /dev/null +++ b/servers/src/main/java/tachyon/master/lineage/LineageMasterServiceHandler.java @@ -0,0 +1,48 @@ +/* + * Licensed to the University of California, Berkeley under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package tachyon.master.lineage; + +import java.nio.ByteBuffer; +import java.util.List; + +import org.apache.thrift.TException; + +import com.google.common.collect.Lists; + +import tachyon.client.file.TachyonFile; +import tachyon.thrift.LineageMasterService.Iface; + +public final class LineageMasterServiceHandler implements Iface { + private final LineageMaster mLineageMaster; + + public LineageMasterServiceHandler(LineageMaster lineageMaster) { + mLineageMaster = lineageMaster; + } + + @Override + public long createLineage(List inputFiles, List outputFiles, ByteBuffer job) + throws TException { + List inputTachyonFiles = Lists.newArrayList(); + List outputTachyonFiles = Lists.newArrayList(); + return mLineageMaster.createLineage(inputTachyonFiles, outputTachyonFiles, null); + } + + @Override + public boolean deleteLineage(long lineageId) throws TException { + return mLineageMaster.deleteLineage(lineageId); + } + +}