diff --git a/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java b/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java index 36fd7fe..6b00856 100644 --- a/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java +++ b/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java @@ -1158,6 +1158,9 @@ public class ThriftServerRunner implements Runnable { if (tScan.isSetCaching()) { scan.setCaching(tScan.getCaching()); } + if (tScan.isSetBatchSize()) { + scan.setBatch(tScan.getBatchSize()); + } if (tScan.isSetColumns() && tScan.getColumns().size() != 0) { for(ByteBuffer column : tScan.getColumns()) { byte [][] famQf = KeyValue.parseColumn(getBytes(column)); diff --git a/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift b/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift index 4b81b1e..cd0c6bf 100644 --- a/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift +++ b/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift @@ -138,7 +138,8 @@ struct TScan { 3:optional i64 timestamp, 4:optional list columns, 5:optional i32 caching, - 6:optional Text filterString + 6:optional i32 batchSize, + 7:optional Text filterString } // diff --git a/src/main/java/org/apache/hadoop/hbase/thrift/generated/TScan.java b/src/main/java/org/apache/hadoop/hbase/thrift/generated/TScan.java index f7cc05d..9ed9bf0 100644 --- a/src/main/java/org/apache/hadoop/hbase/thrift/generated/TScan.java +++ b/src/main/java/org/apache/hadoop/hbase/thrift/generated/TScan.java @@ -38,7 +38,8 @@ public class TScan implements org.apache.thrift.TBase, jav private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)4); private static final org.apache.thrift.protocol.TField CACHING_FIELD_DESC = new org.apache.thrift.protocol.TField("caching", org.apache.thrift.protocol.TType.I32, (short)5); - private static final org.apache.thrift.protocol.TField FILTER_STRING_FIELD_DESC = new org.apache.thrift.protocol.TField("filterString", org.apache.thrift.protocol.TType.STRING, (short)6); + private static final org.apache.thrift.protocol.TField BATCH_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("batchSize", org.apache.thrift.protocol.TType.I32, (short)6); + private static final org.apache.thrift.protocol.TField FILTER_STRING_FIELD_DESC = new org.apache.thrift.protocol.TField("filterString", org.apache.thrift.protocol.TType.STRING, (short)7); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -51,6 +52,7 @@ public class TScan implements org.apache.thrift.TBase, jav public long timestamp; // optional public List columns; // optional public int caching; // optional + public int batchSize; // optional public ByteBuffer filterString; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -60,7 +62,8 @@ public class TScan implements org.apache.thrift.TBase, jav TIMESTAMP((short)3, "timestamp"), COLUMNS((short)4, "columns"), CACHING((short)5, "caching"), - FILTER_STRING((short)6, "filterString"); + BATCH_SIZE((short)6, "batchSize"), + FILTER_STRING((short)7, "filterString"); private static final Map byName = new HashMap(); @@ -85,7 +88,9 @@ public class TScan implements org.apache.thrift.TBase, jav return COLUMNS; case 5: // CACHING return CACHING; - case 6: // FILTER_STRING + case 6: // BATCH_SIZE + return BATCH_SIZE; + case 7: // FILTER_STRING return FILTER_STRING; default: return null; @@ -129,8 +134,9 @@ public class TScan implements org.apache.thrift.TBase, jav // isset id assignments private static final int __TIMESTAMP_ISSET_ID = 0; private static final int __CACHING_ISSET_ID = 1; - private BitSet __isset_bit_vector = new BitSet(2); - private _Fields optionals[] = {_Fields.START_ROW,_Fields.STOP_ROW,_Fields.TIMESTAMP,_Fields.COLUMNS,_Fields.CACHING,_Fields.FILTER_STRING}; + private static final int __BATCHSIZE_ISSET_ID = 2; + private BitSet __isset_bit_vector = new BitSet(3); + private _Fields optionals[] = {_Fields.START_ROW,_Fields.STOP_ROW,_Fields.TIMESTAMP,_Fields.COLUMNS,_Fields.CACHING,_Fields.BATCH_SIZE,_Fields.FILTER_STRING}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -145,6 +151,8 @@ public class TScan implements org.apache.thrift.TBase, jav new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")))); tmpMap.put(_Fields.CACHING, new org.apache.thrift.meta_data.FieldMetaData("caching", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.BATCH_SIZE, new org.apache.thrift.meta_data.FieldMetaData("batchSize", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.FILTER_STRING, new org.apache.thrift.meta_data.FieldMetaData("filterString", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"))); metaDataMap = Collections.unmodifiableMap(tmpMap); @@ -175,6 +183,7 @@ public class TScan implements org.apache.thrift.TBase, jav this.columns = __this__columns; } this.caching = other.caching; + this.batchSize = other.batchSize; if (other.isSetFilterString()) { this.filterString = other.filterString; } @@ -193,6 +202,8 @@ public class TScan implements org.apache.thrift.TBase, jav this.columns = null; setCachingIsSet(false); this.caching = 0; + setBatchSizeIsSet(false); + this.batchSize = 0; this.filterString = null; } @@ -349,6 +360,29 @@ public class TScan implements org.apache.thrift.TBase, jav __isset_bit_vector.set(__CACHING_ISSET_ID, value); } + public int getBatchSize() { + return this.batchSize; + } + + public TScan setBatchSize(int batchSize) { + this.batchSize = batchSize; + setBatchSizeIsSet(true); + return this; + } + + public void unsetBatchSize() { + __isset_bit_vector.clear(__BATCHSIZE_ISSET_ID); + } + + /** Returns true if field batchSize is set (has been assigned a value) and false otherwise */ + public boolean isSetBatchSize() { + return __isset_bit_vector.get(__BATCHSIZE_ISSET_ID); + } + + public void setBatchSizeIsSet(boolean value) { + __isset_bit_vector.set(__BATCHSIZE_ISSET_ID, value); + } + public byte[] getFilterString() { setFilterString(org.apache.thrift.TBaseHelper.rightSize(filterString)); return filterString == null ? null : filterString.array(); @@ -425,6 +459,14 @@ public class TScan implements org.apache.thrift.TBase, jav } break; + case BATCH_SIZE: + if (value == null) { + unsetBatchSize(); + } else { + setBatchSize((Integer)value); + } + break; + case FILTER_STRING: if (value == null) { unsetFilterString(); @@ -453,6 +495,9 @@ public class TScan implements org.apache.thrift.TBase, jav case CACHING: return Integer.valueOf(getCaching()); + case BATCH_SIZE: + return Integer.valueOf(getBatchSize()); + case FILTER_STRING: return getFilterString(); @@ -477,6 +522,8 @@ public class TScan implements org.apache.thrift.TBase, jav return isSetColumns(); case CACHING: return isSetCaching(); + case BATCH_SIZE: + return isSetBatchSize(); case FILTER_STRING: return isSetFilterString(); } @@ -541,6 +588,15 @@ public class TScan implements org.apache.thrift.TBase, jav return false; } + boolean this_present_batchSize = true && this.isSetBatchSize(); + boolean that_present_batchSize = true && that.isSetBatchSize(); + if (this_present_batchSize || that_present_batchSize) { + if (!(this_present_batchSize && that_present_batchSize)) + return false; + if (this.batchSize != that.batchSize) + return false; + } + boolean this_present_filterString = true && this.isSetFilterString(); boolean that_present_filterString = true && that.isSetFilterString(); if (this_present_filterString || that_present_filterString) { @@ -616,6 +672,16 @@ public class TScan implements org.apache.thrift.TBase, jav return lastComparison; } } + lastComparison = Boolean.valueOf(isSetBatchSize()).compareTo(typedOther.isSetBatchSize()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetBatchSize()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.batchSize, typedOther.batchSize); + if (lastComparison != 0) { + return lastComparison; + } + } lastComparison = Boolean.valueOf(isSetFilterString()).compareTo(typedOther.isSetFilterString()); if (lastComparison != 0) { return lastComparison; @@ -687,6 +753,12 @@ public class TScan implements org.apache.thrift.TBase, jav sb.append(this.caching); first = false; } + if (isSetBatchSize()) { + if (!first) sb.append(", "); + sb.append("batchSize:"); + sb.append(this.batchSize); + first = false; + } if (isSetFilterString()) { if (!first) sb.append(", "); sb.append("filterString:"); @@ -768,13 +840,13 @@ public class TScan implements org.apache.thrift.TBase, jav case 4: // COLUMNS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list18 = iprot.readListBegin(); - struct.columns = new ArrayList(_list18.size); - for (int _i19 = 0; _i19 < _list18.size; ++_i19) + org.apache.thrift.protocol.TList _list16 = iprot.readListBegin(); + struct.columns = new ArrayList(_list16.size); + for (int _i17 = 0; _i17 < _list16.size; ++_i17) { - ByteBuffer _elem20; // optional - _elem20 = iprot.readBinary(); - struct.columns.add(_elem20); + ByteBuffer _elem18; // required + _elem18 = iprot.readBinary(); + struct.columns.add(_elem18); } iprot.readListEnd(); } @@ -791,7 +863,15 @@ public class TScan implements org.apache.thrift.TBase, jav org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 6: // FILTER_STRING + case 6: // BATCH_SIZE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.batchSize = iprot.readI32(); + struct.setBatchSizeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // FILTER_STRING if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.filterString = iprot.readBinary(); struct.setFilterStringIsSet(true); @@ -838,9 +918,9 @@ public class TScan implements org.apache.thrift.TBase, jav oprot.writeFieldBegin(COLUMNS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.columns.size())); - for (ByteBuffer _iter21 : struct.columns) + for (ByteBuffer _iter19 : struct.columns) { - oprot.writeBinary(_iter21); + oprot.writeBinary(_iter19); } oprot.writeListEnd(); } @@ -852,6 +932,11 @@ public class TScan implements org.apache.thrift.TBase, jav oprot.writeI32(struct.caching); oprot.writeFieldEnd(); } + if (struct.isSetBatchSize()) { + oprot.writeFieldBegin(BATCH_SIZE_FIELD_DESC); + oprot.writeI32(struct.batchSize); + oprot.writeFieldEnd(); + } if (struct.filterString != null) { if (struct.isSetFilterString()) { oprot.writeFieldBegin(FILTER_STRING_FIELD_DESC); @@ -892,10 +977,13 @@ public class TScan implements org.apache.thrift.TBase, jav if (struct.isSetCaching()) { optionals.set(4); } - if (struct.isSetFilterString()) { + if (struct.isSetBatchSize()) { optionals.set(5); } - oprot.writeBitSet(optionals, 6); + if (struct.isSetFilterString()) { + optionals.set(6); + } + oprot.writeBitSet(optionals, 7); if (struct.isSetStartRow()) { oprot.writeBinary(struct.startRow); } @@ -908,15 +996,18 @@ public class TScan implements org.apache.thrift.TBase, jav if (struct.isSetColumns()) { { oprot.writeI32(struct.columns.size()); - for (ByteBuffer _iter22 : struct.columns) + for (ByteBuffer _iter20 : struct.columns) { - oprot.writeBinary(_iter22); + oprot.writeBinary(_iter20); } } } if (struct.isSetCaching()) { oprot.writeI32(struct.caching); } + if (struct.isSetBatchSize()) { + oprot.writeI32(struct.batchSize); + } if (struct.isSetFilterString()) { oprot.writeBinary(struct.filterString); } @@ -925,7 +1016,7 @@ public class TScan implements org.apache.thrift.TBase, jav @Override public void read(org.apache.thrift.protocol.TProtocol prot, TScan struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(6); + BitSet incoming = iprot.readBitSet(7); if (incoming.get(0)) { struct.startRow = iprot.readBinary(); struct.setStartRowIsSet(true); @@ -940,13 +1031,13 @@ public class TScan implements org.apache.thrift.TBase, jav } if (incoming.get(3)) { { - org.apache.thrift.protocol.TList _list23 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.columns = new ArrayList(_list23.size); - for (int _i24 = 0; _i24 < _list23.size; ++_i24) + org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.columns = new ArrayList(_list21.size); + for (int _i22 = 0; _i22 < _list21.size; ++_i22) { - ByteBuffer _elem25; // optional - _elem25 = iprot.readBinary(); - struct.columns.add(_elem25); + ByteBuffer _elem23; // required + _elem23 = iprot.readBinary(); + struct.columns.add(_elem23); } } struct.setColumnsIsSet(true); @@ -956,6 +1047,10 @@ public class TScan implements org.apache.thrift.TBase, jav struct.setCachingIsSet(true); } if (incoming.get(5)) { + struct.batchSize = iprot.readI32(); + struct.setBatchSizeIsSet(true); + } + if (incoming.get(6)) { struct.filterString = iprot.readBinary(); struct.setFilterStringIsSet(true); }