Updated Branches: refs/heads/master abb56992e -> 8d7b140d5
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/8d7b140d/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 b67737a..99357fd 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 @@ -406,6 +406,11 @@ public class Blur { */ public void traceRemove(String traceId) throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException; + /** + * A way to ping a server to make sure the connection is still valid. + */ + public void ping() throws org.apache.blur.thirdparty.thrift_0_9_0.TException; + } public interface AsyncIface { @@ -488,6 +493,8 @@ public class Blur { public void traceRemove(String traceId, org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback<AsyncClient.traceRemove_call> resultHandler) throws org.apache.blur.thirdparty.thrift_0_9_0.TException; + public void ping(org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback<AsyncClient.ping_call> resultHandler) throws org.apache.blur.thirdparty.thrift_0_9_0.TException; + } public static class Client extends org.apache.blur.thirdparty.thrift_0_9_0.TServiceClient implements Iface { @@ -1478,6 +1485,25 @@ public class Blur { return; } + public void ping() throws org.apache.blur.thirdparty.thrift_0_9_0.TException + { + send_ping(); + recv_ping(); + } + + public void send_ping() throws org.apache.blur.thirdparty.thrift_0_9_0.TException + { + ping_args args = new ping_args(); + sendBase("ping", args); + } + + public void recv_ping() throws org.apache.blur.thirdparty.thrift_0_9_0.TException + { + ping_result result = new ping_result(); + receiveBase(result, "ping"); + return; + } + } public static class AsyncClient extends org.apache.blur.thirdparty.thrift_0_9_0.async.TAsyncClient implements AsyncIface { public static class Factory implements org.apache.blur.thirdparty.thrift_0_9_0.async.TAsyncClientFactory<AsyncClient> { @@ -2787,6 +2813,35 @@ public class Blur { } } + public void ping(org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback<ping_call> resultHandler) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + checkReady(); + ping_call method_call = new ping_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class ping_call extends org.apache.blur.thirdparty.thrift_0_9_0.async.TAsyncMethodCall { + public ping_call(org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback<ping_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); + } + + 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("ping", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMessageType.CALL, 0)); + ping_args args = new ping_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws 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_ping(); + } + } + } public static class Processor<I extends Iface> extends org.apache.blur.thirdparty.thrift_0_9_0.TBaseProcessor<I> implements org.apache.blur.thirdparty.thrift_0_9_0.TProcessor { @@ -2839,6 +2894,7 @@ public class Blur { processMap.put("traceRequestList", new traceRequestList()); processMap.put("traceRequestFetch", new traceRequestFetch()); processMap.put("traceRemove", new traceRemove()); + processMap.put("ping", new ping()); return processMap; } @@ -3771,6 +3827,26 @@ public class Blur { } } + public static class ping<I extends Iface> extends org.apache.blur.thirdparty.thrift_0_9_0.ProcessFunction<I, ping_args> { + public ping() { + super("ping"); + } + + public ping_args getEmptyArgsInstance() { + return new ping_args(); + } + + protected boolean isOneway() { + return false; + } + + public ping_result getResult(I iface, ping_args args) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + ping_result result = new ping_result(); + iface.ping(); + return result; + } + } + } public static class createTable_args implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<createTable_args, createTable_args._Fields>, java.io.Serializable, Cloneable { @@ -36544,4 +36620,496 @@ public class Blur { } + public static class ping_args implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<ping_args, ping_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("ping_args"); + + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ping_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ping_argsTupleSchemeFactory()); + } + + + /** 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 { +; + + 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) { + 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; + } + } + 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); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData.addStructMetaDataMap(ping_args.class, metaDataMap); + } + + public ping_args() { + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public ping_args(ping_args other) { + } + + public ping_args deepCopy() { + return new ping_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + 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) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof ping_args) + return this.equals((ping_args)that); + return false; + } + + public boolean equals(ping_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(ping_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + ping_args typedOther = (ping_args)other; + + 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("ping_args("); + boolean first = true; + + 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 ping_argsStandardSchemeFactory implements SchemeFactory { + public ping_argsStandardScheme getScheme() { + return new ping_argsStandardScheme(); + } + } + + private static class ping_argsStandardScheme extends StandardScheme<ping_args> { + + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot, ping_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) { + 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, ping_args struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ping_argsTupleSchemeFactory implements SchemeFactory { + public ping_argsTupleScheme getScheme() { + return new ping_argsTupleScheme(); + } + } + + private static class ping_argsTupleScheme extends TupleScheme<ping_args> { + + @Override + public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, ping_args struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, ping_args struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class ping_result implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<ping_result, ping_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("ping_result"); + + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ping_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ping_resultTupleSchemeFactory()); + } + + + /** 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 { +; + + 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) { + 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; + } + } + 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); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData.addStructMetaDataMap(ping_result.class, metaDataMap); + } + + public ping_result() { + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public ping_result(ping_result other) { + } + + public ping_result deepCopy() { + return new ping_result(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + 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) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof ping_result) + return this.equals((ping_result)that); + return false; + } + + public boolean equals(ping_result that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(ping_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + ping_result typedOther = (ping_result)other; + + 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("ping_result("); + boolean first = true; + + 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 ping_resultStandardSchemeFactory implements SchemeFactory { + public ping_resultStandardScheme getScheme() { + return new ping_resultStandardScheme(); + } + } + + private static class ping_resultStandardScheme extends StandardScheme<ping_result> { + + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot, ping_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) { + 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, ping_result struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ping_resultTupleSchemeFactory implements SchemeFactory { + public ping_resultTupleScheme getScheme() { + return new ping_resultTupleScheme(); + } + } + + private static class ping_resultTupleScheme extends TupleScheme<ping_result> { + + @Override + public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, ping_result struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, ping_result struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/8d7b140d/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 bc51fd3..65d98b8 100644 --- a/distribution/src/main/scripts/interface/gen-js/Blur.js +++ b/distribution/src/main/scripts/interface/gen-js/Blur.js @@ -5281,6 +5281,62 @@ Blur_traceRemove_result.prototype.write = function(output) { return; }; +Blur_ping_args = function(args) { +}; +Blur_ping_args.prototype = {}; +Blur_ping_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; + } + input.skip(ftype); + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +Blur_ping_args.prototype.write = function(output) { + output.writeStructBegin('Blur_ping_args'); + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +Blur_ping_result = function(args) { +}; +Blur_ping_result.prototype = {}; +Blur_ping_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; + } + input.skip(ftype); + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +Blur_ping_result.prototype.write = function(output) { + output.writeStructBegin('Blur_ping_result'); + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + BlurClient = function(input, output) { this.input = input; this.output = (!output) ? input : output; @@ -6662,3 +6718,33 @@ BlurClient.prototype.recv_traceRemove = function() { } return; }; +BlurClient.prototype.ping = function() { + this.send_ping(); + this.recv_ping(); +}; + +BlurClient.prototype.send_ping = function() { + this.output.writeMessageBegin('ping', Thrift.MessageType.CALL, this.seqid); + var args = new Blur_ping_args(); + args.write(this.output); + this.output.writeMessageEnd(); + return this.output.getTransport().flush(); +}; + +BlurClient.prototype.recv_ping = 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_ping_result(); + result.read(this.input); + this.input.readMessageEnd(); + + return; +}; http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/8d7b140d/distribution/src/main/scripts/interface/gen-perl/Blur/Blur.pm ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/interface/gen-perl/Blur/Blur.pm b/distribution/src/main/scripts/interface/gen-perl/Blur/Blur.pm index fafbd82..7d170c9 100644 --- a/distribution/src/main/scripts/interface/gen-perl/Blur/Blur.pm +++ b/distribution/src/main/scripts/interface/gen-perl/Blur/Blur.pm @@ -6066,6 +6066,98 @@ sub write { return $xfer; } +package Blur::Blur_ping_args; +use base qw(Class::Accessor); + +sub new { + my $classname = shift; + my $self = {}; + my $vals = shift || {}; + return bless ($self, $classname); +} + +sub getName { + return 'Blur_ping_args'; +} + +sub read { + my ($self, $input) = @_; + my $xfer = 0; + my $fname; + my $ftype = 0; + my $fid = 0; + $xfer += $input->readStructBegin(\$fname); + while (1) + { + $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); + if ($ftype == TType::STOP) { + last; + } + SWITCH: for($fid) + { + $xfer += $input->skip($ftype); + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; +} + +sub write { + my ($self, $output) = @_; + my $xfer = 0; + $xfer += $output->writeStructBegin('Blur_ping_args'); + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; +} + +package Blur::Blur_ping_result; +use base qw(Class::Accessor); + +sub new { + my $classname = shift; + my $self = {}; + my $vals = shift || {}; + return bless ($self, $classname); +} + +sub getName { + return 'Blur_ping_result'; +} + +sub read { + my ($self, $input) = @_; + my $xfer = 0; + my $fname; + my $ftype = 0; + my $fid = 0; + $xfer += $input->readStructBegin(\$fname); + while (1) + { + $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); + if ($ftype == TType::STOP) { + last; + } + SWITCH: for($fid) + { + $xfer += $input->skip($ftype); + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; +} + +sub write { + my ($self, $output) = @_; + my $xfer = 0; + $xfer += $output->writeStructBegin('Blur_ping_result'); + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; +} + package Blur::BlurIf; use strict; @@ -6359,6 +6451,12 @@ sub traceRemove{ die 'implement interface'; } +sub ping{ + my $self = shift; + + die 'implement interface'; +} + package Blur::BlurRest; use strict; @@ -6659,6 +6757,12 @@ sub traceRemove{ return $self->{impl}->traceRemove($traceId); } +sub ping{ + my ($self, $request) = @_; + + return $self->{impl}->ping(); +} + package Blur::BlurClient; @@ -8422,6 +8526,43 @@ sub recv_traceRemove{ } return; } +sub ping{ + my $self = shift; + + $self->send_ping(); + $self->recv_ping(); +} + +sub send_ping{ + my $self = shift; + + $self->{output}->writeMessageBegin('ping', TMessageType::CALL, $self->{seqid}); + my $args = new Blur::Blur_ping_args(); + $args->write($self->{output}); + $self->{output}->writeMessageEnd(); + $self->{output}->getTransport()->flush(); +} + +sub recv_ping{ + my $self = shift; + + my $rseqid = 0; + my $fname; + my $mtype = 0; + + $self->{input}->readMessageBegin(\$fname, \$mtype, \$rseqid); + if ($mtype == TMessageType::EXCEPTION) { + my $x = new TApplicationException(); + $x->read($self->{input}); + $self->{input}->readMessageEnd(); + die $x; + } + my $result = new Blur::Blur_ping_result(); + $result->read($self->{input}); + $self->{input}->readMessageEnd(); + + return; +} package Blur::BlurProcessor; use strict; @@ -9101,4 +9242,17 @@ sub process_traceRemove { $output->getTransport()->flush(); } +sub process_ping { + my ($self, $seqid, $input, $output) = @_; + my $args = new Blur::Blur_ping_args(); + $args->read($input); + $input->readMessageEnd(); + my $result = new Blur::Blur_ping_result(); + $self->{handler}->ping(); + $output->writeMessageBegin('ping', TMessageType::REPLY, $seqid); + $result->write($output); + $output->writeMessageEnd(); + $output->getTransport()->flush(); +} + 1; http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/8d7b140d/distribution/src/main/scripts/interface/gen-rb/blur.rb ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/interface/gen-rb/blur.rb b/distribution/src/main/scripts/interface/gen-rb/blur.rb index 5bd5b2e..7cab210 100644 --- a/distribution/src/main/scripts/interface/gen-rb/blur.rb +++ b/distribution/src/main/scripts/interface/gen-rb/blur.rb @@ -607,6 +607,20 @@ module Blur return end + def ping() + send_ping() + recv_ping() + end + + def send_ping() + send_message('ping', Ping_args) + end + + def recv_ping() + result = receive_message(Ping_result) + return + end + end class Processor @@ -1031,6 +1045,13 @@ module Blur write_result(result, oprot, 'traceRemove', seqid) end + def process_ping(seqid, iprot, oprot) + args = read_args(iprot, Ping_args) + result = Ping_result.new() + @handler.ping() + write_result(result, oprot, 'ping', seqid) + end + end # HELPER FUNCTIONS AND STRUCTURES @@ -2417,6 +2438,36 @@ module Blur ::Thrift::Struct.generate_accessors self end + class Ping_args + include ::Thrift::Struct, ::Thrift::Struct_Union + + FIELDS = { + + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Ping_result + include ::Thrift::Struct, ::Thrift::Struct_Union + + FIELDS = { + + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + end end http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/8d7b140d/distribution/src/main/scripts/interface/genAndReplace.sh ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/interface/genAndReplace.sh b/distribution/src/main/scripts/interface/genAndReplace.sh index d6881a4..dad5512 100755 --- a/distribution/src/main/scripts/interface/genAndReplace.sh +++ b/distribution/src/main/scripts/interface/genAndReplace.sh @@ -36,3 +36,6 @@ cd ../../../../../blur-util mvn exec:java -Dexec.mainClass="org.apache.blur.doc.CreateBlurApiHtmlPage" -Dexec.args="$GEN_HTML $OUTPUT_HTML" cd $cdir cp -r gen-java/* ../../../../../blur-thrift/src/main/java/ +cd ../../../../../blur-thrift +mvn exec:java -Dexec.mainClass="org.apache.blur.thrift.util.GenerateSafeClient" +cd $cdir \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/8d7b140d/docs/Blur.html ---------------------------------------------------------------------- diff --git a/docs/Blur.html b/docs/Blur.html index fc56caa..9f9b1ff 100644 --- a/docs/Blur.html +++ b/docs/Blur.html @@ -138,6 +138,7 @@ limitations under the License. <li><a href="#Fn_Blur_traceRequestList"> traceRequestList</a></li> <li><a href="#Fn_Blur_traceRequestFetch"> traceRequestFetch</a></li> <li><a href="#Fn_Blur_traceRemove"> traceRemove</a></li> +<li><a href="#Fn_Blur_ping"> ping</a></li> </ul></li> </ul> </li> @@ -934,7 +935,10 @@ throws <code><a href="Blur.html#Struct_BlurException">BlurException</a></code> <br/><br/><h4 id="Parameters_Blur_traceRemove">Parameters</h4> <table class="table-bordered table-striped table-condensed"><thead><th>Name</th><th>Description</th></thead><tr><td>traceId</td><td>the trace id. </td></tr> -</table></p></section> +</table></p></section><section><div class="page-header"><h4 id="Fn_Blur_ping">Function: Blur.ping</h4></div><p class="lead"> +<pre><code>void</code> ping() +</pre>A way to ping a server to make sure the connection is still valid. +<br/></p></section> </div> </div> </div>
