diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java index daf9ce6..d8f201f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java +++ b/hbase-server/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/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift/generated/TScan.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift/generated/TScan.java index b5a5884..4c6686f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift/generated/TScan.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift/generated/TScan.java @@ -41,7 +41,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 { @@ -54,6 +55,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. */ @@ -63,7 +65,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(); @@ -88,7 +91,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; @@ -133,7 +138,10 @@ public class TScan implements org.apache.thrift.TBase, jav private static final int __TIMESTAMP_ISSET_ID = 0; private static final int __CACHING_ISSET_ID = 1; private byte __isset_bitfield = 0; - 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); @@ -148,6 +156,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); @@ -177,6 +187,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; } @@ -195,6 +206,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; } @@ -351,6 +364,29 @@ public class TScan implements org.apache.thrift.TBase, jav __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __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(); @@ -427,6 +463,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(); @@ -455,6 +499,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(); @@ -479,6 +526,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(); } @@ -543,6 +592,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) { @@ -618,6 +676,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; @@ -689,6 +757,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:"); @@ -771,13 +845,14 @@ 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; // required - _elem20 = iprot.readBinary(); - struct.columns.add(_elem20); + ByteBuffer _elem18; // required + _elem18 = iprot.readBinary(); + struct.columns.add(_elem18); + } iprot.readListEnd(); } @@ -794,7 +869,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); @@ -841,9 +924,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(); } @@ -855,6 +938,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); @@ -895,10 +983,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); } @@ -911,15 +1002,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); } @@ -928,7 +1022,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); @@ -943,13 +1037,14 @@ 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; // required - _elem25 = iprot.readBinary(); - struct.columns.add(_elem25); + ByteBuffer _elem23; // required + _elem23 = iprot.readBinary(); + struct.columns.add(_elem23); + } } struct.setColumnsIsSet(true); @@ -959,6 +1054,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); } diff --git a/hbase-server/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift b/hbase-server/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift index 9c2f8b1..3ed88b2 100644 --- a/hbase-server/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift +++ b/hbase-server/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 } //