Generated code changes.
Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/25ad5d45 Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/25ad5d45 Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/25ad5d45 Branch: refs/heads/master Commit: 25ad5d454f0b6f68c14cee9eb00ba31c4f6cf51c Parents: 4071c93 Author: Aaron McCurry <[email protected]> Authored: Mon Dec 15 10:36:50 2014 -0500 Committer: Aaron McCurry <[email protected]> Committed: Mon Dec 15 10:36:50 2014 -0500 ---------------------------------------------------------------------- .../org/apache/blur/thrift/generated/Blur.java | 929 +++++++++++++++++++ .../blur/thrift/generated/SafeClientGen.java | 21 + .../main/scripts/interface/gen-html/Blur.html | 11 + .../main/scripts/interface/gen-html/index.html | 1 + .../org/apache/blur/thrift/generated/Blur.java | 929 +++++++++++++++++++ .../src/main/scripts/interface/gen-js/Blur.js | 159 ++++ .../scripts/interface/gen-perl/Blur/Blur.pm | 223 +++++ .../src/main/scripts/interface/gen-rb/blur.rb | 62 ++ 8 files changed, 2335 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/25ad5d45/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Blur.java ---------------------------------------------------------------------- diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Blur.java b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Blur.java index 746f338..437885f 100644 --- a/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Blur.java +++ b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Blur.java @@ -270,6 +270,15 @@ public class Blur { public List<FetchResult> fetchRowBatch(String table, List<Selector> selectors) throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException; /** + * Loads data from external location. + * + * @param table The table name. + * + * @param location Location of bulk data load. + */ + public void loadData(String table, String location) throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException; + + /** * Mutates a Row given the RowMutation that is provided. * * @param mutation the RowMutation. @@ -546,6 +555,8 @@ public class Blur { public void fetchRowBatch(String table, List<Selector> selectors, org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback<AsyncClient.fetchRowBatch_call> resultHandler) throws org.apache.blur.thirdparty.thrift_0_9_0.TException; + public void loadData(String table, String location, org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback<AsyncClient.loadData_call> resultHandler) throws org.apache.blur.thirdparty.thrift_0_9_0.TException; + public void mutate(RowMutation mutation, org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback<AsyncClient.mutate_call> resultHandler) throws org.apache.blur.thirdparty.thrift_0_9_0.TException; public void enqueueMutate(RowMutation mutation, org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback<AsyncClient.enqueueMutate_call> resultHandler) throws org.apache.blur.thirdparty.thrift_0_9_0.TException; @@ -1257,6 +1268,30 @@ public class Blur { throw new org.apache.blur.thirdparty.thrift_0_9_0.TApplicationException(org.apache.blur.thirdparty.thrift_0_9_0.TApplicationException.MISSING_RESULT, "fetchRowBatch failed: unknown result"); } + public void loadData(String table, String location) throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException + { + send_loadData(table, location); + recv_loadData(); + } + + public void send_loadData(String table, String location) throws org.apache.blur.thirdparty.thrift_0_9_0.TException + { + loadData_args args = new loadData_args(); + args.setTable(table); + args.setLocation(location); + sendBase("loadData", args); + } + + public void recv_loadData() throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException + { + loadData_result result = new loadData_result(); + receiveBase(result, "loadData"); + if (result.ex != null) { + throw result.ex; + } + return; + } + public void mutate(RowMutation mutation) throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException { send_mutate(mutation); @@ -2744,6 +2779,41 @@ public class Blur { } } + public void loadData(String table, String location, org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback<loadData_call> resultHandler) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + checkReady(); + loadData_call method_call = new loadData_call(table, location, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class loadData_call extends org.apache.blur.thirdparty.thrift_0_9_0.async.TAsyncMethodCall { + private String table; + private String location; + public loadData_call(String table, String location, org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback<loadData_call> resultHandler, org.apache.blur.thirdparty.thrift_0_9_0.async.TAsyncClient client, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolFactory protocolFactory, org.apache.blur.thirdparty.thrift_0_9_0.transport.TNonblockingTransport transport) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.table = table; + this.location = location; + } + + public void write_args(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + prot.writeMessageBegin(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMessage("loadData", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMessageType.CALL, 0)); + loadData_args args = new loadData_args(); + args.setTable(table); + args.setLocation(location); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException { + if (getState() != org.apache.blur.thirdparty.thrift_0_9_0.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.blur.thirdparty.thrift_0_9_0.transport.TMemoryInputTransport memoryTransport = new org.apache.blur.thirdparty.thrift_0_9_0.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_loadData(); + } + } + public void mutate(RowMutation mutation, org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback<mutate_call> resultHandler) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { checkReady(); mutate_call method_call = new mutate_call(mutation, resultHandler, this, ___protocolFactory, ___transport); @@ -3600,6 +3670,7 @@ public class Blur { processMap.put("query", new query()); processMap.put("fetchRow", new fetchRow()); processMap.put("fetchRowBatch", new fetchRowBatch()); + processMap.put("loadData", new loadData()); processMap.put("mutate", new mutate()); processMap.put("enqueueMutate", new enqueueMutate()); processMap.put("mutateBatch", new mutateBatch()); @@ -4247,6 +4318,30 @@ public class Blur { } } + public static class loadData<I extends Iface> extends org.apache.blur.thirdparty.thrift_0_9_0.ProcessFunction<I, loadData_args> { + public loadData() { + super("loadData"); + } + + public loadData_args getEmptyArgsInstance() { + return new loadData_args(); + } + + protected boolean isOneway() { + return false; + } + + public loadData_result getResult(I iface, loadData_args args) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + loadData_result result = new loadData_result(); + try { + iface.loadData(args.table, args.location); + } catch (BlurException ex) { + result.ex = ex; + } + return result; + } + } + public static class mutate<I extends Iface> extends org.apache.blur.thirdparty.thrift_0_9_0.ProcessFunction<I, mutate_args> { public mutate() { super("mutate"); @@ -26022,6 +26117,840 @@ public class Blur { } + public static class loadData_args implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<loadData_args, loadData_args._Fields>, java.io.Serializable, Cloneable { + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct STRUCT_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct("loadData_args"); + + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField TABLE_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("table", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, (short)1); + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField LOCATION_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("location", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, (short)2); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new loadData_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new loadData_argsTupleSchemeFactory()); + } + + /** + * The table name. + */ + public String table; // required + /** + * Location of bulk data load. + */ + public String location; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.blur.thirdparty.thrift_0_9_0.TFieldIdEnum { + /** + * The table name. + */ + TABLE((short)1, "table"), + /** + * Location of bulk data load. + */ + LOCATION((short)2, "location"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // TABLE + return TABLE; + case 2: // LOCATION + return LOCATION; + 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.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TABLE, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("table", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, + new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING))); + tmpMap.put(_Fields.LOCATION, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("location", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, + new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData.addStructMetaDataMap(loadData_args.class, metaDataMap); + } + + public loadData_args() { + } + + public loadData_args( + String table, + String location) + { + this(); + this.table = table; + this.location = location; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public loadData_args(loadData_args other) { + if (other.isSetTable()) { + this.table = other.table; + } + if (other.isSetLocation()) { + this.location = other.location; + } + } + + public loadData_args deepCopy() { + return new loadData_args(this); + } + + @Override + public void clear() { + this.table = null; + this.location = null; + } + + /** + * The table name. + */ + public String getTable() { + return this.table; + } + + /** + * The table name. + */ + public loadData_args setTable(String table) { + this.table = table; + return this; + } + + public void unsetTable() { + this.table = null; + } + + /** Returns true if field table is set (has been assigned a value) and false otherwise */ + public boolean isSetTable() { + return this.table != null; + } + + public void setTableIsSet(boolean value) { + if (!value) { + this.table = null; + } + } + + /** + * Location of bulk data load. + */ + public String getLocation() { + return this.location; + } + + /** + * Location of bulk data load. + */ + public loadData_args setLocation(String location) { + this.location = location; + return this; + } + + public void unsetLocation() { + this.location = null; + } + + /** Returns true if field location is set (has been assigned a value) and false otherwise */ + public boolean isSetLocation() { + return this.location != null; + } + + public void setLocationIsSet(boolean value) { + if (!value) { + this.location = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((String)value); + } + break; + + case LOCATION: + if (value == null) { + unsetLocation(); + } else { + setLocation((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE: + return getTable(); + + case LOCATION: + return getLocation(); + + } + 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 TABLE: + return isSetTable(); + case LOCATION: + return isSetLocation(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof loadData_args) + return this.equals((loadData_args)that); + return false; + } + + public boolean equals(loadData_args that) { + if (that == null) + return false; + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_location = true && this.isSetLocation(); + boolean that_present_location = true && that.isSetLocation(); + if (this_present_location || that_present_location) { + if (!(this_present_location && that_present_location)) + return false; + if (!this.location.equals(that.location)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(loadData_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + loadData_args typedOther = (loadData_args)other; + + lastComparison = Boolean.valueOf(isSetTable()).compareTo(typedOther.isSetTable()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTable()) { + lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.table, typedOther.table); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLocation()).compareTo(typedOther.isSetLocation()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLocation()) { + lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.location, typedOther.location); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("loadData_args("); + boolean first = true; + + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + sb.append(this.table); + } + first = false; + if (!first) sb.append(", "); + sb.append("location:"); + if (this.location == null) { + sb.append("null"); + } else { + sb.append(this.location); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.blur.thirdparty.thrift_0_9_0.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.blur.thirdparty.thrift_0_9_0.protocol.TCompactProtocol(new org.apache.blur.thirdparty.thrift_0_9_0.transport.TIOStreamTransport(out))); + } catch (org.apache.blur.thirdparty.thrift_0_9_0.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.blur.thirdparty.thrift_0_9_0.protocol.TCompactProtocol(new org.apache.blur.thirdparty.thrift_0_9_0.transport.TIOStreamTransport(in))); + } catch (org.apache.blur.thirdparty.thrift_0_9_0.TException te) { + throw new java.io.IOException(te); + } + } + + private static class loadData_argsStandardSchemeFactory implements SchemeFactory { + public loadData_argsStandardScheme getScheme() { + return new loadData_argsStandardScheme(); + } + } + + private static class loadData_argsStandardScheme extends StandardScheme<loadData_args> { + + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot, loadData_args struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // TABLE + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING) { + struct.table = iprot.readString(); + struct.setTableIsSet(true); + } else { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // LOCATION + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING) { + struct.location = iprot.readString(); + struct.setLocationIsSet(true); + } else { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.blur.thirdparty.thrift_0_9_0.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.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot, loadData_args struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + oprot.writeString(struct.table); + oprot.writeFieldEnd(); + } + if (struct.location != null) { + oprot.writeFieldBegin(LOCATION_FIELD_DESC); + oprot.writeString(struct.location); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class loadData_argsTupleSchemeFactory implements SchemeFactory { + public loadData_argsTupleScheme getScheme() { + return new loadData_argsTupleScheme(); + } + } + + private static class loadData_argsTupleScheme extends TupleScheme<loadData_args> { + + @Override + public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, loadData_args struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTable()) { + optionals.set(0); + } + if (struct.isSetLocation()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetTable()) { + oprot.writeString(struct.table); + } + if (struct.isSetLocation()) { + oprot.writeString(struct.location); + } + } + + @Override + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, loadData_args struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.table = iprot.readString(); + struct.setTableIsSet(true); + } + if (incoming.get(1)) { + struct.location = iprot.readString(); + struct.setLocationIsSet(true); + } + } + } + + } + + public static class loadData_result implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<loadData_result, loadData_result._Fields>, java.io.Serializable, Cloneable { + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct STRUCT_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct("loadData_result"); + + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField EX_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("ex", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, (short)1); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new loadData_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new loadData_resultTupleSchemeFactory()); + } + + public BlurException ex; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.blur.thirdparty.thrift_0_9_0.TFieldIdEnum { + EX((short)1, "ex"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // EX + return EX; + 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.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.EX, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("ex", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, + new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData.addStructMetaDataMap(loadData_result.class, metaDataMap); + } + + public loadData_result() { + } + + public loadData_result( + BlurException ex) + { + this(); + this.ex = ex; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public loadData_result(loadData_result other) { + if (other.isSetEx()) { + this.ex = new BlurException(other.ex); + } + } + + public loadData_result deepCopy() { + return new loadData_result(this); + } + + @Override + public void clear() { + this.ex = null; + } + + public BlurException getEx() { + return this.ex; + } + + public loadData_result setEx(BlurException ex) { + this.ex = ex; + return this; + } + + public void unsetEx() { + this.ex = null; + } + + /** Returns true if field ex is set (has been assigned a value) and false otherwise */ + public boolean isSetEx() { + return this.ex != null; + } + + public void setExIsSet(boolean value) { + if (!value) { + this.ex = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case EX: + if (value == null) { + unsetEx(); + } else { + setEx((BlurException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case EX: + return getEx(); + + } + 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 EX: + return isSetEx(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof loadData_result) + return this.equals((loadData_result)that); + return false; + } + + public boolean equals(loadData_result that) { + if (that == null) + return false; + + boolean this_present_ex = true && this.isSetEx(); + boolean that_present_ex = true && that.isSetEx(); + if (this_present_ex || that_present_ex) { + if (!(this_present_ex && that_present_ex)) + return false; + if (!this.ex.equals(that.ex)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(loadData_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + loadData_result typedOther = (loadData_result)other; + + lastComparison = Boolean.valueOf(isSetEx()).compareTo(typedOther.isSetEx()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx()) { + lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.ex, typedOther.ex); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("loadData_result("); + boolean first = true; + + sb.append("ex:"); + if (this.ex == null) { + sb.append("null"); + } else { + sb.append(this.ex); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.blur.thirdparty.thrift_0_9_0.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.blur.thirdparty.thrift_0_9_0.protocol.TCompactProtocol(new org.apache.blur.thirdparty.thrift_0_9_0.transport.TIOStreamTransport(out))); + } catch (org.apache.blur.thirdparty.thrift_0_9_0.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.blur.thirdparty.thrift_0_9_0.protocol.TCompactProtocol(new org.apache.blur.thirdparty.thrift_0_9_0.transport.TIOStreamTransport(in))); + } catch (org.apache.blur.thirdparty.thrift_0_9_0.TException te) { + throw new java.io.IOException(te); + } + } + + private static class loadData_resultStandardSchemeFactory implements SchemeFactory { + public loadData_resultStandardScheme getScheme() { + return new loadData_resultStandardScheme(); + } + } + + private static class loadData_resultStandardScheme extends StandardScheme<loadData_result> { + + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot, loadData_result struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // EX + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT) { + struct.ex = new BlurException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } else { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.blur.thirdparty.thrift_0_9_0.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.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot, loadData_result struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.ex != null) { + oprot.writeFieldBegin(EX_FIELD_DESC); + struct.ex.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class loadData_resultTupleSchemeFactory implements SchemeFactory { + public loadData_resultTupleScheme getScheme() { + return new loadData_resultTupleScheme(); + } + } + + private static class loadData_resultTupleScheme extends TupleScheme<loadData_result> { + + @Override + public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, loadData_result struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetEx()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetEx()) { + struct.ex.write(oprot); + } + } + + @Override + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, loadData_result struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.ex = new BlurException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } + } + } + + } + public static class mutate_args implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<mutate_args, mutate_args._Fields>, java.io.Serializable, Cloneable { private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct STRUCT_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct("mutate_args"); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/25ad5d45/blur-thrift/src/main/java/org/apache/blur/thrift/generated/SafeClientGen.java ---------------------------------------------------------------------- diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/generated/SafeClientGen.java b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/SafeClientGen.java index 69562f6..ed1a526 100644 --- a/blur-thrift/src/main/java/org/apache/blur/thrift/generated/SafeClientGen.java +++ b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/SafeClientGen.java @@ -202,6 +202,13 @@ public java.util.Map listSnapshots(java.lang.String arg0) throws org.apache.blur } @Override +public void loadData(java.lang.String arg0, java.lang.String arg1) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException { + _lock.errorFailLock(); try { + super.loadData(arg0, arg1); + } finally {_lock.unlock();} +} + +@Override public void logging(java.lang.String arg0, org.apache.blur.thrift.generated.Level arg1) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException { _lock.errorFailLock(); try { super.logging(arg0, arg1); @@ -426,6 +433,13 @@ public java.util.Map recv_listSnapshots() throws org.apache.blur.thrift.generate } @Override +public void recv_loadData() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException { + _lock.errorFailLock(); try { + super.recv_loadData(); + } finally {_lock.unlock();} +} + +@Override public void recv_logging() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException { _lock.errorFailLock(); try { super.recv_logging(); @@ -797,6 +811,13 @@ public void send_listSnapshots(java.lang.String arg0) throws org.apache.blur.thi } @Override +public void send_loadData(java.lang.String arg0, java.lang.String arg1) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + _lock.errorFailLock(); try { + super.send_loadData(arg0, arg1); + } finally {_lock.unlock();} +} + +@Override public void send_logging(java.lang.String arg0, org.apache.blur.thrift.generated.Level arg1) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { _lock.errorFailLock(); try { super.send_logging(arg0, arg1); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/25ad5d45/distribution/src/main/scripts/interface/gen-html/Blur.html ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/interface/gen-html/Blur.html b/distribution/src/main/scripts/interface/gen-html/Blur.html index 0ce3345..cffe15c 100644 --- a/distribution/src/main/scripts/interface/gen-html/Blur.html +++ b/distribution/src/main/scripts/interface/gen-html/Blur.html @@ -31,6 +31,7 @@ <li><a href="Blur.html#Fn_Blur_isInSafeMode">isInSafeMode</a></li> <li><a href="Blur.html#Fn_Blur_listInstalledCommands">listInstalledCommands</a></li> <li><a href="Blur.html#Fn_Blur_listSnapshots">listSnapshots</a></li> +<li><a href="Blur.html#Fn_Blur_loadData">loadData</a></li> <li><a href="Blur.html#Fn_Blur_logging">logging</a></li> <li><a href="Blur.html#Fn_Blur_metrics">metrics</a></li> <li><a href="Blur.html#Fn_Blur_mutate">mutate</a></li> @@ -862,6 +863,16 @@ the shard server, if any. </td></tr> <tr><td>selectors</td><td>the Selector to use to fetch the Row or Record. </td></tr> +</table></div><div class="definition"><h4 id="Fn_Blur_loadData">Function: Blur.loadData</h4> +<pre><code>void</code> loadData(<code>string</code> table, + <code>string</code> location) + throws <code><a href="Blur.html#Struct_BlurException">BlurException</a></code> +</pre>Loads data from external location. +<br/><br/><h4 id="Parameters_Blur_loadData">Parameters</h4> +<table class="table-bordered table-striped table-condensed"><thead><th>Name</th><th>Description</th></thead><tr><td>table</td><td>The table name. +</td></tr> +<tr><td>location</td><td>Location of bulk data load. +</td></tr> </table></div><div class="definition"><h4 id="Fn_Blur_mutate">Function: Blur.mutate</h4> <pre><code>void</code> mutate(<code><a href="Blur.html#Struct_RowMutation">RowMutation</a></code> mutation) throws <code><a href="Blur.html#Struct_BlurException">BlurException</a></code> http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/25ad5d45/distribution/src/main/scripts/interface/gen-html/index.html ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/interface/gen-html/index.html b/distribution/src/main/scripts/interface/gen-html/index.html index 7420d36..794f4ef 100644 --- a/distribution/src/main/scripts/interface/gen-html/index.html +++ b/distribution/src/main/scripts/interface/gen-html/index.html @@ -27,6 +27,7 @@ <li><a href="Blur.html#Fn_Blur_isInSafeMode">isInSafeMode</a></li> <li><a href="Blur.html#Fn_Blur_listInstalledCommands">listInstalledCommands</a></li> <li><a href="Blur.html#Fn_Blur_listSnapshots">listSnapshots</a></li> +<li><a href="Blur.html#Fn_Blur_loadData">loadData</a></li> <li><a href="Blur.html#Fn_Blur_logging">logging</a></li> <li><a href="Blur.html#Fn_Blur_metrics">metrics</a></li> <li><a href="Blur.html#Fn_Blur_mutate">mutate</a></li> http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/25ad5d45/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/Blur.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/Blur.java b/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/Blur.java index 746f338..437885f 100644 --- a/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/Blur.java +++ b/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/Blur.java @@ -270,6 +270,15 @@ public class Blur { public List<FetchResult> fetchRowBatch(String table, List<Selector> selectors) throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException; /** + * Loads data from external location. + * + * @param table The table name. + * + * @param location Location of bulk data load. + */ + public void loadData(String table, String location) throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException; + + /** * Mutates a Row given the RowMutation that is provided. * * @param mutation the RowMutation. @@ -546,6 +555,8 @@ public class Blur { public void fetchRowBatch(String table, List<Selector> selectors, org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback<AsyncClient.fetchRowBatch_call> resultHandler) throws org.apache.blur.thirdparty.thrift_0_9_0.TException; + public void loadData(String table, String location, org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback<AsyncClient.loadData_call> resultHandler) throws org.apache.blur.thirdparty.thrift_0_9_0.TException; + public void mutate(RowMutation mutation, org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback<AsyncClient.mutate_call> resultHandler) throws org.apache.blur.thirdparty.thrift_0_9_0.TException; public void enqueueMutate(RowMutation mutation, org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback<AsyncClient.enqueueMutate_call> resultHandler) throws org.apache.blur.thirdparty.thrift_0_9_0.TException; @@ -1257,6 +1268,30 @@ public class Blur { throw new org.apache.blur.thirdparty.thrift_0_9_0.TApplicationException(org.apache.blur.thirdparty.thrift_0_9_0.TApplicationException.MISSING_RESULT, "fetchRowBatch failed: unknown result"); } + public void loadData(String table, String location) throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException + { + send_loadData(table, location); + recv_loadData(); + } + + public void send_loadData(String table, String location) throws org.apache.blur.thirdparty.thrift_0_9_0.TException + { + loadData_args args = new loadData_args(); + args.setTable(table); + args.setLocation(location); + sendBase("loadData", args); + } + + public void recv_loadData() throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException + { + loadData_result result = new loadData_result(); + receiveBase(result, "loadData"); + if (result.ex != null) { + throw result.ex; + } + return; + } + public void mutate(RowMutation mutation) throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException { send_mutate(mutation); @@ -2744,6 +2779,41 @@ public class Blur { } } + public void loadData(String table, String location, org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback<loadData_call> resultHandler) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + checkReady(); + loadData_call method_call = new loadData_call(table, location, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class loadData_call extends org.apache.blur.thirdparty.thrift_0_9_0.async.TAsyncMethodCall { + private String table; + private String location; + public loadData_call(String table, String location, org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback<loadData_call> resultHandler, org.apache.blur.thirdparty.thrift_0_9_0.async.TAsyncClient client, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolFactory protocolFactory, org.apache.blur.thirdparty.thrift_0_9_0.transport.TNonblockingTransport transport) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.table = table; + this.location = location; + } + + public void write_args(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + prot.writeMessageBegin(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMessage("loadData", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMessageType.CALL, 0)); + loadData_args args = new loadData_args(); + args.setTable(table); + args.setLocation(location); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException { + if (getState() != org.apache.blur.thirdparty.thrift_0_9_0.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.blur.thirdparty.thrift_0_9_0.transport.TMemoryInputTransport memoryTransport = new org.apache.blur.thirdparty.thrift_0_9_0.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_loadData(); + } + } + public void mutate(RowMutation mutation, org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback<mutate_call> resultHandler) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { checkReady(); mutate_call method_call = new mutate_call(mutation, resultHandler, this, ___protocolFactory, ___transport); @@ -3600,6 +3670,7 @@ public class Blur { processMap.put("query", new query()); processMap.put("fetchRow", new fetchRow()); processMap.put("fetchRowBatch", new fetchRowBatch()); + processMap.put("loadData", new loadData()); processMap.put("mutate", new mutate()); processMap.put("enqueueMutate", new enqueueMutate()); processMap.put("mutateBatch", new mutateBatch()); @@ -4247,6 +4318,30 @@ public class Blur { } } + public static class loadData<I extends Iface> extends org.apache.blur.thirdparty.thrift_0_9_0.ProcessFunction<I, loadData_args> { + public loadData() { + super("loadData"); + } + + public loadData_args getEmptyArgsInstance() { + return new loadData_args(); + } + + protected boolean isOneway() { + return false; + } + + public loadData_result getResult(I iface, loadData_args args) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + loadData_result result = new loadData_result(); + try { + iface.loadData(args.table, args.location); + } catch (BlurException ex) { + result.ex = ex; + } + return result; + } + } + public static class mutate<I extends Iface> extends org.apache.blur.thirdparty.thrift_0_9_0.ProcessFunction<I, mutate_args> { public mutate() { super("mutate"); @@ -26022,6 +26117,840 @@ public class Blur { } + public static class loadData_args implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<loadData_args, loadData_args._Fields>, java.io.Serializable, Cloneable { + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct STRUCT_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct("loadData_args"); + + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField TABLE_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("table", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, (short)1); + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField LOCATION_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("location", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, (short)2); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new loadData_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new loadData_argsTupleSchemeFactory()); + } + + /** + * The table name. + */ + public String table; // required + /** + * Location of bulk data load. + */ + public String location; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.blur.thirdparty.thrift_0_9_0.TFieldIdEnum { + /** + * The table name. + */ + TABLE((short)1, "table"), + /** + * Location of bulk data load. + */ + LOCATION((short)2, "location"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // TABLE + return TABLE; + case 2: // LOCATION + return LOCATION; + 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.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TABLE, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("table", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, + new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING))); + tmpMap.put(_Fields.LOCATION, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("location", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, + new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData.addStructMetaDataMap(loadData_args.class, metaDataMap); + } + + public loadData_args() { + } + + public loadData_args( + String table, + String location) + { + this(); + this.table = table; + this.location = location; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public loadData_args(loadData_args other) { + if (other.isSetTable()) { + this.table = other.table; + } + if (other.isSetLocation()) { + this.location = other.location; + } + } + + public loadData_args deepCopy() { + return new loadData_args(this); + } + + @Override + public void clear() { + this.table = null; + this.location = null; + } + + /** + * The table name. + */ + public String getTable() { + return this.table; + } + + /** + * The table name. + */ + public loadData_args setTable(String table) { + this.table = table; + return this; + } + + public void unsetTable() { + this.table = null; + } + + /** Returns true if field table is set (has been assigned a value) and false otherwise */ + public boolean isSetTable() { + return this.table != null; + } + + public void setTableIsSet(boolean value) { + if (!value) { + this.table = null; + } + } + + /** + * Location of bulk data load. + */ + public String getLocation() { + return this.location; + } + + /** + * Location of bulk data load. + */ + public loadData_args setLocation(String location) { + this.location = location; + return this; + } + + public void unsetLocation() { + this.location = null; + } + + /** Returns true if field location is set (has been assigned a value) and false otherwise */ + public boolean isSetLocation() { + return this.location != null; + } + + public void setLocationIsSet(boolean value) { + if (!value) { + this.location = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((String)value); + } + break; + + case LOCATION: + if (value == null) { + unsetLocation(); + } else { + setLocation((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TABLE: + return getTable(); + + case LOCATION: + return getLocation(); + + } + 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 TABLE: + return isSetTable(); + case LOCATION: + return isSetLocation(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof loadData_args) + return this.equals((loadData_args)that); + return false; + } + + public boolean equals(loadData_args that) { + if (that == null) + return false; + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_location = true && this.isSetLocation(); + boolean that_present_location = true && that.isSetLocation(); + if (this_present_location || that_present_location) { + if (!(this_present_location && that_present_location)) + return false; + if (!this.location.equals(that.location)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(loadData_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + loadData_args typedOther = (loadData_args)other; + + lastComparison = Boolean.valueOf(isSetTable()).compareTo(typedOther.isSetTable()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTable()) { + lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.table, typedOther.table); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLocation()).compareTo(typedOther.isSetLocation()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLocation()) { + lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.location, typedOther.location); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("loadData_args("); + boolean first = true; + + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + sb.append(this.table); + } + first = false; + if (!first) sb.append(", "); + sb.append("location:"); + if (this.location == null) { + sb.append("null"); + } else { + sb.append(this.location); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.blur.thirdparty.thrift_0_9_0.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.blur.thirdparty.thrift_0_9_0.protocol.TCompactProtocol(new org.apache.blur.thirdparty.thrift_0_9_0.transport.TIOStreamTransport(out))); + } catch (org.apache.blur.thirdparty.thrift_0_9_0.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.blur.thirdparty.thrift_0_9_0.protocol.TCompactProtocol(new org.apache.blur.thirdparty.thrift_0_9_0.transport.TIOStreamTransport(in))); + } catch (org.apache.blur.thirdparty.thrift_0_9_0.TException te) { + throw new java.io.IOException(te); + } + } + + private static class loadData_argsStandardSchemeFactory implements SchemeFactory { + public loadData_argsStandardScheme getScheme() { + return new loadData_argsStandardScheme(); + } + } + + private static class loadData_argsStandardScheme extends StandardScheme<loadData_args> { + + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot, loadData_args struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // TABLE + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING) { + struct.table = iprot.readString(); + struct.setTableIsSet(true); + } else { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // LOCATION + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING) { + struct.location = iprot.readString(); + struct.setLocationIsSet(true); + } else { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.blur.thirdparty.thrift_0_9_0.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.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot, loadData_args struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + oprot.writeString(struct.table); + oprot.writeFieldEnd(); + } + if (struct.location != null) { + oprot.writeFieldBegin(LOCATION_FIELD_DESC); + oprot.writeString(struct.location); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class loadData_argsTupleSchemeFactory implements SchemeFactory { + public loadData_argsTupleScheme getScheme() { + return new loadData_argsTupleScheme(); + } + } + + private static class loadData_argsTupleScheme extends TupleScheme<loadData_args> { + + @Override + public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, loadData_args struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTable()) { + optionals.set(0); + } + if (struct.isSetLocation()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetTable()) { + oprot.writeString(struct.table); + } + if (struct.isSetLocation()) { + oprot.writeString(struct.location); + } + } + + @Override + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, loadData_args struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.table = iprot.readString(); + struct.setTableIsSet(true); + } + if (incoming.get(1)) { + struct.location = iprot.readString(); + struct.setLocationIsSet(true); + } + } + } + + } + + public static class loadData_result implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<loadData_result, loadData_result._Fields>, java.io.Serializable, Cloneable { + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct STRUCT_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct("loadData_result"); + + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField EX_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("ex", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, (short)1); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new loadData_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new loadData_resultTupleSchemeFactory()); + } + + public BlurException ex; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.blur.thirdparty.thrift_0_9_0.TFieldIdEnum { + EX((short)1, "ex"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // EX + return EX; + 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.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.EX, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("ex", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, + new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData.addStructMetaDataMap(loadData_result.class, metaDataMap); + } + + public loadData_result() { + } + + public loadData_result( + BlurException ex) + { + this(); + this.ex = ex; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public loadData_result(loadData_result other) { + if (other.isSetEx()) { + this.ex = new BlurException(other.ex); + } + } + + public loadData_result deepCopy() { + return new loadData_result(this); + } + + @Override + public void clear() { + this.ex = null; + } + + public BlurException getEx() { + return this.ex; + } + + public loadData_result setEx(BlurException ex) { + this.ex = ex; + return this; + } + + public void unsetEx() { + this.ex = null; + } + + /** Returns true if field ex is set (has been assigned a value) and false otherwise */ + public boolean isSetEx() { + return this.ex != null; + } + + public void setExIsSet(boolean value) { + if (!value) { + this.ex = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case EX: + if (value == null) { + unsetEx(); + } else { + setEx((BlurException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case EX: + return getEx(); + + } + 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 EX: + return isSetEx(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof loadData_result) + return this.equals((loadData_result)that); + return false; + } + + public boolean equals(loadData_result that) { + if (that == null) + return false; + + boolean this_present_ex = true && this.isSetEx(); + boolean that_present_ex = true && that.isSetEx(); + if (this_present_ex || that_present_ex) { + if (!(this_present_ex && that_present_ex)) + return false; + if (!this.ex.equals(that.ex)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(loadData_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + loadData_result typedOther = (loadData_result)other; + + lastComparison = Boolean.valueOf(isSetEx()).compareTo(typedOther.isSetEx()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx()) { + lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.ex, typedOther.ex); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("loadData_result("); + boolean first = true; + + sb.append("ex:"); + if (this.ex == null) { + sb.append("null"); + } else { + sb.append(this.ex); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.blur.thirdparty.thrift_0_9_0.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.blur.thirdparty.thrift_0_9_0.protocol.TCompactProtocol(new org.apache.blur.thirdparty.thrift_0_9_0.transport.TIOStreamTransport(out))); + } catch (org.apache.blur.thirdparty.thrift_0_9_0.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.blur.thirdparty.thrift_0_9_0.protocol.TCompactProtocol(new org.apache.blur.thirdparty.thrift_0_9_0.transport.TIOStreamTransport(in))); + } catch (org.apache.blur.thirdparty.thrift_0_9_0.TException te) { + throw new java.io.IOException(te); + } + } + + private static class loadData_resultStandardSchemeFactory implements SchemeFactory { + public loadData_resultStandardScheme getScheme() { + return new loadData_resultStandardScheme(); + } + } + + private static class loadData_resultStandardScheme extends StandardScheme<loadData_result> { + + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot, loadData_result struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // EX + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT) { + struct.ex = new BlurException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } else { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.blur.thirdparty.thrift_0_9_0.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.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot, loadData_result struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.ex != null) { + oprot.writeFieldBegin(EX_FIELD_DESC); + struct.ex.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class loadData_resultTupleSchemeFactory implements SchemeFactory { + public loadData_resultTupleScheme getScheme() { + return new loadData_resultTupleScheme(); + } + } + + private static class loadData_resultTupleScheme extends TupleScheme<loadData_result> { + + @Override + public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, loadData_result struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetEx()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetEx()) { + struct.ex.write(oprot); + } + } + + @Override + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, loadData_result struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.ex = new BlurException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } + } + } + + } + public static class mutate_args implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<mutate_args, mutate_args._Fields>, java.io.Serializable, Cloneable { private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct STRUCT_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct("mutate_args"); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/25ad5d45/distribution/src/main/scripts/interface/gen-js/Blur.js ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/interface/gen-js/Blur.js b/distribution/src/main/scripts/interface/gen-js/Blur.js index 1a6da97..742845c 100644 --- a/distribution/src/main/scripts/interface/gen-js/Blur.js +++ b/distribution/src/main/scripts/interface/gen-js/Blur.js @@ -3371,6 +3371,130 @@ Blur_fetchRowBatch_result.prototype.write = function(output) { return; }; +Blur_loadData_args = function(args) { + this.table = null; + this.location = null; + if (args) { + if (args.table !== undefined) { + this.table = args.table; + } + if (args.location !== undefined) { + this.location = args.location; + } + } +}; +Blur_loadData_args.prototype = {}; +Blur_loadData_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) + { + var ret = input.readFieldBegin(); + var fname = ret.fname; + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == Thrift.Type.STRING) { + this.table = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.location = input.readString().value; + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +Blur_loadData_args.prototype.write = function(output) { + output.writeStructBegin('Blur_loadData_args'); + if (this.table !== null && this.table !== undefined) { + output.writeFieldBegin('table', Thrift.Type.STRING, 1); + output.writeString(this.table); + output.writeFieldEnd(); + } + if (this.location !== null && this.location !== undefined) { + output.writeFieldBegin('location', Thrift.Type.STRING, 2); + output.writeString(this.location); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +Blur_loadData_result = function(args) { + this.ex = null; + if (args instanceof BlurException) { + this.ex = args; + return; + } + if (args) { + if (args.ex !== undefined) { + this.ex = args.ex; + } + } +}; +Blur_loadData_result.prototype = {}; +Blur_loadData_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) + { + var ret = input.readFieldBegin(); + var fname = ret.fname; + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.ex = new BlurException(); + this.ex.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +Blur_loadData_result.prototype.write = function(output) { + output.writeStructBegin('Blur_loadData_result'); + if (this.ex !== null && this.ex !== undefined) { + output.writeFieldBegin('ex', Thrift.Type.STRUCT, 1); + this.ex.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + Blur_mutate_args = function(args) { this.mutation = null; if (args) { @@ -7597,6 +7721,41 @@ BlurClient.prototype.recv_fetchRowBatch = function() { } throw 'fetchRowBatch failed: unknown result'; }; +BlurClient.prototype.loadData = function(table, location) { + this.send_loadData(table, location); + this.recv_loadData(); +}; + +BlurClient.prototype.send_loadData = function(table, location) { + this.output.writeMessageBegin('loadData', Thrift.MessageType.CALL, this.seqid); + var args = new Blur_loadData_args(); + args.table = table; + args.location = location; + args.write(this.output); + this.output.writeMessageEnd(); + return this.output.getTransport().flush(); +}; + +BlurClient.prototype.recv_loadData = function() { + var ret = this.input.readMessageBegin(); + var fname = ret.fname; + var mtype = ret.mtype; + var rseqid = ret.rseqid; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(this.input); + this.input.readMessageEnd(); + throw x; + } + var result = new Blur_loadData_result(); + result.read(this.input); + this.input.readMessageEnd(); + + if (null !== result.ex) { + throw result.ex; + } + return; +}; BlurClient.prototype.mutate = function(mutation) { this.send_mutate(mutation); this.recv_mutate();
