Updated Branches: refs/heads/master c1a17cc41 -> 7a01385e9
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/0ed107ba/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 88b8357..170b6f6 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 @@ -136,7 +136,7 @@ public class Blur { * @param table * @param blurQuery */ - public BlurResults query(String table, BlurQuery blurQuery) throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException; + public BlurResults query(String table, BlurQuery blurQuery) throws BlurException, BackPressureException, org.apache.blur.thirdparty.thrift_0_9_0.TException; /** * Parses the given query and return the string represents the query. @@ -194,7 +194,7 @@ public class Blur { public long recordFrequency(String table, String columnFamily, String columnName, String value) throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException; - public FetchResult fetchRow(String table, Selector selector) throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException; + public FetchResult fetchRow(String table, Selector selector) throws BlurException, BackPressureException, org.apache.blur.thirdparty.thrift_0_9_0.TException; public void mutate(RowMutation mutation) throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException; @@ -507,7 +507,7 @@ 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, "describe failed: unknown result"); } - public BlurResults query(String table, BlurQuery blurQuery) throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException + public BlurResults query(String table, BlurQuery blurQuery) throws BlurException, BackPressureException, org.apache.blur.thirdparty.thrift_0_9_0.TException { send_query(table, blurQuery); return recv_query(); @@ -521,7 +521,7 @@ public class Blur { sendBase("query", args); } - public BlurResults recv_query() throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException + public BlurResults recv_query() throws BlurException, BackPressureException, org.apache.blur.thirdparty.thrift_0_9_0.TException { query_result result = new query_result(); receiveBase(result, "query"); @@ -531,6 +531,9 @@ public class Blur { if (result.ex != null) { throw result.ex; } + if (result.bpex != null) { + throw result.bpex; + } throw new org.apache.blur.thirdparty.thrift_0_9_0.TApplicationException(org.apache.blur.thirdparty.thrift_0_9_0.TApplicationException.MISSING_RESULT, "query failed: unknown result"); } @@ -801,7 +804,7 @@ 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, "recordFrequency failed: unknown result"); } - public FetchResult fetchRow(String table, Selector selector) throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException + public FetchResult fetchRow(String table, Selector selector) throws BlurException, BackPressureException, org.apache.blur.thirdparty.thrift_0_9_0.TException { send_fetchRow(table, selector); return recv_fetchRow(); @@ -815,7 +818,7 @@ public class Blur { sendBase("fetchRow", args); } - public FetchResult recv_fetchRow() throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException + public FetchResult recv_fetchRow() throws BlurException, BackPressureException, org.apache.blur.thirdparty.thrift_0_9_0.TException { fetchRow_result result = new fetchRow_result(); receiveBase(result, "fetchRow"); @@ -825,6 +828,9 @@ public class Blur { if (result.ex != null) { throw result.ex; } + if (result.bpex != null) { + throw result.bpex; + } throw new org.apache.blur.thirdparty.thrift_0_9_0.TApplicationException(org.apache.blur.thirdparty.thrift_0_9_0.TApplicationException.MISSING_RESULT, "fetchRow failed: unknown result"); } @@ -1358,7 +1364,7 @@ public class Blur { prot.writeMessageEnd(); } - public BlurResults getResult() throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException { + public BlurResults getResult() throws BlurException, BackPressureException, 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!"); } @@ -1743,7 +1749,7 @@ public class Blur { prot.writeMessageEnd(); } - public FetchResult getResult() throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException { + public FetchResult getResult() throws BlurException, BackPressureException, 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!"); } @@ -2333,6 +2339,8 @@ public class Blur { result.success = iface.query(args.table, args.blurQuery); } catch (BlurException ex) { result.ex = ex; + } catch (BackPressureException bpex) { + result.bpex = bpex; } return result; } @@ -2598,6 +2606,8 @@ public class Blur { result.success = iface.fetchRow(args.table, args.selector); } catch (BlurException ex) { result.ex = ex; + } catch (BackPressureException bpex) { + result.bpex = bpex; } return result; } @@ -9908,6 +9918,7 @@ public class Blur { private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField SUCCESS_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("success", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, (short)0); 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 org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField BPEX_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("bpex", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -9917,11 +9928,13 @@ public class Blur { public BlurResults success; // required public BlurException ex; // required + public BackPressureException bpex; // 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 { SUCCESS((short)0, "success"), - EX((short)1, "ex"); + EX((short)1, "ex"), + BPEX((short)2, "bpex"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -9940,6 +9953,8 @@ public class Blur { return SUCCESS; case 1: // EX return EX; + case 2: // BPEX + return BPEX; default: return null; } @@ -9987,6 +10002,8 @@ public class Blur { new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.StructMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, BlurResults.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))); + tmpMap.put(_Fields.BPEX, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("bpex", 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(query_result.class, metaDataMap); } @@ -9996,11 +10013,13 @@ public class Blur { public query_result( BlurResults success, - BlurException ex) + BlurException ex, + BackPressureException bpex) { this(); this.success = success; this.ex = ex; + this.bpex = bpex; } /** @@ -10013,6 +10032,9 @@ public class Blur { if (other.isSetEx()) { this.ex = new BlurException(other.ex); } + if (other.isSetBpex()) { + this.bpex = new BackPressureException(other.bpex); + } } public query_result deepCopy() { @@ -10023,6 +10045,7 @@ public class Blur { public void clear() { this.success = null; this.ex = null; + this.bpex = null; } public BlurResults getSuccess() { @@ -10073,6 +10096,30 @@ public class Blur { } } + public BackPressureException getBpex() { + return this.bpex; + } + + public query_result setBpex(BackPressureException bpex) { + this.bpex = bpex; + return this; + } + + public void unsetBpex() { + this.bpex = null; + } + + /** Returns true if field bpex is set (has been assigned a value) and false otherwise */ + public boolean isSetBpex() { + return this.bpex != null; + } + + public void setBpexIsSet(boolean value) { + if (!value) { + this.bpex = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: @@ -10091,6 +10138,14 @@ public class Blur { } break; + case BPEX: + if (value == null) { + unsetBpex(); + } else { + setBpex((BackPressureException)value); + } + break; + } } @@ -10102,6 +10157,9 @@ public class Blur { case EX: return getEx(); + case BPEX: + return getBpex(); + } throw new IllegalStateException(); } @@ -10117,6 +10175,8 @@ public class Blur { return isSetSuccess(); case EX: return isSetEx(); + case BPEX: + return isSetBpex(); } throw new IllegalStateException(); } @@ -10152,6 +10212,15 @@ public class Blur { return false; } + boolean this_present_bpex = true && this.isSetBpex(); + boolean that_present_bpex = true && that.isSetBpex(); + if (this_present_bpex || that_present_bpex) { + if (!(this_present_bpex && that_present_bpex)) + return false; + if (!this.bpex.equals(that.bpex)) + return false; + } + return true; } @@ -10188,6 +10257,16 @@ public class Blur { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetBpex()).compareTo(typedOther.isSetBpex()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetBpex()) { + lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.bpex, typedOther.bpex); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -10223,6 +10302,14 @@ public class Blur { sb.append(this.ex); } first = false; + if (!first) sb.append(", "); + sb.append("bpex:"); + if (this.bpex == null) { + sb.append("null"); + } else { + sb.append(this.bpex); + } + first = false; sb.append(")"); return sb.toString(); } @@ -10287,6 +10374,15 @@ public class Blur { org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 2: // BPEX + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT) { + struct.bpex = new BackPressureException(); + struct.bpex.read(iprot); + struct.setBpexIsSet(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); } @@ -10312,6 +10408,11 @@ public class Blur { struct.ex.write(oprot); oprot.writeFieldEnd(); } + if (struct.bpex != null) { + oprot.writeFieldBegin(BPEX_FIELD_DESC); + struct.bpex.write(oprot); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -10336,19 +10437,25 @@ public class Blur { if (struct.isSetEx()) { optionals.set(1); } - oprot.writeBitSet(optionals, 2); + if (struct.isSetBpex()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetEx()) { struct.ex.write(oprot); } + if (struct.isSetBpex()) { + struct.bpex.write(oprot); + } } @Override public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, query_result struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); + BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.success = new BlurResults(); struct.success.read(iprot); @@ -10359,6 +10466,11 @@ public class Blur { struct.ex.read(iprot); struct.setExIsSet(true); } + if (incoming.get(2)) { + struct.bpex = new BackPressureException(); + struct.bpex.read(iprot); + struct.setBpexIsSet(true); + } } } @@ -20005,6 +20117,7 @@ public class Blur { private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField SUCCESS_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("success", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, (short)0); 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 org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField BPEX_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("bpex", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -20014,11 +20127,13 @@ public class Blur { public FetchResult success; // required public BlurException ex; // required + public BackPressureException bpex; // 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 { SUCCESS((short)0, "success"), - EX((short)1, "ex"); + EX((short)1, "ex"), + BPEX((short)2, "bpex"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -20037,6 +20152,8 @@ public class Blur { return SUCCESS; case 1: // EX return EX; + case 2: // BPEX + return BPEX; default: return null; } @@ -20084,6 +20201,8 @@ public class Blur { new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.StructMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, FetchResult.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))); + tmpMap.put(_Fields.BPEX, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("bpex", 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(fetchRow_result.class, metaDataMap); } @@ -20093,11 +20212,13 @@ public class Blur { public fetchRow_result( FetchResult success, - BlurException ex) + BlurException ex, + BackPressureException bpex) { this(); this.success = success; this.ex = ex; + this.bpex = bpex; } /** @@ -20110,6 +20231,9 @@ public class Blur { if (other.isSetEx()) { this.ex = new BlurException(other.ex); } + if (other.isSetBpex()) { + this.bpex = new BackPressureException(other.bpex); + } } public fetchRow_result deepCopy() { @@ -20120,6 +20244,7 @@ public class Blur { public void clear() { this.success = null; this.ex = null; + this.bpex = null; } public FetchResult getSuccess() { @@ -20170,6 +20295,30 @@ public class Blur { } } + public BackPressureException getBpex() { + return this.bpex; + } + + public fetchRow_result setBpex(BackPressureException bpex) { + this.bpex = bpex; + return this; + } + + public void unsetBpex() { + this.bpex = null; + } + + /** Returns true if field bpex is set (has been assigned a value) and false otherwise */ + public boolean isSetBpex() { + return this.bpex != null; + } + + public void setBpexIsSet(boolean value) { + if (!value) { + this.bpex = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: @@ -20188,6 +20337,14 @@ public class Blur { } break; + case BPEX: + if (value == null) { + unsetBpex(); + } else { + setBpex((BackPressureException)value); + } + break; + } } @@ -20199,6 +20356,9 @@ public class Blur { case EX: return getEx(); + case BPEX: + return getBpex(); + } throw new IllegalStateException(); } @@ -20214,6 +20374,8 @@ public class Blur { return isSetSuccess(); case EX: return isSetEx(); + case BPEX: + return isSetBpex(); } throw new IllegalStateException(); } @@ -20249,6 +20411,15 @@ public class Blur { return false; } + boolean this_present_bpex = true && this.isSetBpex(); + boolean that_present_bpex = true && that.isSetBpex(); + if (this_present_bpex || that_present_bpex) { + if (!(this_present_bpex && that_present_bpex)) + return false; + if (!this.bpex.equals(that.bpex)) + return false; + } + return true; } @@ -20285,6 +20456,16 @@ public class Blur { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetBpex()).compareTo(typedOther.isSetBpex()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetBpex()) { + lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.bpex, typedOther.bpex); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -20320,6 +20501,14 @@ public class Blur { sb.append(this.ex); } first = false; + if (!first) sb.append(", "); + sb.append("bpex:"); + if (this.bpex == null) { + sb.append("null"); + } else { + sb.append(this.bpex); + } + first = false; sb.append(")"); return sb.toString(); } @@ -20384,6 +20573,15 @@ public class Blur { org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 2: // BPEX + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT) { + struct.bpex = new BackPressureException(); + struct.bpex.read(iprot); + struct.setBpexIsSet(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); } @@ -20409,6 +20607,11 @@ public class Blur { struct.ex.write(oprot); oprot.writeFieldEnd(); } + if (struct.bpex != null) { + oprot.writeFieldBegin(BPEX_FIELD_DESC); + struct.bpex.write(oprot); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -20433,19 +20636,25 @@ public class Blur { if (struct.isSetEx()) { optionals.set(1); } - oprot.writeBitSet(optionals, 2); + if (struct.isSetBpex()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetEx()) { struct.ex.write(oprot); } + if (struct.isSetBpex()) { + struct.bpex.write(oprot); + } } @Override public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, fetchRow_result struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); + BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.success = new FetchResult(); struct.success.read(iprot); @@ -20456,6 +20665,11 @@ public class Blur { struct.ex.read(iprot); struct.setExIsSet(true); } + if (incoming.get(2)) { + struct.bpex = new BackPressureException(); + struct.bpex.read(iprot); + struct.setBpexIsSet(true); + } } } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/0ed107ba/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/QueryState.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/QueryState.java b/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/QueryState.java index d721550..25b02bc 100644 --- a/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/QueryState.java +++ b/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/QueryState.java @@ -39,7 +39,8 @@ import org.apache.blur.thirdparty.thrift_0_9_0.TEnum; public enum QueryState implements org.apache.blur.thirdparty.thrift_0_9_0.TEnum { RUNNING(0), INTERRUPTED(1), - COMPLETE(2); + COMPLETE(2), + BACK_PRESSURE_INTERRUPTED(3); private final int value; @@ -66,6 +67,8 @@ public enum QueryState implements org.apache.blur.thirdparty.thrift_0_9_0.TEnum return INTERRUPTED; case 2: return COMPLETE; + case 3: + return BACK_PRESSURE_INTERRUPTED; default: return null; } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/0ed107ba/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 68b9aa0..553e5a7 100644 --- a/distribution/src/main/scripts/interface/gen-js/Blur.js +++ b/distribution/src/main/scripts/interface/gen-js/Blur.js @@ -1201,10 +1201,15 @@ Blur_query_args.prototype.write = function(output) { Blur_query_result = function(args) { this.success = null; this.ex = null; + this.bpex = null; if (args instanceof BlurException) { this.ex = args; return; } + if (args instanceof BackPressureException) { + this.bpex = args; + return; + } if (args) { if (args.success !== undefined) { this.success = args.success; @@ -1212,6 +1217,9 @@ Blur_query_result = function(args) { if (args.ex !== undefined) { this.ex = args.ex; } + if (args.bpex !== undefined) { + this.bpex = args.bpex; + } } }; Blur_query_result.prototype = {}; @@ -1244,6 +1252,14 @@ Blur_query_result.prototype.read = function(input) { input.skip(ftype); } break; + case 2: + if (ftype == Thrift.Type.STRUCT) { + this.bpex = new BackPressureException(); + this.bpex.read(input); + } else { + input.skip(ftype); + } + break; default: input.skip(ftype); } @@ -1265,6 +1281,11 @@ Blur_query_result.prototype.write = function(output) { this.ex.write(output); output.writeFieldEnd(); } + if (this.bpex !== null && this.bpex !== undefined) { + output.writeFieldBegin('bpex', Thrift.Type.STRUCT, 2); + this.bpex.write(output); + output.writeFieldEnd(); + } output.writeFieldStop(); output.writeStructEnd(); return; @@ -2784,10 +2805,15 @@ Blur_fetchRow_args.prototype.write = function(output) { Blur_fetchRow_result = function(args) { this.success = null; this.ex = null; + this.bpex = null; if (args instanceof BlurException) { this.ex = args; return; } + if (args instanceof BackPressureException) { + this.bpex = args; + return; + } if (args) { if (args.success !== undefined) { this.success = args.success; @@ -2795,6 +2821,9 @@ Blur_fetchRow_result = function(args) { if (args.ex !== undefined) { this.ex = args.ex; } + if (args.bpex !== undefined) { + this.bpex = args.bpex; + } } }; Blur_fetchRow_result.prototype = {}; @@ -2827,6 +2856,14 @@ Blur_fetchRow_result.prototype.read = function(input) { input.skip(ftype); } break; + case 2: + if (ftype == Thrift.Type.STRUCT) { + this.bpex = new BackPressureException(); + this.bpex.read(input); + } else { + input.skip(ftype); + } + break; default: input.skip(ftype); } @@ -2848,6 +2885,11 @@ Blur_fetchRow_result.prototype.write = function(output) { this.ex.write(output); output.writeFieldEnd(); } + if (this.bpex !== null && this.bpex !== undefined) { + output.writeFieldBegin('bpex', Thrift.Type.STRUCT, 2); + this.bpex.write(output); + output.writeFieldEnd(); + } output.writeFieldStop(); output.writeStructEnd(); return; @@ -4447,6 +4489,9 @@ BlurClient.prototype.recv_query = function() { if (null !== result.ex) { throw result.ex; } + if (null !== result.bpex) { + throw result.bpex; + } if (null !== result.success) { return result.success; } @@ -4862,6 +4907,9 @@ BlurClient.prototype.recv_fetchRow = function() { if (null !== result.ex) { throw result.ex; } + if (null !== result.bpex) { + throw result.bpex; + } if (null !== result.success) { return result.success; } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/0ed107ba/distribution/src/main/scripts/interface/gen-js/Blur_types.js ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/interface/gen-js/Blur_types.js b/distribution/src/main/scripts/interface/gen-js/Blur_types.js index d448050..413d728 100644 --- a/distribution/src/main/scripts/interface/gen-js/Blur_types.js +++ b/distribution/src/main/scripts/interface/gen-js/Blur_types.js @@ -13,7 +13,8 @@ ScoreType = { QueryState = { 'RUNNING' : 0, 'INTERRUPTED' : 1, -'COMPLETE' : 2 +'COMPLETE' : 2, +'BACK_PRESSURE_INTERRUPTED' : 3 }; RowMutationType = { 'DELETE_ROW' : 0, @@ -101,6 +102,60 @@ BlurException.prototype.write = function(output) { return; }; +BackPressureException = function(args) { + this.message = null; + if (args) { + if (args.message !== undefined) { + this.message = args.message; + } + } +}; +Thrift.inherits(BackPressureException, Thrift.TException); +BackPressureException.prototype.name = 'BackPressureException'; +BackPressureException.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.message = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +BackPressureException.prototype.write = function(output) { + output.writeStructBegin('BackPressureException'); + if (this.message !== null && this.message !== undefined) { + output.writeFieldBegin('message', Thrift.Type.STRING, 1); + output.writeString(this.message); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + Column = function(args) { this.name = null; this.value = null; http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/0ed107ba/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 225d00e..16493ba 100644 --- a/distribution/src/main/scripts/interface/gen-perl/Blur/Blur.pm +++ b/distribution/src/main/scripts/interface/gen-perl/Blur/Blur.pm @@ -1381,6 +1381,7 @@ sub new { my $vals = shift || {}; $self->{success} = undef; $self->{ex} = undef; + $self->{bpex} = undef; if (UNIVERSAL::isa($vals,'HASH')) { if (defined $vals->{success}) { $self->{success} = $vals->{success}; @@ -1388,6 +1389,9 @@ sub new { if (defined $vals->{ex}) { $self->{ex} = $vals->{ex}; } + if (defined $vals->{bpex}) { + $self->{bpex} = $vals->{bpex}; + } } return bless ($self, $classname); } @@ -1425,6 +1429,13 @@ sub read { $xfer += $input->skip($ftype); } last; }; + /^2$/ && do{ if ($ftype == TType::STRUCT) { + $self->{bpex} = new Blur::BackPressureException(); + $xfer += $self->{bpex}->read($input); + } else { + $xfer += $input->skip($ftype); + } + last; }; $xfer += $input->skip($ftype); } $xfer += $input->readFieldEnd(); @@ -1447,6 +1458,11 @@ sub write { $xfer += $self->{ex}->write($output); $xfer += $output->writeFieldEnd(); } + if (defined $self->{bpex}) { + $xfer += $output->writeFieldBegin('bpex', TType::STRUCT, 2); + $xfer += $self->{bpex}->write($output); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -3186,6 +3202,7 @@ sub new { my $vals = shift || {}; $self->{success} = undef; $self->{ex} = undef; + $self->{bpex} = undef; if (UNIVERSAL::isa($vals,'HASH')) { if (defined $vals->{success}) { $self->{success} = $vals->{success}; @@ -3193,6 +3210,9 @@ sub new { if (defined $vals->{ex}) { $self->{ex} = $vals->{ex}; } + if (defined $vals->{bpex}) { + $self->{bpex} = $vals->{bpex}; + } } return bless ($self, $classname); } @@ -3230,6 +3250,13 @@ sub read { $xfer += $input->skip($ftype); } last; }; + /^2$/ && do{ if ($ftype == TType::STRUCT) { + $self->{bpex} = new Blur::BackPressureException(); + $xfer += $self->{bpex}->read($input); + } else { + $xfer += $input->skip($ftype); + } + last; }; $xfer += $input->skip($ftype); } $xfer += $input->readFieldEnd(); @@ -3252,6 +3279,11 @@ sub write { $xfer += $self->{ex}->write($output); $xfer += $output->writeFieldEnd(); } + if (defined $self->{bpex}) { + $xfer += $output->writeFieldBegin('bpex', TType::STRUCT, 2); + $xfer += $self->{bpex}->write($output); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -5576,6 +5608,9 @@ sub recv_query{ if (defined $result->{ex}) { die $result->{ex}; } + if (defined $result->{bpex}) { + die $result->{bpex}; + } die "query failed: unknown result"; } sub parseQuery{ @@ -6112,6 +6147,9 @@ sub recv_fetchRow{ if (defined $result->{ex}) { die $result->{ex}; } + if (defined $result->{bpex}) { + die $result->{bpex}; + } die "fetchRow failed: unknown result"; } sub mutate{ @@ -6736,6 +6774,8 @@ sub process_query { $result->{success} = $self->{handler}->query($args->table, $args->blurQuery); }; if( UNIVERSAL::isa($@,'Blur::BlurException') ){ $result->{ex} = $@; + }; if( UNIVERSAL::isa($@,'Blur::BackPressureException') ){ + $result->{bpex} = $@; } $output->writeMessageBegin('query', TMessageType::REPLY, $seqid); $result->write($output); @@ -6923,6 +6963,8 @@ sub process_fetchRow { $result->{success} = $self->{handler}->fetchRow($args->table, $args->selector); }; if( UNIVERSAL::isa($@,'Blur::BlurException') ){ $result->{ex} = $@; + }; if( UNIVERSAL::isa($@,'Blur::BackPressureException') ){ + $result->{bpex} = $@; } $output->writeMessageBegin('fetchRow', TMessageType::REPLY, $seqid); $result->write($output); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/0ed107ba/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm b/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm index 563c6a7..e80b25c 100644 --- a/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm +++ b/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm @@ -17,6 +17,7 @@ package Blur::QueryState; use constant RUNNING => 0; use constant INTERRUPTED => 1; use constant COMPLETE => 2; +use constant BACK_PRESSURE_INTERRUPTED => 3; package Blur::RowMutationType; use constant DELETE_ROW => 0; use constant REPLACE_ROW => 1; @@ -113,6 +114,71 @@ sub write { return $xfer; } +package Blur::BackPressureException; +use base qw(Thrift::TException); +use base qw(Class::Accessor); +Blur::BackPressureException->mk_accessors( qw( message ) ); + +sub new { + my $classname = shift; + my $self = {}; + my $vals = shift || {}; + $self->{message} = undef; + if (UNIVERSAL::isa($vals,'HASH')) { + if (defined $vals->{message}) { + $self->{message} = $vals->{message}; + } + } + return bless ($self, $classname); +} + +sub getName { + return 'BackPressureException'; +} + +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) + { + /^1$/ && do{ if ($ftype == TType::STRING) { + $xfer += $input->readString(\$self->{message}); + } else { + $xfer += $input->skip($ftype); + } + last; }; + $xfer += $input->skip($ftype); + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; +} + +sub write { + my ($self, $output) = @_; + my $xfer = 0; + $xfer += $output->writeStructBegin('BackPressureException'); + if (defined $self->{message}) { + $xfer += $output->writeFieldBegin('message', TType::STRING, 1); + $xfer += $output->writeString($self->{message}); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; +} + package Blur::Column; use base qw(Class::Accessor); Blur::Column->mk_accessors( qw( name value ) ); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/0ed107ba/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 2a277c7..021b760 100644 --- a/distribution/src/main/scripts/interface/gen-rb/blur.rb +++ b/distribution/src/main/scripts/interface/gen-rb/blur.rb @@ -153,6 +153,7 @@ module Blur result = receive_message(Query_result) return result.success unless result.success.nil? raise result.ex unless result.ex.nil? + raise result.bpex unless result.bpex.nil? raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'query failed: unknown result') end @@ -328,6 +329,7 @@ module Blur result = receive_message(FetchRow_result) return result.success unless result.success.nil? raise result.ex unless result.ex.nil? + raise result.bpex unless result.bpex.nil? raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'fetchRow failed: unknown result') end @@ -584,6 +586,8 @@ module Blur result.success = @handler.query(args.table, args.blurQuery) rescue ::Blur::BlurException => ex result.ex = ex + rescue ::Blur::BackPressureException => bpex + result.bpex = bpex end write_result(result, oprot, 'query', seqid) end @@ -705,6 +709,8 @@ module Blur result.success = @handler.fetchRow(args.table, args.selector) rescue ::Blur::BlurException => ex result.ex = ex + rescue ::Blur::BackPressureException => bpex + result.bpex = bpex end write_result(result, oprot, 'fetchRow', seqid) end @@ -1114,10 +1120,12 @@ module Blur include ::Thrift::Struct, ::Thrift::Struct_Union SUCCESS = 0 EX = 1 + BPEX = 2 FIELDS = { SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Blur::BlurResults}, - EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => ::Blur::BlurException} + EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => ::Blur::BlurException}, + BPEX => {:type => ::Thrift::Types::STRUCT, :name => 'bpex', :class => ::Blur::BackPressureException} } def struct_fields; FIELDS; end @@ -1508,10 +1516,12 @@ module Blur include ::Thrift::Struct, ::Thrift::Struct_Union SUCCESS = 0 EX = 1 + BPEX = 2 FIELDS = { SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Blur::FetchResult}, - EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => ::Blur::BlurException} + EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => ::Blur::BlurException}, + BPEX => {:type => ::Thrift::Types::STRUCT, :name => 'bpex', :class => ::Blur::BackPressureException} } def struct_fields; FIELDS; end http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/0ed107ba/distribution/src/main/scripts/interface/gen-rb/blur_types.rb ---------------------------------------------------------------------- diff --git a/distribution/src/main/scripts/interface/gen-rb/blur_types.rb b/distribution/src/main/scripts/interface/gen-rb/blur_types.rb index d2e0a8a..b4f6773 100644 --- a/distribution/src/main/scripts/interface/gen-rb/blur_types.rb +++ b/distribution/src/main/scripts/interface/gen-rb/blur_types.rb @@ -20,8 +20,9 @@ module Blur RUNNING = 0 INTERRUPTED = 1 COMPLETE = 2 - VALUE_MAP = {0 => "RUNNING", 1 => "INTERRUPTED", 2 => "COMPLETE"} - VALID_VALUES = Set.new([RUNNING, INTERRUPTED, COMPLETE]).freeze + BACK_PRESSURE_INTERRUPTED = 3 + VALUE_MAP = {0 => "RUNNING", 1 => "INTERRUPTED", 2 => "COMPLETE", 3 => "BACK_PRESSURE_INTERRUPTED"} + VALID_VALUES = Set.new([RUNNING, INTERRUPTED, COMPLETE, BACK_PRESSURE_INTERRUPTED]).freeze end module RowMutationType @@ -74,6 +75,29 @@ module Blur ::Thrift::Struct.generate_accessors self end + # BackPressureException that carries a message. + class BackPressureException < ::Thrift::Exception + include ::Thrift::Struct, ::Thrift::Struct_Union + def initialize(message=nil) + super() + self.message = message + end + + MESSAGE = 1 + + FIELDS = { + # The message in the exception. + MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + # Column is the lowest storage element in Blur, it stores a single name and value pair. class Column include ::Thrift::Struct, ::Thrift::Struct_Union
