From dc3d48472ecdd6682a0dabf42dd2ed7d01ec5ffb Mon Sep 17 00:00:00 2001 From: Rahul Gidwani Date: Wed, 17 Feb 2016 14:16:23 -0800 Subject: [PATCH] HBASE-15130 - Backport 0.98 Scan different TimeRange for each column family --- .../java/org/apache/hadoop/hbase/client/Get.java | 17 + .../java/org/apache/hadoop/hbase/client/Query.java | 42 + .../java/org/apache/hadoop/hbase/client/Scan.java | 12 + .../apache/hadoop/hbase/protobuf/ProtobufUtil.java | 104 ++- .../java/org/apache/hadoop/hbase/io/TimeRange.java | 16 +- .../hbase/protobuf/generated/ClientProtos.java | 965 ++++++++++++++++++--- .../hbase/protobuf/generated/HBaseProtos.java | 717 ++++++++++++++- hbase-protocol/src/main/protobuf/Client.proto | 2 + hbase-protocol/src/main/protobuf/HBase.proto | 6 + .../hadoop/hbase/regionserver/KeyValueScanner.java | 5 +- .../apache/hadoop/hbase/regionserver/MemStore.java | 17 +- .../hbase/regionserver/NonLazyKeyValueScanner.java | 3 +- .../hbase/regionserver/ScanQueryMatcher.java | 7 +- .../hadoop/hbase/regionserver/StoreFile.java | 7 +- .../hbase/regionserver/StoreFileScanner.java | 16 +- .../hadoop/hbase/regionserver/StoreScanner.java | 2 +- .../hadoop/hbase/io/hfile/TestHFileWriterV2.java | 2 +- .../regionserver/TestCompoundBloomFilter.java | 12 +- .../hadoop/hbase/regionserver/TestMemStore.java | 36 +- .../hadoop/hbase/regionserver/TestStoreFile.java | 58 +- 20 files changed, 1832 insertions(+), 214 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Get.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Get.java index 0abc09d..590aa5a 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Get.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Get.java @@ -120,6 +120,10 @@ public class Get extends Query for (Map.Entry attr : get.getAttributesMap().entrySet()) { setAttribute(attr.getKey(), attr.getValue()); } + for (Map.Entry entry : get.getColumnFamilyTimeRange().entrySet()) { + TimeRange tr = entry.getValue(); + setColumnFamilyTimeRange(entry.getKey(), tr.getMin(), tr.getMax()); + } } public boolean isCheckExistenceOnly() { @@ -227,6 +231,19 @@ public class Get extends Query } /** + * Get versions of columns only within the specified timestamp range and column family, + * [cf, minStamp, maxStamp). + * @param cf the column family to restrict + * @param minStamp minimum timestamp value, inclusive + * @param maxStamp maximum timestamp value, exclusive + * @throws IOException if invalid time range + * @return this for invocation chaining + */ + public Get setColumnFamilyTimeRange(byte[] cf, long minStamp, long maxStamp) { + return (Get) super.setColumnFamilyTimeRange(cf, minStamp, maxStamp); + } + + /* * Set the maximum number of values to return per row per Column Family * @param limit the maximum number of values returned / row / CF * @return this for invocation chaining diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Query.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Query.java index 423e401..79762ac 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Query.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Query.java @@ -17,12 +17,15 @@ */ package org.apache.hadoop.hbase.client; +import java.io.IOException; import java.util.Map; +import com.google.common.collect.Maps; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.classification.InterfaceStability; import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.filter.Filter; +import org.apache.hadoop.hbase.io.TimeRange; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.security.access.AccessControlConstants; import org.apache.hadoop.hbase.security.access.Permission; @@ -31,12 +34,14 @@ import org.apache.hadoop.hbase.security.visibility.VisibilityConstants; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; +import org.apache.hadoop.hbase.util.Bytes; @InterfaceAudience.Public @InterfaceStability.Evolving public abstract class Query extends OperationWithAttributes { private static final String ISOLATION_LEVEL = "_isolationlevel_"; protected Filter filter = null; + protected Map colFamTimeRangeMap = null; /** * @return Filter @@ -46,6 +51,33 @@ public abstract class Query extends OperationWithAttributes { } /** + * Get versions of columns only within the specified timestamp range, + * [minStamp, maxStamp) on a per CF bases. Note, default maximum versions to return is 1. If + * your time range spans more than one version and you want all versions + * returned, up the number of versions beyond the default. + * Column Family time ranges take precedence over the global time range. + * + * @param cf the column family for which you want to restrict + * @param minStamp minimum timestamp value, inclusive + * @param maxStamp maximum timestamp value, exclusive + * @return this + * @see Scan#setMaxVersions() + * @see Scan#setMaxVersions(int) + */ + + public Query setColumnFamilyTimeRange(byte[] cf, long minStamp, long maxStamp) { + if (this.colFamTimeRangeMap == null) { + this.colFamTimeRangeMap = Maps.newTreeMap(Bytes.BYTES_COMPARATOR); + } + try { + colFamTimeRangeMap.put(cf, new TimeRange(minStamp, maxStamp)); + return this; + } catch (IOException ioe) { + throw new IllegalArgumentException(ioe); + } + } + + /** * Apply the specified server-side filter when performing the Query. * Only {@link Filter#filterKeyValue(Cell)} is called AFTER all tests * for ttl, column match, deletes and max versions have been run. @@ -150,4 +182,14 @@ public abstract class Query extends OperationWithAttributes { return attr == null ? IsolationLevel.READ_COMMITTED : IsolationLevel.fromBytes(attr); } + + /** + * @return Map a map of column families to time ranges + */ + public Map getColumnFamilyTimeRange() { + if (this.colFamTimeRangeMap == null) { + this.colFamTimeRangeMap = Maps.newTreeMap(Bytes.BYTES_COMPARATOR); + } + return this.colFamTimeRangeMap; + } } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java index f1fede5..6264a72 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java @@ -234,6 +234,10 @@ public class Scan extends Query { for (Map.Entry attr : scan.getAttributesMap().entrySet()) { setAttribute(attr.getKey(), attr.getValue()); } + for (Map.Entry entry : scan.getColumnFamilyTimeRange().entrySet()) { + TimeRange tr = entry.getValue(); + setColumnFamilyTimeRange(entry.getKey(), tr.getMin(), tr.getMax()); + } } /** @@ -254,6 +258,10 @@ public class Scan extends Query { for (Map.Entry attr : get.getAttributesMap().entrySet()) { setAttribute(attr.getKey(), attr.getValue()); } + for (Map.Entry entry : get.getColumnFamilyTimeRange().entrySet()) { + TimeRange tr = entry.getValue(); + setColumnFamilyTimeRange(entry.getKey(), tr.getMin(), tr.getMax()); + } } public boolean isGetScan() { @@ -316,6 +324,10 @@ public class Scan extends Query { return this; } + @Override public Scan setColumnFamilyTimeRange(byte[] cf, long minStamp, long maxStamp) { + return (Scan) super.setColumnFamilyTimeRange(cf, minStamp, maxStamp); + } + /** * Get versions of columns with the specified timestamp. Note, default maximum * versions to return is 1. If your time range spans more than one version diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java index 15c937e..7e41955 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java @@ -21,6 +21,7 @@ package org.apache.hadoop.hbase.protobuf; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; import com.google.common.collect.Lists; +import com.google.common.collect.Maps; import com.google.protobuf.ByteString; import com.google.protobuf.CodedInputStream; import com.google.protobuf.InvalidProtocolBufferException; @@ -438,17 +439,16 @@ public final class ProtobufUtil { if (proto.hasStoreOffset()) { get.setRowOffsetPerColumnFamily(proto.getStoreOffset()); } - if (proto.hasTimeRange()) { - HBaseProtos.TimeRange timeRange = proto.getTimeRange(); - long minStamp = 0; - long maxStamp = Long.MAX_VALUE; - if (timeRange.hasFrom()) { - minStamp = timeRange.getFrom(); + if (proto.getCfTimeRangeCount() > 0) { + for (HBaseProtos.ColumnFamilyTimeRange cftr : proto.getCfTimeRangeList()) { + TimeRange timeRange = protoToTimeRange(cftr.getTimeRange()); + get.setColumnFamilyTimeRange(cftr.getColumnFamily().toByteArray(), + timeRange.getMin(), timeRange.getMax()); } - if (timeRange.hasTo()) { - maxStamp = timeRange.getTo(); - } - get.setTimeRange(minStamp, maxStamp); + } + if (proto.hasTimeRange()) { + TimeRange timeRange = protoToTimeRange(proto.getTimeRange()); + get.setTimeRange(timeRange.getMin(), timeRange.getMax()); } if (proto.hasFilter()) { FilterProtos.Filter filter = proto.getFilter(); @@ -833,6 +833,12 @@ public final class ProtobufUtil { scanBuilder.setLoadColumnFamiliesOnDemand(loadColumnFamiliesOnDemand.booleanValue()); } scanBuilder.setMaxVersions(scan.getMaxVersions()); + for (Entry cftr : scan.getColumnFamilyTimeRange().entrySet()) { + HBaseProtos.ColumnFamilyTimeRange.Builder b = HBaseProtos.ColumnFamilyTimeRange.newBuilder(); + b.setColumnFamily(ByteString.copyFrom(cftr.getKey())); + b.setTimeRange(timeRangeToProto(cftr.getValue())); + scanBuilder.addCfTimeRange(b); + } TimeRange timeRange = scan.getTimeRange(); if (!timeRange.isAllTime()) { HBaseProtos.TimeRange.Builder timeRangeBuilder = @@ -924,17 +930,16 @@ public final class ProtobufUtil { if (proto.hasLoadColumnFamiliesOnDemand()) { scan.setLoadColumnFamiliesOnDemand(proto.getLoadColumnFamiliesOnDemand()); } - if (proto.hasTimeRange()) { - HBaseProtos.TimeRange timeRange = proto.getTimeRange(); - long minStamp = 0; - long maxStamp = Long.MAX_VALUE; - if (timeRange.hasFrom()) { - minStamp = timeRange.getFrom(); + if (proto.getCfTimeRangeCount() > 0) { + for (HBaseProtos.ColumnFamilyTimeRange cftr : proto.getCfTimeRangeList()) { + TimeRange timeRange = protoToTimeRange(cftr.getTimeRange()); + scan.setColumnFamilyTimeRange(cftr.getColumnFamily().toByteArray(), + timeRange.getMin(), timeRange.getMax()); } - if (timeRange.hasTo()) { - maxStamp = timeRange.getTo(); - } - scan.setTimeRange(minStamp, maxStamp); + } + if (proto.hasTimeRange()) { + TimeRange timeRange = protoToTimeRange(proto.getTimeRange()); + scan.setTimeRange(timeRange.getMin(), timeRange.getMax()); } if (proto.hasFilter()) { FilterProtos.Filter filter = proto.getFilter(); @@ -990,6 +995,12 @@ public final class ProtobufUtil { if (get.getFilter() != null) { builder.setFilter(ProtobufUtil.toFilter(get.getFilter())); } + for (Entry cftr : get.getColumnFamilyTimeRange().entrySet()) { + HBaseProtos.ColumnFamilyTimeRange.Builder b = HBaseProtos.ColumnFamilyTimeRange.newBuilder(); + b.setColumnFamily(ByteString.copyFrom(cftr.getKey())); + b.setTimeRange(timeRangeToProto(cftr.getValue())); + builder.addCfTimeRange(b); + } TimeRange timeRange = get.getTimeRange(); if (!timeRange.isAllTime()) { HBaseProtos.TimeRange.Builder timeRangeBuilder = @@ -1863,7 +1874,7 @@ public final class ProtobufUtil { final HRegionInfo region_a, final HRegionInfo region_b, final boolean forcible) throws IOException { MergeRegionsRequest request = RequestConverter.buildMergeRegionsRequest( - region_a.getRegionName(), region_b.getRegionName(),forcible); + region_a.getRegionName(), region_b.getRegionName(), forcible); try { admin.mergeRegions(null, request); } catch (ServiceException se) { @@ -2221,8 +2232,8 @@ public final class ProtobufUtil { permActions.add(ProtobufUtil.toPermissionAction(a)); } AccessControlProtos.RevokeRequest request = RequestConverter. - buildRevokeRequest(userShortName, permActions.toArray( - new AccessControlProtos.Permission.Action[actions.length])); + buildRevokeRequest(userShortName, + permActions.toArray(new AccessControlProtos.Permission.Action[actions.length])); protocol.revoke(null, request); } @@ -2249,8 +2260,8 @@ public final class ProtobufUtil { permActions.add(ProtobufUtil.toPermissionAction(a)); } AccessControlProtos.RevokeRequest request = RequestConverter. - buildRevokeRequest(userShortName, tableName, f, q, permActions.toArray( - new AccessControlProtos.Permission.Action[actions.length])); + buildRevokeRequest(userShortName, tableName, f, q, + permActions.toArray(new AccessControlProtos.Permission.Action[actions.length])); protocol.revoke(null, request); } @@ -2274,8 +2285,8 @@ public final class ProtobufUtil { permActions.add(ProtobufUtil.toPermissionAction(a)); } AccessControlProtos.RevokeRequest request = RequestConverter. - buildRevokeRequest(userShortName, namespace, permActions.toArray( - new AccessControlProtos.Permission.Action[actions.length])); + buildRevokeRequest(userShortName, namespace, + permActions.toArray(new AccessControlProtos.Permission.Action[actions.length])); protocol.revoke(null, request); } @@ -2503,12 +2514,9 @@ public final class ProtobufUtil { public static Cell toCell(final CellProtos.Cell cell) { // Doing this is going to kill us if we do it for all data passed. // St.Ack 20121205 - return CellUtil.createCell(cell.getRow().toByteArray(), - cell.getFamily().toByteArray(), - cell.getQualifier().toByteArray(), - cell.getTimestamp(), - (byte)cell.getCellType().getNumber(), - cell.getValue().toByteArray()); + return CellUtil.createCell(cell.getRow().toByteArray(), cell.getFamily().toByteArray(), + cell.getQualifier().toByteArray(), cell.getTimestamp(), + (byte) cell.getCellType().getNumber(), cell.getValue().toByteArray()); } public static HBaseProtos.NamespaceDescriptor toProtoNamespaceDescriptor(NamespaceDescriptor ns) { @@ -2968,4 +2976,34 @@ public final class ProtobufUtil { } return scList; } + private static HBaseProtos.TimeRange.Builder timeRangeToProto(TimeRange timeRange) { + HBaseProtos.TimeRange.Builder timeRangeBuilder = + HBaseProtos.TimeRange.newBuilder(); + timeRangeBuilder.setFrom(timeRange.getMin()); + timeRangeBuilder.setTo(timeRange.getMax()); + return timeRangeBuilder; + } + + private static TimeRange protoToTimeRange(HBaseProtos.TimeRange timeRange) throws IOException { + long minStamp = 0; + long maxStamp = Long.MAX_VALUE; + if (timeRange.hasFrom()) { + minStamp = timeRange.getFrom(); + } + if (timeRange.hasTo()) { + maxStamp = timeRange.getTo(); + } + return new TimeRange(minStamp, maxStamp); + } + + private static Map convert(List cftrs) + throws IOException { + Map result = Maps.newTreeMap(Bytes.BYTES_COMPARATOR); + for (HBaseProtos.ColumnFamilyTimeRange cftr : cftrs) { + HBaseProtos.TimeRange tr = cftr.getTimeRange(); + result.put(cftr.getColumnFamily().toByteArray(), new TimeRange(tr.getFrom(), tr.getTo())); + } + return result; + } + } diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/TimeRange.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/TimeRange.java index 86f3540..10e8efb 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/TimeRange.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/TimeRange.java @@ -43,7 +43,9 @@ public class TimeRange { /** * Default constructor. * Represents interval [0, Long.MAX_VALUE) (allTime) + * @deprecated This is made @InterfaceAudience.Private in the 2.0 line and above */ + @Deprecated public TimeRange() { allTime = true; } @@ -51,7 +53,9 @@ public class TimeRange { /** * Represents interval [minStamp, Long.MAX_VALUE) * @param minStamp the minimum timestamp value, inclusive + * @deprecated This is made @InterfaceAudience.Private in the 2.0 line and above */ + @Deprecated public TimeRange(long minStamp) { this.minStamp = minStamp; } @@ -59,7 +63,9 @@ public class TimeRange { /** * Represents interval [minStamp, Long.MAX_VALUE) * @param minStamp the minimum timestamp value, inclusive + * @deprecated This is made @InterfaceAudience.Private in the 2.0 line and above */ + @Deprecated public TimeRange(byte [] minStamp) { this.minStamp = Bytes.toLong(minStamp); } @@ -68,10 +74,12 @@ public class TimeRange { * Represents interval [minStamp, maxStamp) * @param minStamp the minimum timestamp, inclusive * @param maxStamp the maximum timestamp, exclusive - * @throws IOException + * @throws IllegalArgumentException if either <0, + * @throws IOException if max smaller than min. + * @deprecated This is made @InterfaceAudience.Private in the 2.0 line and above */ - public TimeRange(long minStamp, long maxStamp) - throws IOException { + @Deprecated + public TimeRange(long minStamp, long maxStamp) throws IOException { if (minStamp < 0 || maxStamp < 0) { throw new IllegalArgumentException("Timestamp cannot be negative. minStamp:" + minStamp + ", maxStamp" + maxStamp); @@ -88,7 +96,9 @@ public class TimeRange { * @param minStamp the minimum timestamp, inclusive * @param maxStamp the maximum timestamp, exclusive * @throws IOException + * @deprecated This is made @InterfaceAudience.Private in the 2.0 line and above */ + @Deprecated public TimeRange(byte [] minStamp, byte [] maxStamp) throws IOException { this(Bytes.toLong(minStamp), Bytes.toLong(maxStamp)); diff --git a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/ClientProtos.java b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/ClientProtos.java index 805aadb..2274cf6 100644 --- a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/ClientProtos.java +++ b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/ClientProtos.java @@ -1858,6 +1858,31 @@ public final class ClientProtos { * */ boolean getClosestRowBefore(); + + // repeated .ColumnFamilyTimeRange cf_time_range = 13; + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + java.util.List + getCfTimeRangeList(); + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange getCfTimeRange(int index); + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + int getCfTimeRangeCount(); + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + java.util.List + getCfTimeRangeOrBuilderList(); + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRangeOrBuilder getCfTimeRangeOrBuilder( + int index); } /** * Protobuf type {@code Get} @@ -1995,6 +2020,14 @@ public final class ClientProtos { closestRowBefore_ = input.readBool(); break; } + case 106: { + if (!((mutable_bitField0_ & 0x00000800) == 0x00000800)) { + cfTimeRange_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000800; + } + cfTimeRange_.add(input.readMessage(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.PARSER, extensionRegistry)); + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -2009,6 +2042,9 @@ public final class ClientProtos { if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { attribute_ = java.util.Collections.unmodifiableList(attribute_); } + if (((mutable_bitField0_ & 0x00000800) == 0x00000800)) { + cfTimeRange_ = java.util.Collections.unmodifiableList(cfTimeRange_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -2289,6 +2325,42 @@ public final class ClientProtos { return closestRowBefore_; } + // repeated .ColumnFamilyTimeRange cf_time_range = 13; + public static final int CF_TIME_RANGE_FIELD_NUMBER = 13; + private java.util.List cfTimeRange_; + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public java.util.List getCfTimeRangeList() { + return cfTimeRange_; + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public java.util.List + getCfTimeRangeOrBuilderList() { + return cfTimeRange_; + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public int getCfTimeRangeCount() { + return cfTimeRange_.size(); + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange getCfTimeRange(int index) { + return cfTimeRange_.get(index); + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRangeOrBuilder getCfTimeRangeOrBuilder( + int index) { + return cfTimeRange_.get(index); + } + private void initFields() { row_ = com.google.protobuf.ByteString.EMPTY; column_ = java.util.Collections.emptyList(); @@ -2301,6 +2373,7 @@ public final class ClientProtos { storeOffset_ = 0; existenceOnly_ = false; closestRowBefore_ = false; + cfTimeRange_ = java.util.Collections.emptyList(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -2329,6 +2402,12 @@ public final class ClientProtos { return false; } } + for (int i = 0; i < getCfTimeRangeCount(); i++) { + if (!getCfTimeRange(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } memoizedIsInitialized = 1; return true; } @@ -2369,6 +2448,9 @@ public final class ClientProtos { if (((bitField0_ & 0x00000100) == 0x00000100)) { output.writeBool(11, closestRowBefore_); } + for (int i = 0; i < cfTimeRange_.size(); i++) { + output.writeMessage(13, cfTimeRange_.get(i)); + } getUnknownFields().writeTo(output); } @@ -2422,6 +2504,10 @@ public final class ClientProtos { size += com.google.protobuf.CodedOutputStream .computeBoolSize(11, closestRowBefore_); } + for (int i = 0; i < cfTimeRange_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(13, cfTimeRange_.get(i)); + } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; @@ -2494,6 +2580,8 @@ public final class ClientProtos { result = result && (getClosestRowBefore() == other.getClosestRowBefore()); } + result = result && getCfTimeRangeList() + .equals(other.getCfTimeRangeList()); result = result && getUnknownFields().equals(other.getUnknownFields()); return result; @@ -2551,6 +2639,10 @@ public final class ClientProtos { hash = (37 * hash) + CLOSEST_ROW_BEFORE_FIELD_NUMBER; hash = (53 * hash) + hashBoolean(getClosestRowBefore()); } + if (getCfTimeRangeCount() > 0) { + hash = (37 * hash) + CF_TIME_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getCfTimeRangeList().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -2664,6 +2756,7 @@ public final class ClientProtos { getAttributeFieldBuilder(); getFilterFieldBuilder(); getTimeRangeFieldBuilder(); + getCfTimeRangeFieldBuilder(); } } private static Builder create() { @@ -2710,6 +2803,12 @@ public final class ClientProtos { bitField0_ = (bitField0_ & ~0x00000200); closestRowBefore_ = false; bitField0_ = (bitField0_ & ~0x00000400); + if (cfTimeRangeBuilder_ == null) { + cfTimeRange_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + } else { + cfTimeRangeBuilder_.clear(); + } return this; } @@ -2800,6 +2899,15 @@ public final class ClientProtos { to_bitField0_ |= 0x00000100; } result.closestRowBefore_ = closestRowBefore_; + if (cfTimeRangeBuilder_ == null) { + if (((bitField0_ & 0x00000800) == 0x00000800)) { + cfTimeRange_ = java.util.Collections.unmodifiableList(cfTimeRange_); + bitField0_ = (bitField0_ & ~0x00000800); + } + result.cfTimeRange_ = cfTimeRange_; + } else { + result.cfTimeRange_ = cfTimeRangeBuilder_.build(); + } result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -2895,6 +3003,32 @@ public final class ClientProtos { if (other.hasClosestRowBefore()) { setClosestRowBefore(other.getClosestRowBefore()); } + if (cfTimeRangeBuilder_ == null) { + if (!other.cfTimeRange_.isEmpty()) { + if (cfTimeRange_.isEmpty()) { + cfTimeRange_ = other.cfTimeRange_; + bitField0_ = (bitField0_ & ~0x00000800); + } else { + ensureCfTimeRangeIsMutable(); + cfTimeRange_.addAll(other.cfTimeRange_); + } + onChanged(); + } + } else { + if (!other.cfTimeRange_.isEmpty()) { + if (cfTimeRangeBuilder_.isEmpty()) { + cfTimeRangeBuilder_.dispose(); + cfTimeRangeBuilder_ = null; + cfTimeRange_ = other.cfTimeRange_; + bitField0_ = (bitField0_ & ~0x00000800); + cfTimeRangeBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getCfTimeRangeFieldBuilder() : null; + } else { + cfTimeRangeBuilder_.addAllMessages(other.cfTimeRange_); + } + } + } this.mergeUnknownFields(other.getUnknownFields()); return this; } @@ -2922,6 +3056,12 @@ public final class ClientProtos { return false; } } + for (int i = 0; i < getCfTimeRangeCount(); i++) { + if (!getCfTimeRange(i).isInitialized()) { + + return false; + } + } return true; } @@ -3932,6 +4072,246 @@ public final class ClientProtos { return this; } + // repeated .ColumnFamilyTimeRange cf_time_range = 13; + private java.util.List cfTimeRange_ = + java.util.Collections.emptyList(); + private void ensureCfTimeRangeIsMutable() { + if (!((bitField0_ & 0x00000800) == 0x00000800)) { + cfTimeRange_ = new java.util.ArrayList(cfTimeRange_); + bitField0_ |= 0x00000800; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.Builder, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRangeOrBuilder> cfTimeRangeBuilder_; + + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public java.util.List getCfTimeRangeList() { + if (cfTimeRangeBuilder_ == null) { + return java.util.Collections.unmodifiableList(cfTimeRange_); + } else { + return cfTimeRangeBuilder_.getMessageList(); + } + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public int getCfTimeRangeCount() { + if (cfTimeRangeBuilder_ == null) { + return cfTimeRange_.size(); + } else { + return cfTimeRangeBuilder_.getCount(); + } + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange getCfTimeRange(int index) { + if (cfTimeRangeBuilder_ == null) { + return cfTimeRange_.get(index); + } else { + return cfTimeRangeBuilder_.getMessage(index); + } + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public Builder setCfTimeRange( + int index, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange value) { + if (cfTimeRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCfTimeRangeIsMutable(); + cfTimeRange_.set(index, value); + onChanged(); + } else { + cfTimeRangeBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public Builder setCfTimeRange( + int index, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.Builder builderForValue) { + if (cfTimeRangeBuilder_ == null) { + ensureCfTimeRangeIsMutable(); + cfTimeRange_.set(index, builderForValue.build()); + onChanged(); + } else { + cfTimeRangeBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public Builder addCfTimeRange(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange value) { + if (cfTimeRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCfTimeRangeIsMutable(); + cfTimeRange_.add(value); + onChanged(); + } else { + cfTimeRangeBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public Builder addCfTimeRange( + int index, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange value) { + if (cfTimeRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCfTimeRangeIsMutable(); + cfTimeRange_.add(index, value); + onChanged(); + } else { + cfTimeRangeBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public Builder addCfTimeRange( + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.Builder builderForValue) { + if (cfTimeRangeBuilder_ == null) { + ensureCfTimeRangeIsMutable(); + cfTimeRange_.add(builderForValue.build()); + onChanged(); + } else { + cfTimeRangeBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public Builder addCfTimeRange( + int index, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.Builder builderForValue) { + if (cfTimeRangeBuilder_ == null) { + ensureCfTimeRangeIsMutable(); + cfTimeRange_.add(index, builderForValue.build()); + onChanged(); + } else { + cfTimeRangeBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public Builder addAllCfTimeRange( + java.lang.Iterable values) { + if (cfTimeRangeBuilder_ == null) { + ensureCfTimeRangeIsMutable(); + super.addAll(values, cfTimeRange_); + onChanged(); + } else { + cfTimeRangeBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public Builder clearCfTimeRange() { + if (cfTimeRangeBuilder_ == null) { + cfTimeRange_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + } else { + cfTimeRangeBuilder_.clear(); + } + return this; + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public Builder removeCfTimeRange(int index) { + if (cfTimeRangeBuilder_ == null) { + ensureCfTimeRangeIsMutable(); + cfTimeRange_.remove(index); + onChanged(); + } else { + cfTimeRangeBuilder_.remove(index); + } + return this; + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.Builder getCfTimeRangeBuilder( + int index) { + return getCfTimeRangeFieldBuilder().getBuilder(index); + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRangeOrBuilder getCfTimeRangeOrBuilder( + int index) { + if (cfTimeRangeBuilder_ == null) { + return cfTimeRange_.get(index); } else { + return cfTimeRangeBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public java.util.List + getCfTimeRangeOrBuilderList() { + if (cfTimeRangeBuilder_ != null) { + return cfTimeRangeBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(cfTimeRange_); + } + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.Builder addCfTimeRangeBuilder() { + return getCfTimeRangeFieldBuilder().addBuilder( + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.getDefaultInstance()); + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.Builder addCfTimeRangeBuilder( + int index) { + return getCfTimeRangeFieldBuilder().addBuilder( + index, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.getDefaultInstance()); + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 13; + */ + public java.util.List + getCfTimeRangeBuilderList() { + return getCfTimeRangeFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.Builder, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRangeOrBuilder> + getCfTimeRangeFieldBuilder() { + if (cfTimeRangeBuilder_ == null) { + cfTimeRangeBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.Builder, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRangeOrBuilder>( + cfTimeRange_, + ((bitField0_ & 0x00000800) == 0x00000800), + getParentForChildren(), + isClean()); + cfTimeRange_ = null; + } + return cfTimeRangeBuilder_; + } + // @@protoc_insertion_point(builder_scope:Get) } @@ -13350,6 +13730,31 @@ public final class ClientProtos { * optional uint32 caching = 17; */ int getCaching(); + + // repeated .ColumnFamilyTimeRange cf_time_range = 19; + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + java.util.List + getCfTimeRangeList(); + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange getCfTimeRange(int index); + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + int getCfTimeRangeCount(); + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + java.util.List + getCfTimeRangeOrBuilderList(); + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRangeOrBuilder getCfTimeRangeOrBuilder( + int index); } /** * Protobuf type {@code Scan} @@ -13515,6 +13920,14 @@ public final class ClientProtos { caching_ = input.readUInt32(); break; } + case 154: { + if (!((mutable_bitField0_ & 0x00010000) == 0x00010000)) { + cfTimeRange_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00010000; + } + cfTimeRange_.add(input.readMessage(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.PARSER, extensionRegistry)); + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -13529,6 +13942,9 @@ public final class ClientProtos { if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { attribute_ = java.util.Collections.unmodifiableList(attribute_); } + if (((mutable_bitField0_ & 0x00010000) == 0x00010000)) { + cfTimeRange_ = java.util.Collections.unmodifiableList(cfTimeRange_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -13877,6 +14293,42 @@ public final class ClientProtos { return caching_; } + // repeated .ColumnFamilyTimeRange cf_time_range = 19; + public static final int CF_TIME_RANGE_FIELD_NUMBER = 19; + private java.util.List cfTimeRange_; + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public java.util.List getCfTimeRangeList() { + return cfTimeRange_; + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public java.util.List + getCfTimeRangeOrBuilderList() { + return cfTimeRange_; + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public int getCfTimeRangeCount() { + return cfTimeRange_.size(); + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange getCfTimeRange(int index) { + return cfTimeRange_.get(index); + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRangeOrBuilder getCfTimeRangeOrBuilder( + int index) { + return cfTimeRange_.get(index); + } + private void initFields() { column_ = java.util.Collections.emptyList(); attribute_ = java.util.Collections.emptyList(); @@ -13894,6 +14346,7 @@ public final class ClientProtos { small_ = false; reversed_ = false; caching_ = 0; + cfTimeRange_ = java.util.Collections.emptyList(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -13918,6 +14371,12 @@ public final class ClientProtos { return false; } } + for (int i = 0; i < getCfTimeRangeCount(); i++) { + if (!getCfTimeRange(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } memoizedIsInitialized = 1; return true; } @@ -13973,6 +14432,9 @@ public final class ClientProtos { if (((bitField0_ & 0x00002000) == 0x00002000)) { output.writeUInt32(17, caching_); } + for (int i = 0; i < cfTimeRange_.size(); i++) { + output.writeMessage(19, cfTimeRange_.get(i)); + } getUnknownFields().writeTo(output); } @@ -14046,6 +14508,10 @@ public final class ClientProtos { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(17, caching_); } + for (int i = 0; i < cfTimeRange_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(19, cfTimeRange_.get(i)); + } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; @@ -14143,6 +14609,8 @@ public final class ClientProtos { result = result && (getCaching() == other.getCaching()); } + result = result && getCfTimeRangeList() + .equals(other.getCfTimeRangeList()); result = result && getUnknownFields().equals(other.getUnknownFields()); return result; @@ -14220,6 +14688,10 @@ public final class ClientProtos { hash = (37 * hash) + CACHING_FIELD_NUMBER; hash = (53 * hash) + getCaching(); } + if (getCfTimeRangeCount() > 0) { + hash = (37 * hash) + CF_TIME_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getCfTimeRangeList().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -14336,6 +14808,7 @@ public final class ClientProtos { getAttributeFieldBuilder(); getFilterFieldBuilder(); getTimeRangeFieldBuilder(); + getCfTimeRangeFieldBuilder(); } } private static Builder create() { @@ -14392,6 +14865,12 @@ public final class ClientProtos { bitField0_ = (bitField0_ & ~0x00004000); caching_ = 0; bitField0_ = (bitField0_ & ~0x00008000); + if (cfTimeRangeBuilder_ == null) { + cfTimeRange_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00010000); + } else { + cfTimeRangeBuilder_.clear(); + } return this; } @@ -14502,6 +14981,15 @@ public final class ClientProtos { to_bitField0_ |= 0x00002000; } result.caching_ = caching_; + if (cfTimeRangeBuilder_ == null) { + if (((bitField0_ & 0x00010000) == 0x00010000)) { + cfTimeRange_ = java.util.Collections.unmodifiableList(cfTimeRange_); + bitField0_ = (bitField0_ & ~0x00010000); + } + result.cfTimeRange_ = cfTimeRange_; + } else { + result.cfTimeRange_ = cfTimeRangeBuilder_.build(); + } result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -14612,6 +15100,32 @@ public final class ClientProtos { if (other.hasCaching()) { setCaching(other.getCaching()); } + if (cfTimeRangeBuilder_ == null) { + if (!other.cfTimeRange_.isEmpty()) { + if (cfTimeRange_.isEmpty()) { + cfTimeRange_ = other.cfTimeRange_; + bitField0_ = (bitField0_ & ~0x00010000); + } else { + ensureCfTimeRangeIsMutable(); + cfTimeRange_.addAll(other.cfTimeRange_); + } + onChanged(); + } + } else { + if (!other.cfTimeRange_.isEmpty()) { + if (cfTimeRangeBuilder_.isEmpty()) { + cfTimeRangeBuilder_.dispose(); + cfTimeRangeBuilder_ = null; + cfTimeRange_ = other.cfTimeRange_; + bitField0_ = (bitField0_ & ~0x00010000); + cfTimeRangeBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getCfTimeRangeFieldBuilder() : null; + } else { + cfTimeRangeBuilder_.addAllMessages(other.cfTimeRange_); + } + } + } this.mergeUnknownFields(other.getUnknownFields()); return this; } @@ -14635,6 +15149,12 @@ public final class ClientProtos { return false; } } + for (int i = 0; i < getCfTimeRangeCount(); i++) { + if (!getCfTimeRange(i).isInitialized()) { + + return false; + } + } return true; } @@ -15789,6 +16309,246 @@ public final class ClientProtos { return this; } + // repeated .ColumnFamilyTimeRange cf_time_range = 19; + private java.util.List cfTimeRange_ = + java.util.Collections.emptyList(); + private void ensureCfTimeRangeIsMutable() { + if (!((bitField0_ & 0x00010000) == 0x00010000)) { + cfTimeRange_ = new java.util.ArrayList(cfTimeRange_); + bitField0_ |= 0x00010000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.Builder, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRangeOrBuilder> cfTimeRangeBuilder_; + + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public java.util.List getCfTimeRangeList() { + if (cfTimeRangeBuilder_ == null) { + return java.util.Collections.unmodifiableList(cfTimeRange_); + } else { + return cfTimeRangeBuilder_.getMessageList(); + } + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public int getCfTimeRangeCount() { + if (cfTimeRangeBuilder_ == null) { + return cfTimeRange_.size(); + } else { + return cfTimeRangeBuilder_.getCount(); + } + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange getCfTimeRange(int index) { + if (cfTimeRangeBuilder_ == null) { + return cfTimeRange_.get(index); + } else { + return cfTimeRangeBuilder_.getMessage(index); + } + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public Builder setCfTimeRange( + int index, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange value) { + if (cfTimeRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCfTimeRangeIsMutable(); + cfTimeRange_.set(index, value); + onChanged(); + } else { + cfTimeRangeBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public Builder setCfTimeRange( + int index, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.Builder builderForValue) { + if (cfTimeRangeBuilder_ == null) { + ensureCfTimeRangeIsMutable(); + cfTimeRange_.set(index, builderForValue.build()); + onChanged(); + } else { + cfTimeRangeBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public Builder addCfTimeRange(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange value) { + if (cfTimeRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCfTimeRangeIsMutable(); + cfTimeRange_.add(value); + onChanged(); + } else { + cfTimeRangeBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public Builder addCfTimeRange( + int index, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange value) { + if (cfTimeRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCfTimeRangeIsMutable(); + cfTimeRange_.add(index, value); + onChanged(); + } else { + cfTimeRangeBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public Builder addCfTimeRange( + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.Builder builderForValue) { + if (cfTimeRangeBuilder_ == null) { + ensureCfTimeRangeIsMutable(); + cfTimeRange_.add(builderForValue.build()); + onChanged(); + } else { + cfTimeRangeBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public Builder addCfTimeRange( + int index, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.Builder builderForValue) { + if (cfTimeRangeBuilder_ == null) { + ensureCfTimeRangeIsMutable(); + cfTimeRange_.add(index, builderForValue.build()); + onChanged(); + } else { + cfTimeRangeBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public Builder addAllCfTimeRange( + java.lang.Iterable values) { + if (cfTimeRangeBuilder_ == null) { + ensureCfTimeRangeIsMutable(); + super.addAll(values, cfTimeRange_); + onChanged(); + } else { + cfTimeRangeBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public Builder clearCfTimeRange() { + if (cfTimeRangeBuilder_ == null) { + cfTimeRange_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00010000); + onChanged(); + } else { + cfTimeRangeBuilder_.clear(); + } + return this; + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public Builder removeCfTimeRange(int index) { + if (cfTimeRangeBuilder_ == null) { + ensureCfTimeRangeIsMutable(); + cfTimeRange_.remove(index); + onChanged(); + } else { + cfTimeRangeBuilder_.remove(index); + } + return this; + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.Builder getCfTimeRangeBuilder( + int index) { + return getCfTimeRangeFieldBuilder().getBuilder(index); + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRangeOrBuilder getCfTimeRangeOrBuilder( + int index) { + if (cfTimeRangeBuilder_ == null) { + return cfTimeRange_.get(index); } else { + return cfTimeRangeBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public java.util.List + getCfTimeRangeOrBuilderList() { + if (cfTimeRangeBuilder_ != null) { + return cfTimeRangeBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(cfTimeRange_); + } + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.Builder addCfTimeRangeBuilder() { + return getCfTimeRangeFieldBuilder().addBuilder( + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.getDefaultInstance()); + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.Builder addCfTimeRangeBuilder( + int index) { + return getCfTimeRangeFieldBuilder().addBuilder( + index, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.getDefaultInstance()); + } + /** + * repeated .ColumnFamilyTimeRange cf_time_range = 19; + */ + public java.util.List + getCfTimeRangeBuilderList() { + return getCfTimeRangeFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.Builder, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRangeOrBuilder> + getCfTimeRangeFieldBuilder() { + if (cfTimeRangeBuilder_ == null) { + cfTimeRangeBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.Builder, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRangeOrBuilder>( + cfTimeRange_, + ((bitField0_ & 0x00010000) == 0x00010000), + getParentForChildren(), + isClean()); + cfTimeRange_ = null; + } + return cfTimeRangeBuilder_; + } + // @@protoc_insertion_point(builder_scope:Scan) } @@ -31856,7 +32616,7 @@ public final class ClientProtos { "o\032\nCell.proto\032\020Comparator.proto\"\037\n\016Autho" + "rizations\022\r\n\005label\030\001 \003(\t\"$\n\016CellVisibili" + "ty\022\022\n\nexpression\030\001 \002(\t\"+\n\006Column\022\016\n\006fami" + - "ly\030\001 \002(\014\022\021\n\tqualifier\030\002 \003(\014\"\251\002\n\003Get\022\013\n\003r" + + "ly\030\001 \002(\014\022\021\n\tqualifier\030\002 \003(\014\"\330\002\n\003Get\022\013\n\003r" + "ow\030\001 \002(\014\022\027\n\006column\030\002 \003(\0132\007.Column\022!\n\tatt" + "ribute\030\003 \003(\0132\016.NameBytesPair\022\027\n\006filter\030\004" + " \001(\0132\007.Filter\022\036\n\ntime_range\030\005 \001(\0132\n.Time" + @@ -31864,104 +32624,107 @@ public final class ClientProtos { "blocks\030\007 \001(\010:\004true\022\023\n\013store_limit\030\010 \001(\r\022", "\024\n\014store_offset\030\t \001(\r\022\035\n\016existence_only\030" + "\n \001(\010:\005false\022!\n\022closest_row_before\030\013 \001(\010" + - ":\005false\"L\n\006Result\022\023\n\004cell\030\001 \003(\0132\005.Cell\022\035" + - "\n\025associated_cell_count\030\002 \001(\005\022\016\n\006exists\030" + - "\003 \001(\010\"A\n\nGetRequest\022 \n\006region\030\001 \002(\0132\020.Re" + - "gionSpecifier\022\021\n\003get\030\002 \002(\0132\004.Get\"&\n\013GetR" + - "esponse\022\027\n\006result\030\001 \001(\0132\007.Result\"\200\001\n\tCon" + - "dition\022\013\n\003row\030\001 \002(\014\022\016\n\006family\030\002 \002(\014\022\021\n\tq" + - "ualifier\030\003 \002(\014\022\"\n\014compare_type\030\004 \002(\0162\014.C" + - "ompareType\022\037\n\ncomparator\030\005 \002(\0132\013.Compara", - "tor\"\265\006\n\rMutationProto\022\013\n\003row\030\001 \001(\014\0220\n\013mu" + - "tate_type\030\002 \001(\0162\033.MutationProto.Mutation" + - "Type\0220\n\014column_value\030\003 \003(\0132\032.MutationPro" + - "to.ColumnValue\022\021\n\ttimestamp\030\004 \001(\004\022!\n\tatt" + - "ribute\030\005 \003(\0132\016.NameBytesPair\022:\n\ndurabili" + - "ty\030\006 \001(\0162\031.MutationProto.Durability:\013USE" + - "_DEFAULT\022\036\n\ntime_range\030\007 \001(\0132\n.TimeRange" + - "\022\035\n\025associated_cell_count\030\010 \001(\005\022\r\n\005nonce" + - "\030\t \001(\004\032\347\001\n\013ColumnValue\022\016\n\006family\030\001 \002(\014\022B" + - "\n\017qualifier_value\030\002 \003(\0132).MutationProto.", - "ColumnValue.QualifierValue\032\203\001\n\016Qualifier" + - "Value\022\021\n\tqualifier\030\001 \001(\014\022\r\n\005value\030\002 \001(\014\022" + - "\021\n\ttimestamp\030\003 \001(\004\022.\n\013delete_type\030\004 \001(\0162" + - "\031.MutationProto.DeleteType\022\014\n\004tags\030\005 \001(\014" + - "\"W\n\nDurability\022\017\n\013USE_DEFAULT\020\000\022\014\n\010SKIP_" + - "WAL\020\001\022\r\n\tASYNC_WAL\020\002\022\014\n\010SYNC_WAL\020\003\022\r\n\tFS" + - "YNC_WAL\020\004\">\n\014MutationType\022\n\n\006APPEND\020\000\022\r\n" + - "\tINCREMENT\020\001\022\007\n\003PUT\020\002\022\n\n\006DELETE\020\003\"p\n\nDel" + - "eteType\022\026\n\022DELETE_ONE_VERSION\020\000\022\034\n\030DELET" + - "E_MULTIPLE_VERSIONS\020\001\022\021\n\rDELETE_FAMILY\020\002", - "\022\031\n\025DELETE_FAMILY_VERSION\020\003\"\207\001\n\rMutateRe" + - "quest\022 \n\006region\030\001 \002(\0132\020.RegionSpecifier\022" + - " \n\010mutation\030\002 \002(\0132\016.MutationProto\022\035\n\tcon" + - "dition\030\003 \001(\0132\n.Condition\022\023\n\013nonce_group\030" + - "\004 \001(\004\"<\n\016MutateResponse\022\027\n\006result\030\001 \001(\0132" + - "\007.Result\022\021\n\tprocessed\030\002 \001(\010\"\216\003\n\004Scan\022\027\n\006" + - "column\030\001 \003(\0132\007.Column\022!\n\tattribute\030\002 \003(\013" + - "2\016.NameBytesPair\022\021\n\tstart_row\030\003 \001(\014\022\020\n\010s" + - "top_row\030\004 \001(\014\022\027\n\006filter\030\005 \001(\0132\007.Filter\022\036" + - "\n\ntime_range\030\006 \001(\0132\n.TimeRange\022\027\n\014max_ve", - "rsions\030\007 \001(\r:\0011\022\032\n\014cache_blocks\030\010 \001(\010:\004t" + - "rue\022\022\n\nbatch_size\030\t \001(\r\022\027\n\017max_result_si" + - "ze\030\n \001(\004\022\023\n\013store_limit\030\013 \001(\r\022\024\n\014store_o" + - "ffset\030\014 \001(\r\022&\n\036load_column_families_on_d" + - "emand\030\r \001(\010\022\r\n\005small\030\016 \001(\010\022\027\n\010reversed\030\017" + - " \001(\010:\005false\022\017\n\007caching\030\021 \001(\r\"\264\001\n\013ScanReq" + - "uest\022 \n\006region\030\001 \001(\0132\020.RegionSpecifier\022\023" + - "\n\004scan\030\002 \001(\0132\005.Scan\022\022\n\nscanner_id\030\003 \001(\004\022" + - "\026\n\016number_of_rows\030\004 \001(\r\022\025\n\rclose_scanner" + - "\030\005 \001(\010\022\025\n\rnext_call_seq\030\006 \001(\004\022\024\n\005renew\030\n", - " \001(\010:\005false\"\231\001\n\014ScanResponse\022\030\n\020cells_pe" + - "r_result\030\001 \003(\r\022\022\n\nscanner_id\030\002 \001(\004\022\024\n\014mo" + - "re_results\030\003 \001(\010\022\013\n\003ttl\030\004 \001(\r\022\030\n\007results" + - "\030\005 \003(\0132\007.Result\022\036\n\026more_results_in_regio" + - "n\030\010 \001(\010\"\263\001\n\024BulkLoadHFileRequest\022 \n\006regi" + - "on\030\001 \002(\0132\020.RegionSpecifier\0225\n\013family_pat" + - "h\030\002 \003(\0132 .BulkLoadHFileRequest.FamilyPat" + - "h\022\026\n\016assign_seq_num\030\003 \001(\010\032*\n\nFamilyPath\022" + - "\016\n\006family\030\001 \002(\014\022\014\n\004path\030\002 \002(\t\"\'\n\025BulkLoa" + - "dHFileResponse\022\016\n\006loaded\030\001 \002(\010\"a\n\026Coproc", - "essorServiceCall\022\013\n\003row\030\001 \002(\014\022\024\n\014service" + - "_name\030\002 \002(\t\022\023\n\013method_name\030\003 \002(\t\022\017\n\007requ" + - "est\030\004 \002(\014\"9\n\030CoprocessorServiceResult\022\035\n" + - "\005value\030\001 \001(\0132\016.NameBytesPair\"d\n\031Coproces" + - "sorServiceRequest\022 \n\006region\030\001 \002(\0132\020.Regi" + - "onSpecifier\022%\n\004call\030\002 \002(\0132\027.CoprocessorS" + - "erviceCall\"]\n\032CoprocessorServiceResponse" + - "\022 \n\006region\030\001 \002(\0132\020.RegionSpecifier\022\035\n\005va" + - "lue\030\002 \002(\0132\016.NameBytesPair\"{\n\006Action\022\r\n\005i" + - "ndex\030\001 \001(\r\022 \n\010mutation\030\002 \001(\0132\016.MutationP", - "roto\022\021\n\003get\030\003 \001(\0132\004.Get\022-\n\014service_call\030" + - "\004 \001(\0132\027.CoprocessorServiceCall\"Y\n\014Region" + - "Action\022 \n\006region\030\001 \002(\0132\020.RegionSpecifier" + - "\022\016\n\006atomic\030\002 \001(\010\022\027\n\006action\030\003 \003(\0132\007.Actio" + - "n\"c\n\017RegionLoadStats\022\027\n\014memstoreLoad\030\001 \001" + - "(\005:\0010\022\030\n\rheapOccupancy\030\002 \001(\005:\0010\022\035\n\022compa" + - "ctionPressure\030\003 \001(\005:\0010\"\266\001\n\021ResultOrExcep" + - "tion\022\r\n\005index\030\001 \001(\r\022\027\n\006result\030\002 \001(\0132\007.Re" + - "sult\022!\n\texception\030\003 \001(\0132\016.NameBytesPair\022" + - "1\n\016service_result\030\004 \001(\0132\031.CoprocessorSer", - "viceResult\022#\n\tloadStats\030\005 \001(\0132\020.RegionLo" + - "adStats\"f\n\022RegionActionResult\022-\n\021resultO" + - "rException\030\001 \003(\0132\022.ResultOrException\022!\n\t" + - "exception\030\002 \001(\0132\016.NameBytesPair\"f\n\014Multi" + - "Request\022#\n\014regionAction\030\001 \003(\0132\r.RegionAc" + - "tion\022\022\n\nnonceGroup\030\002 \001(\004\022\035\n\tcondition\030\003 " + - "\001(\0132\n.Condition\"S\n\rMultiResponse\022/\n\022regi" + - "onActionResult\030\001 \003(\0132\023.RegionActionResul" + - "t\022\021\n\tprocessed\030\002 \001(\0102\205\003\n\rClientService\022 " + - "\n\003Get\022\013.GetRequest\032\014.GetResponse\022)\n\006Muta", - "te\022\016.MutateRequest\032\017.MutateResponse\022#\n\004S" + - "can\022\014.ScanRequest\032\r.ScanResponse\022>\n\rBulk" + - "LoadHFile\022\025.BulkLoadHFileRequest\032\026.BulkL" + - "oadHFileResponse\022F\n\013ExecService\022\032.Coproc" + - "essorServiceRequest\032\033.CoprocessorService" + - "Response\022R\n\027ExecRegionServerService\022\032.Co" + - "processorServiceRequest\032\033.CoprocessorSer" + - "viceResponse\022&\n\005Multi\022\r.MultiRequest\032\016.M" + - "ultiResponseBB\n*org.apache.hadoop.hbase." + - "protobuf.generatedB\014ClientProtosH\001\210\001\001\240\001\001" + ":\005false\022-\n\rcf_time_range\030\r \003(\0132\026.ColumnF" + + "amilyTimeRange\"L\n\006Result\022\023\n\004cell\030\001 \003(\0132\005" + + ".Cell\022\035\n\025associated_cell_count\030\002 \001(\005\022\016\n\006" + + "exists\030\003 \001(\010\"A\n\nGetRequest\022 \n\006region\030\001 \002" + + "(\0132\020.RegionSpecifier\022\021\n\003get\030\002 \002(\0132\004.Get\"" + + "&\n\013GetResponse\022\027\n\006result\030\001 \001(\0132\007.Result\"" + + "\200\001\n\tCondition\022\013\n\003row\030\001 \002(\014\022\016\n\006family\030\002 \002" + + "(\014\022\021\n\tqualifier\030\003 \002(\014\022\"\n\014compare_type\030\004 ", + "\002(\0162\014.CompareType\022\037\n\ncomparator\030\005 \002(\0132\013." + + "Comparator\"\265\006\n\rMutationProto\022\013\n\003row\030\001 \001(" + + "\014\0220\n\013mutate_type\030\002 \001(\0162\033.MutationProto.M" + + "utationType\0220\n\014column_value\030\003 \003(\0132\032.Muta" + + "tionProto.ColumnValue\022\021\n\ttimestamp\030\004 \001(\004" + + "\022!\n\tattribute\030\005 \003(\0132\016.NameBytesPair\022:\n\nd" + + "urability\030\006 \001(\0162\031.MutationProto.Durabili" + + "ty:\013USE_DEFAULT\022\036\n\ntime_range\030\007 \001(\0132\n.Ti" + + "meRange\022\035\n\025associated_cell_count\030\010 \001(\005\022\r" + + "\n\005nonce\030\t \001(\004\032\347\001\n\013ColumnValue\022\016\n\006family\030", + "\001 \002(\014\022B\n\017qualifier_value\030\002 \003(\0132).Mutatio" + + "nProto.ColumnValue.QualifierValue\032\203\001\n\016Qu" + + "alifierValue\022\021\n\tqualifier\030\001 \001(\014\022\r\n\005value" + + "\030\002 \001(\014\022\021\n\ttimestamp\030\003 \001(\004\022.\n\013delete_type" + + "\030\004 \001(\0162\031.MutationProto.DeleteType\022\014\n\004tag" + + "s\030\005 \001(\014\"W\n\nDurability\022\017\n\013USE_DEFAULT\020\000\022\014" + + "\n\010SKIP_WAL\020\001\022\r\n\tASYNC_WAL\020\002\022\014\n\010SYNC_WAL\020" + + "\003\022\r\n\tFSYNC_WAL\020\004\">\n\014MutationType\022\n\n\006APPE" + + "ND\020\000\022\r\n\tINCREMENT\020\001\022\007\n\003PUT\020\002\022\n\n\006DELETE\020\003" + + "\"p\n\nDeleteType\022\026\n\022DELETE_ONE_VERSION\020\000\022\034", + "\n\030DELETE_MULTIPLE_VERSIONS\020\001\022\021\n\rDELETE_F" + + "AMILY\020\002\022\031\n\025DELETE_FAMILY_VERSION\020\003\"\207\001\n\rM" + + "utateRequest\022 \n\006region\030\001 \002(\0132\020.RegionSpe" + + "cifier\022 \n\010mutation\030\002 \002(\0132\016.MutationProto" + + "\022\035\n\tcondition\030\003 \001(\0132\n.Condition\022\023\n\013nonce" + + "_group\030\004 \001(\004\"<\n\016MutateResponse\022\027\n\006result" + + "\030\001 \001(\0132\007.Result\022\021\n\tprocessed\030\002 \001(\010\"\275\003\n\004S" + + "can\022\027\n\006column\030\001 \003(\0132\007.Column\022!\n\tattribut" + + "e\030\002 \003(\0132\016.NameBytesPair\022\021\n\tstart_row\030\003 \001" + + "(\014\022\020\n\010stop_row\030\004 \001(\014\022\027\n\006filter\030\005 \001(\0132\007.F", + "ilter\022\036\n\ntime_range\030\006 \001(\0132\n.TimeRange\022\027\n" + + "\014max_versions\030\007 \001(\r:\0011\022\032\n\014cache_blocks\030\010" + + " \001(\010:\004true\022\022\n\nbatch_size\030\t \001(\r\022\027\n\017max_re" + + "sult_size\030\n \001(\004\022\023\n\013store_limit\030\013 \001(\r\022\024\n\014" + + "store_offset\030\014 \001(\r\022&\n\036load_column_famili" + + "es_on_demand\030\r \001(\010\022\r\n\005small\030\016 \001(\010\022\027\n\010rev" + + "ersed\030\017 \001(\010:\005false\022\017\n\007caching\030\021 \001(\r\022-\n\rc" + + "f_time_range\030\023 \003(\0132\026.ColumnFamilyTimeRan" + + "ge\"\264\001\n\013ScanRequest\022 \n\006region\030\001 \001(\0132\020.Reg" + + "ionSpecifier\022\023\n\004scan\030\002 \001(\0132\005.Scan\022\022\n\nsca", + "nner_id\030\003 \001(\004\022\026\n\016number_of_rows\030\004 \001(\r\022\025\n" + + "\rclose_scanner\030\005 \001(\010\022\025\n\rnext_call_seq\030\006 " + + "\001(\004\022\024\n\005renew\030\n \001(\010:\005false\"\231\001\n\014ScanRespon" + + "se\022\030\n\020cells_per_result\030\001 \003(\r\022\022\n\nscanner_" + + "id\030\002 \001(\004\022\024\n\014more_results\030\003 \001(\010\022\013\n\003ttl\030\004 " + + "\001(\r\022\030\n\007results\030\005 \003(\0132\007.Result\022\036\n\026more_re" + + "sults_in_region\030\010 \001(\010\"\263\001\n\024BulkLoadHFileR" + + "equest\022 \n\006region\030\001 \002(\0132\020.RegionSpecifier" + + "\0225\n\013family_path\030\002 \003(\0132 .BulkLoadHFileReq" + + "uest.FamilyPath\022\026\n\016assign_seq_num\030\003 \001(\010\032", + "*\n\nFamilyPath\022\016\n\006family\030\001 \002(\014\022\014\n\004path\030\002 " + + "\002(\t\"\'\n\025BulkLoadHFileResponse\022\016\n\006loaded\030\001" + + " \002(\010\"a\n\026CoprocessorServiceCall\022\013\n\003row\030\001 " + + "\002(\014\022\024\n\014service_name\030\002 \002(\t\022\023\n\013method_name" + + "\030\003 \002(\t\022\017\n\007request\030\004 \002(\014\"9\n\030CoprocessorSe" + + "rviceResult\022\035\n\005value\030\001 \001(\0132\016.NameBytesPa" + + "ir\"d\n\031CoprocessorServiceRequest\022 \n\006regio" + + "n\030\001 \002(\0132\020.RegionSpecifier\022%\n\004call\030\002 \002(\0132" + + "\027.CoprocessorServiceCall\"]\n\032CoprocessorS" + + "erviceResponse\022 \n\006region\030\001 \002(\0132\020.RegionS", + "pecifier\022\035\n\005value\030\002 \002(\0132\016.NameBytesPair\"" + + "{\n\006Action\022\r\n\005index\030\001 \001(\r\022 \n\010mutation\030\002 \001" + + "(\0132\016.MutationProto\022\021\n\003get\030\003 \001(\0132\004.Get\022-\n" + + "\014service_call\030\004 \001(\0132\027.CoprocessorService" + + "Call\"Y\n\014RegionAction\022 \n\006region\030\001 \002(\0132\020.R" + + "egionSpecifier\022\016\n\006atomic\030\002 \001(\010\022\027\n\006action" + + "\030\003 \003(\0132\007.Action\"c\n\017RegionLoadStats\022\027\n\014me" + + "mstoreLoad\030\001 \001(\005:\0010\022\030\n\rheapOccupancy\030\002 \001" + + "(\005:\0010\022\035\n\022compactionPressure\030\003 \001(\005:\0010\"\266\001\n" + + "\021ResultOrException\022\r\n\005index\030\001 \001(\r\022\027\n\006res", + "ult\030\002 \001(\0132\007.Result\022!\n\texception\030\003 \001(\0132\016." + + "NameBytesPair\0221\n\016service_result\030\004 \001(\0132\031." + + "CoprocessorServiceResult\022#\n\tloadStats\030\005 " + + "\001(\0132\020.RegionLoadStats\"f\n\022RegionActionRes" + + "ult\022-\n\021resultOrException\030\001 \003(\0132\022.ResultO" + + "rException\022!\n\texception\030\002 \001(\0132\016.NameByte" + + "sPair\"f\n\014MultiRequest\022#\n\014regionAction\030\001 " + + "\003(\0132\r.RegionAction\022\022\n\nnonceGroup\030\002 \001(\004\022\035" + + "\n\tcondition\030\003 \001(\0132\n.Condition\"S\n\rMultiRe" + + "sponse\022/\n\022regionActionResult\030\001 \003(\0132\023.Reg", + "ionActionResult\022\021\n\tprocessed\030\002 \001(\0102\205\003\n\rC" + + "lientService\022 \n\003Get\022\013.GetRequest\032\014.GetRe" + + "sponse\022)\n\006Mutate\022\016.MutateRequest\032\017.Mutat" + + "eResponse\022#\n\004Scan\022\014.ScanRequest\032\r.ScanRe" + + "sponse\022>\n\rBulkLoadHFile\022\025.BulkLoadHFileR" + + "equest\032\026.BulkLoadHFileResponse\022F\n\013ExecSe" + + "rvice\022\032.CoprocessorServiceRequest\032\033.Copr" + + "ocessorServiceResponse\022R\n\027ExecRegionServ" + + "erService\022\032.CoprocessorServiceRequest\032\033." + + "CoprocessorServiceResponse\022&\n\005Multi\022\r.Mu", + "ltiRequest\032\016.MultiResponseBB\n*org.apache" + + ".hadoop.hbase.protobuf.generatedB\014Client" + + "ProtosH\001\210\001\001\240\001\001" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -31991,7 +32754,7 @@ public final class ClientProtos { internal_static_Get_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_Get_descriptor, - new java.lang.String[] { "Row", "Column", "Attribute", "Filter", "TimeRange", "MaxVersions", "CacheBlocks", "StoreLimit", "StoreOffset", "ExistenceOnly", "ClosestRowBefore", }); + new java.lang.String[] { "Row", "Column", "Attribute", "Filter", "TimeRange", "MaxVersions", "CacheBlocks", "StoreLimit", "StoreOffset", "ExistenceOnly", "ClosestRowBefore", "CfTimeRange", }); internal_static_Result_descriptor = getDescriptor().getMessageTypes().get(4); internal_static_Result_fieldAccessorTable = new @@ -32051,7 +32814,7 @@ public final class ClientProtos { internal_static_Scan_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_Scan_descriptor, - new java.lang.String[] { "Column", "Attribute", "StartRow", "StopRow", "Filter", "TimeRange", "MaxVersions", "CacheBlocks", "BatchSize", "MaxResultSize", "StoreLimit", "StoreOffset", "LoadColumnFamiliesOnDemand", "Small", "Reversed", "Caching", }); + new java.lang.String[] { "Column", "Attribute", "StartRow", "StopRow", "Filter", "TimeRange", "MaxVersions", "CacheBlocks", "BatchSize", "MaxResultSize", "StoreLimit", "StoreOffset", "LoadColumnFamiliesOnDemand", "Small", "Reversed", "Caching", "CfTimeRange", }); internal_static_ScanRequest_descriptor = getDescriptor().getMessageTypes().get(12); internal_static_ScanRequest_fieldAccessorTable = new diff --git a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/HBaseProtos.java b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/HBaseProtos.java index 9c0447e..0fe5d3e 100644 --- a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/HBaseProtos.java +++ b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/HBaseProtos.java @@ -6593,6 +6593,668 @@ public final class HBaseProtos { // @@protoc_insertion_point(class_scope:TimeRange) } + public interface ColumnFamilyTimeRangeOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required bytes column_family = 1; + /** + * required bytes column_family = 1; + */ + boolean hasColumnFamily(); + /** + * required bytes column_family = 1; + */ + com.google.protobuf.ByteString getColumnFamily(); + + // required .TimeRange time_range = 2; + /** + * required .TimeRange time_range = 2; + */ + boolean hasTimeRange(); + /** + * required .TimeRange time_range = 2; + */ + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange getTimeRange(); + /** + * required .TimeRange time_range = 2; + */ + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRangeOrBuilder getTimeRangeOrBuilder(); + } + /** + * Protobuf type {@code ColumnFamilyTimeRange} + * + *
+   * ColumnFamily Specific TimeRange
+   * 
+ */ + public static final class ColumnFamilyTimeRange extends + com.google.protobuf.GeneratedMessage + implements ColumnFamilyTimeRangeOrBuilder { + // Use ColumnFamilyTimeRange.newBuilder() to construct. + private ColumnFamilyTimeRange(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private ColumnFamilyTimeRange(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final ColumnFamilyTimeRange defaultInstance; + public static ColumnFamilyTimeRange getDefaultInstance() { + return defaultInstance; + } + + public ColumnFamilyTimeRange getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ColumnFamilyTimeRange( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + columnFamily_ = input.readBytes(); + break; + } + case 18: { + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = timeRange_.toBuilder(); + } + timeRange_ = input.readMessage(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(timeRange_); + timeRange_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.internal_static_ColumnFamilyTimeRange_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.internal_static_ColumnFamilyTimeRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.class, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public ColumnFamilyTimeRange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ColumnFamilyTimeRange(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // required bytes column_family = 1; + public static final int COLUMN_FAMILY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString columnFamily_; + /** + * required bytes column_family = 1; + */ + public boolean hasColumnFamily() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bytes column_family = 1; + */ + public com.google.protobuf.ByteString getColumnFamily() { + return columnFamily_; + } + + // required .TimeRange time_range = 2; + public static final int TIME_RANGE_FIELD_NUMBER = 2; + private org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange timeRange_; + /** + * required .TimeRange time_range = 2; + */ + public boolean hasTimeRange() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required .TimeRange time_range = 2; + */ + public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange getTimeRange() { + return timeRange_; + } + /** + * required .TimeRange time_range = 2; + */ + public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRangeOrBuilder getTimeRangeOrBuilder() { + return timeRange_; + } + + private void initFields() { + columnFamily_ = com.google.protobuf.ByteString.EMPTY; + timeRange_ = org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasColumnFamily()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasTimeRange()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, columnFamily_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, timeRange_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, columnFamily_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, timeRange_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange)) { + return super.equals(obj); + } + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange other = (org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange) obj; + + boolean result = true; + result = result && (hasColumnFamily() == other.hasColumnFamily()); + if (hasColumnFamily()) { + result = result && getColumnFamily() + .equals(other.getColumnFamily()); + } + result = result && (hasTimeRange() == other.hasTimeRange()); + if (hasTimeRange()) { + result = result && getTimeRange() + .equals(other.getTimeRange()); + } + result = result && + getUnknownFields().equals(other.getUnknownFields()); + return result; + } + + private int memoizedHashCode = 0; + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasColumnFamily()) { + hash = (37 * hash) + COLUMN_FAMILY_FIELD_NUMBER; + hash = (53 * hash) + getColumnFamily().hashCode(); + } + if (hasTimeRange()) { + hash = (37 * hash) + TIME_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getTimeRange().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code ColumnFamilyTimeRange} + * + *
+     * ColumnFamily Specific TimeRange
+     * 
+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.internal_static_ColumnFamilyTimeRange_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.internal_static_ColumnFamilyTimeRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.class, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.Builder.class); + } + + // Construct using org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getTimeRangeFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + columnFamily_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (timeRangeBuilder_ == null) { + timeRange_ = org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange.getDefaultInstance(); + } else { + timeRangeBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.internal_static_ColumnFamilyTimeRange_descriptor; + } + + public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange getDefaultInstanceForType() { + return org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.getDefaultInstance(); + } + + public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange build() { + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange buildPartial() { + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange result = new org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.columnFamily_ = columnFamily_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + if (timeRangeBuilder_ == null) { + result.timeRange_ = timeRange_; + } else { + result.timeRange_ = timeRangeBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange) { + return mergeFrom((org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange other) { + if (other == org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange.getDefaultInstance()) return this; + if (other.hasColumnFamily()) { + setColumnFamily(other.getColumnFamily()); + } + if (other.hasTimeRange()) { + mergeTimeRange(other.getTimeRange()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasColumnFamily()) { + + return false; + } + if (!hasTimeRange()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilyTimeRange) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // required bytes column_family = 1; + private com.google.protobuf.ByteString columnFamily_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes column_family = 1; + */ + public boolean hasColumnFamily() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bytes column_family = 1; + */ + public com.google.protobuf.ByteString getColumnFamily() { + return columnFamily_; + } + /** + * required bytes column_family = 1; + */ + public Builder setColumnFamily(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + columnFamily_ = value; + onChanged(); + return this; + } + /** + * required bytes column_family = 1; + */ + public Builder clearColumnFamily() { + bitField0_ = (bitField0_ & ~0x00000001); + columnFamily_ = getDefaultInstance().getColumnFamily(); + onChanged(); + return this; + } + + // required .TimeRange time_range = 2; + private org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange timeRange_ = org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange.Builder, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRangeOrBuilder> timeRangeBuilder_; + /** + * required .TimeRange time_range = 2; + */ + public boolean hasTimeRange() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required .TimeRange time_range = 2; + */ + public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange getTimeRange() { + if (timeRangeBuilder_ == null) { + return timeRange_; + } else { + return timeRangeBuilder_.getMessage(); + } + } + /** + * required .TimeRange time_range = 2; + */ + public Builder setTimeRange(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange value) { + if (timeRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timeRange_ = value; + onChanged(); + } else { + timeRangeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * required .TimeRange time_range = 2; + */ + public Builder setTimeRange( + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange.Builder builderForValue) { + if (timeRangeBuilder_ == null) { + timeRange_ = builderForValue.build(); + onChanged(); + } else { + timeRangeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * required .TimeRange time_range = 2; + */ + public Builder mergeTimeRange(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange value) { + if (timeRangeBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + timeRange_ != org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange.getDefaultInstance()) { + timeRange_ = + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange.newBuilder(timeRange_).mergeFrom(value).buildPartial(); + } else { + timeRange_ = value; + } + onChanged(); + } else { + timeRangeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * required .TimeRange time_range = 2; + */ + public Builder clearTimeRange() { + if (timeRangeBuilder_ == null) { + timeRange_ = org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange.getDefaultInstance(); + onChanged(); + } else { + timeRangeBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + * required .TimeRange time_range = 2; + */ + public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange.Builder getTimeRangeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getTimeRangeFieldBuilder().getBuilder(); + } + /** + * required .TimeRange time_range = 2; + */ + public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRangeOrBuilder getTimeRangeOrBuilder() { + if (timeRangeBuilder_ != null) { + return timeRangeBuilder_.getMessageOrBuilder(); + } else { + return timeRange_; + } + } + /** + * required .TimeRange time_range = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange.Builder, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRangeOrBuilder> + getTimeRangeFieldBuilder() { + if (timeRangeBuilder_ == null) { + timeRangeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange.Builder, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRangeOrBuilder>( + timeRange_, + getParentForChildren(), + isClean()); + timeRange_ = null; + } + return timeRangeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:ColumnFamilyTimeRange) + } + + static { + defaultInstance = new ColumnFamilyTimeRange(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:ColumnFamilyTimeRange) + } + public interface ServerNameOrBuilder extends com.google.protobuf.MessageOrBuilder { @@ -16142,6 +16804,11 @@ public final class HBaseProtos { com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_TimeRange_fieldAccessorTable; private static com.google.protobuf.Descriptors.Descriptor + internal_static_ColumnFamilyTimeRange_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_ColumnFamilyTimeRange_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor internal_static_ServerName_descriptor; private static com.google.protobuf.GeneratedMessage.FieldAccessorTable @@ -16243,8 +16910,10 @@ public final class HBaseProtos { "gionSpecifierType\022\r\n\005value\030\002 \002(\014\"?\n\023Regi" + "onSpecifierType\022\017\n\013REGION_NAME\020\001\022\027\n\023ENCO" + "DED_REGION_NAME\020\002\"%\n\tTimeRange\022\014\n\004from\030\001" + - " \001(\004\022\n\n\002to\030\002 \001(\004\"A\n\nServerName\022\021\n\thost_n" + - "ame\030\001 \002(\t\022\014\n\004port\030\002 \001(\r\022\022\n\nstart_code\030\003 ", + " \001(\004\022\n\n\002to\030\002 \001(\004\"N\n\025ColumnFamilyTimeRang" + + "e\022\025\n\rcolumn_family\030\001 \002(\014\022\036\n\ntime_range\030\002", + " \002(\0132\n.TimeRange\"A\n\nServerName\022\021\n\thost_n" + + "ame\030\001 \002(\t\022\014\n\004port\030\002 \001(\r\022\022\n\nstart_code\030\003 " + "\001(\004\"\033\n\013Coprocessor\022\014\n\004name\030\001 \002(\t\"-\n\016Name" + "StringPair\022\014\n\004name\030\001 \002(\t\022\r\n\005value\030\002 \002(\t\"" + ",\n\rNameBytesPair\022\014\n\004name\030\001 \002(\t\022\r\n\005value\030" + @@ -16252,9 +16921,9 @@ public final class HBaseProtos { "\n\006second\030\002 \002(\014\",\n\rNameInt64Pair\022\014\n\004name\030" + "\001 \001(\t\022\r\n\005value\030\002 \001(\003\"\275\001\n\023SnapshotDescrip" + "tion\022\014\n\004name\030\001 \002(\t\022\r\n\005table\030\002 \001(\t\022\030\n\rcre" + - "ation_time\030\003 \001(\003:\0010\022.\n\004type\030\004 \001(\0162\031.Snap" + + "ation_time\030\003 \001(\003:\0010\022.\n\004type\030\004 \001(\0162\031.Snap", "shotDescription.Type:\005FLUSH\022\017\n\007version\030\005" + - " \001(\005\".\n\004Type\022\014\n\010DISABLED\020\000\022\t\n\005FLUSH\020\001\022\r\n", + " \001(\005\".\n\004Type\022\014\n\010DISABLED\020\000\022\t\n\005FLUSH\020\001\022\r\n" + "\tSKIPFLUSH\020\002\"}\n\024ProcedureDescription\022\021\n\t" + "signature\030\001 \002(\t\022\020\n\010instance\030\002 \001(\t\022\030\n\rcre" + "ation_time\030\003 \001(\003:\0010\022&\n\rconfiguration\030\004 \003" + @@ -16262,9 +16931,9 @@ public final class HBaseProtos { "sg\022\020\n\010long_msg\030\001 \002(\003\"\037\n\tDoubleMsg\022\022\n\ndou" + "ble_msg\030\001 \002(\001\"\'\n\rBigDecimalMsg\022\026\n\016bigdec" + "imal_msg\030\001 \002(\014\"5\n\004UUID\022\026\n\016least_sig_bits" + - "\030\001 \002(\004\022\025\n\rmost_sig_bits\030\002 \002(\004\"K\n\023Namespa" + + "\030\001 \002(\004\022\025\n\rmost_sig_bits\030\002 \002(\004\"K\n\023Namespa", "ceDescriptor\022\014\n\004name\030\001 \002(\014\022&\n\rconfigurat" + - "ion\030\002 \003(\0132\017.NameStringPair\"$\n\020RegionServ", + "ion\030\002 \003(\0132\017.NameStringPair\"$\n\020RegionServ" + "erInfo\022\020\n\010infoPort\030\001 \001(\005*r\n\013CompareType\022" + "\010\n\004LESS\020\000\022\021\n\rLESS_OR_EQUAL\020\001\022\t\n\005EQUAL\020\002\022" + "\r\n\tNOT_EQUAL\020\003\022\024\n\020GREATER_OR_EQUAL\020\004\022\013\n\007" + @@ -16319,92 +16988,98 @@ public final class HBaseProtos { com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_TimeRange_descriptor, new java.lang.String[] { "From", "To", }); - internal_static_ServerName_descriptor = + internal_static_ColumnFamilyTimeRange_descriptor = getDescriptor().getMessageTypes().get(7); + internal_static_ColumnFamilyTimeRange_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_ColumnFamilyTimeRange_descriptor, + new java.lang.String[] { "ColumnFamily", "TimeRange", }); + internal_static_ServerName_descriptor = + getDescriptor().getMessageTypes().get(8); internal_static_ServerName_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_ServerName_descriptor, new java.lang.String[] { "HostName", "Port", "StartCode", }); internal_static_Coprocessor_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageTypes().get(9); internal_static_Coprocessor_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_Coprocessor_descriptor, new java.lang.String[] { "Name", }); internal_static_NameStringPair_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(10); internal_static_NameStringPair_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_NameStringPair_descriptor, new java.lang.String[] { "Name", "Value", }); internal_static_NameBytesPair_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(11); internal_static_NameBytesPair_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_NameBytesPair_descriptor, new java.lang.String[] { "Name", "Value", }); internal_static_BytesBytesPair_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(12); internal_static_BytesBytesPair_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_BytesBytesPair_descriptor, new java.lang.String[] { "First", "Second", }); internal_static_NameInt64Pair_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(13); internal_static_NameInt64Pair_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_NameInt64Pair_descriptor, new java.lang.String[] { "Name", "Value", }); internal_static_SnapshotDescription_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(14); internal_static_SnapshotDescription_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_SnapshotDescription_descriptor, new java.lang.String[] { "Name", "Table", "CreationTime", "Type", "Version", }); internal_static_ProcedureDescription_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(15); internal_static_ProcedureDescription_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_ProcedureDescription_descriptor, new java.lang.String[] { "Signature", "Instance", "CreationTime", "Configuration", }); internal_static_EmptyMsg_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(16); internal_static_EmptyMsg_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_EmptyMsg_descriptor, new java.lang.String[] { }); internal_static_LongMsg_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(17); internal_static_LongMsg_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_LongMsg_descriptor, new java.lang.String[] { "LongMsg", }); internal_static_DoubleMsg_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(18); internal_static_DoubleMsg_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_DoubleMsg_descriptor, new java.lang.String[] { "DoubleMsg", }); internal_static_BigDecimalMsg_descriptor = - getDescriptor().getMessageTypes().get(18); + getDescriptor().getMessageTypes().get(19); internal_static_BigDecimalMsg_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_BigDecimalMsg_descriptor, new java.lang.String[] { "BigdecimalMsg", }); internal_static_UUID_descriptor = - getDescriptor().getMessageTypes().get(19); + getDescriptor().getMessageTypes().get(20); internal_static_UUID_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_UUID_descriptor, new java.lang.String[] { "LeastSigBits", "MostSigBits", }); internal_static_NamespaceDescriptor_descriptor = - getDescriptor().getMessageTypes().get(20); + getDescriptor().getMessageTypes().get(21); internal_static_NamespaceDescriptor_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_NamespaceDescriptor_descriptor, new java.lang.String[] { "Name", "Configuration", }); internal_static_RegionServerInfo_descriptor = - getDescriptor().getMessageTypes().get(21); + getDescriptor().getMessageTypes().get(22); internal_static_RegionServerInfo_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_RegionServerInfo_descriptor, diff --git a/hbase-protocol/src/main/protobuf/Client.proto b/hbase-protocol/src/main/protobuf/Client.proto index 0526d6c..54fdfa5 100644 --- a/hbase-protocol/src/main/protobuf/Client.proto +++ b/hbase-protocol/src/main/protobuf/Client.proto @@ -75,6 +75,7 @@ message Get { // If the row to get doesn't exist, return the // closest row before. optional bool closest_row_before = 11 [default = false]; + repeated ColumnFamilyTimeRange cf_time_range = 13; } message Result { @@ -234,6 +235,7 @@ message Scan { optional bool small = 14; optional bool reversed = 15 [default = false]; optional uint32 caching = 17; + repeated ColumnFamilyTimeRange cf_time_range = 19; } /** diff --git a/hbase-protocol/src/main/protobuf/HBase.proto b/hbase-protocol/src/main/protobuf/HBase.proto index 3e3d570..994c7a2 100644 --- a/hbase-protocol/src/main/protobuf/HBase.proto +++ b/hbase-protocol/src/main/protobuf/HBase.proto @@ -103,6 +103,12 @@ message TimeRange { optional uint64 to = 2; } +/* ColumnFamily Specific TimeRange */ +message ColumnFamilyTimeRange { + required bytes column_family = 1; + required TimeRange time_range = 2; +} + /* Comparison operators */ enum CompareType { LESS = 0; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueScanner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueScanner.java index 90bfd11..de61fa7 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueScanner.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueScanner.java @@ -19,7 +19,6 @@ package org.apache.hadoop.hbase.regionserver; import java.io.IOException; -import java.util.SortedSet; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.KeyValue; @@ -76,14 +75,14 @@ public interface KeyValueScanner { * Allows to filter out scanners (both StoreFile and memstore) that we don't * want to use based on criteria such as Bloom filters and timestamp ranges. * @param scan the scan that we are selecting scanners for - * @param columns the set of columns in the current column family, or null if + * @param store the set of columns in the current column family, or null if * not specified by the scan * @param oldestUnexpiredTS the oldest timestamp we are interested in for * this query, based on TTL * @return true if the scanner should be included in the query */ boolean shouldUseScanner( - Scan scan, SortedSet columns, long oldestUnexpiredTS + Scan scan, Store store, long oldestUnexpiredTS ); // "Lazy scanner" optimizations diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java index 549f15e..d9a0c7c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java @@ -41,6 +41,7 @@ import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValueUtil; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.io.HeapSize; +import org.apache.hadoop.hbase.io.TimeRange; import org.apache.hadoop.hbase.regionserver.MemStoreLAB.Allocation; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.ClassSize; @@ -657,11 +658,17 @@ public class MemStore implements HeapSize { /** * Check if this memstore may contain the required keys * @param scan + * @param store * @return False if the key definitely does not exist in this Memstore */ - public boolean shouldSeek(Scan scan, long oldestUnexpiredTS) { - return (timeRangeTracker.includesTimeRange(scan.getTimeRange()) || - snapshotTimeRangeTracker.includesTimeRange(scan.getTimeRange())) + public boolean shouldSeek(Scan scan, Store store, long oldestUnexpiredTS) { + byte[] cf = store.getFamily().getName(); + TimeRange timeRange = scan.getColumnFamilyTimeRange().get(cf); + if (timeRange == null) { + timeRange = scan.getTimeRange(); + } + return (timeRangeTracker.includesTimeRange(timeRange) || + snapshotTimeRangeTracker.includesTimeRange(timeRange)) && (Math.max(timeRangeTracker.getMaximumTimestamp(), snapshotTimeRangeTracker.getMaximumTimestamp()) >= oldestUnexpiredTS); @@ -934,9 +941,9 @@ public class MemStore implements HeapSize { } @Override - public boolean shouldUseScanner(Scan scan, SortedSet columns, + public boolean shouldUseScanner(Scan scan, Store store, long oldestUnexpiredTS) { - return shouldSeek(scan, oldestUnexpiredTS); + return shouldSeek(scan, store, oldestUnexpiredTS); } /** diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/NonLazyKeyValueScanner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/NonLazyKeyValueScanner.java index 5e7cecb..2e2f0d9 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/NonLazyKeyValueScanner.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/NonLazyKeyValueScanner.java @@ -19,7 +19,6 @@ package org.apache.hadoop.hbase.regionserver; import java.io.IOException; -import java.util.SortedSet; import org.apache.commons.lang.NotImplementedException; import org.apache.hadoop.hbase.classification.InterfaceAudience; @@ -56,7 +55,7 @@ public abstract class NonLazyKeyValueScanner implements KeyValueScanner { } @Override - public boolean shouldUseScanner(Scan scan, SortedSet columns, + public boolean shouldUseScanner(Scan scan, Store store, long oldestUnexpiredTS) { // No optimizations implemented by default. return true; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java index bdd3913..534704b 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java @@ -159,7 +159,12 @@ public class ScanQueryMatcher { public ScanQueryMatcher(Scan scan, ScanInfo scanInfo, NavigableSet columns, ScanType scanType, long readPointToUse, long earliestPutTs, long oldestUnexpiredTS, long now, RegionCoprocessorHost regionCoprocessorHost) throws IOException { - this.tr = scan.getTimeRange(); + TimeRange timeRange = scan.getColumnFamilyTimeRange().get(scanInfo.getFamily()); + if (timeRange == null) { + this.tr = scan.getTimeRange(); + } else { + this.tr = timeRange; + } this.rowComparator = scanInfo.getComparator(); this.regionCoprocessorHost = regionCoprocessorHost; this.deletes = instantiateDeleteTracker(); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java index 85b477e..6913efb 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java @@ -43,6 +43,7 @@ import org.apache.hadoop.hbase.KeyValue.KVComparator; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.io.FSDataInputStreamWrapper; +import org.apache.hadoop.hbase.io.TimeRange; import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding; import org.apache.hadoop.hbase.io.hfile.BlockType; import org.apache.hadoop.hbase.io.hfile.CacheConfig; @@ -1155,16 +1156,16 @@ public class StoreFile { /** * Check if this storeFile may contain keys within the TimeRange that * have not expired (i.e. not older than oldestUnexpiredTS). - * @param scan the current scan + * @param timeRange the timeRange to restrict * @param oldestUnexpiredTS the oldest timestamp that is not expired, as * determined by the column family's TTL * @return false if queried keys definitely don't exist in this StoreFile */ - boolean passesTimerangeFilter(Scan scan, long oldestUnexpiredTS) { + boolean passesTimerangeFilter(TimeRange timeRange, long oldestUnexpiredTS) { if (timeRangeTracker == null) { return true; } else { - return timeRangeTracker.includesTimeRange(scan.getTimeRange()) && + return timeRangeTracker.includesTimeRange(timeRange) && timeRangeTracker.getMaximumTimestamp() >= oldestUnexpiredTS; } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java index 0156637..372f963 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java @@ -24,7 +24,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.List; -import java.util.SortedSet; +import java.util.NavigableSet; import java.util.concurrent.atomic.AtomicLong; import org.apache.commons.logging.Log; @@ -33,6 +33,7 @@ import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.io.TimeRange; import org.apache.hadoop.hbase.io.hfile.HFileScanner; import org.apache.hadoop.hbase.regionserver.StoreFile.Reader; @@ -429,9 +430,16 @@ public class StoreFileScanner implements KeyValueScanner { } @Override - public boolean shouldUseScanner(Scan scan, SortedSet columns, long oldestUnexpiredTS) { - return reader.passesTimerangeFilter(scan, oldestUnexpiredTS) - && reader.passesKeyRangeFilter(scan) && reader.passesBloomFilter(scan, columns); + public boolean shouldUseScanner(Scan scan, Store store, long oldestUnexpiredTS) { + byte[] columnFamily = store.getFamily().getName(); + TimeRange timeRange = scan.getColumnFamilyTimeRange().get(columnFamily); + if (timeRange == null) { + timeRange = scan.getTimeRange(); + } + + NavigableSet columns = scan.getFamilyMap().get(columnFamily); + return reader.passesTimerangeFilter(timeRange, oldestUnexpiredTS) && reader + .passesKeyRangeFilter(scan) && reader.passesBloomFilter(scan, columns); } @Override diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java index fc034ed..d905000 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java @@ -372,7 +372,7 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner continue; } - if (kvs.shouldUseScanner(scan, columns, expiredTimestampCutoff)) { + if (kvs.shouldUseScanner(scan, store, expiredTimestampCutoff)) { scanners.add(kvs); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileWriterV2.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileWriterV2.java index 19b460e..bdc5a8f0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileWriterV2.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileWriterV2.java @@ -260,7 +260,7 @@ public class TestHFileWriterV2 { // Static stuff used by various HFile v2 unit tests - private static final String COLUMN_FAMILY_NAME = "_-myColumnFamily-_"; + public static final String COLUMN_FAMILY_NAME = "_-myColumnFamily-_"; private static final int MIN_ROW_OR_QUALIFIER_LENGTH = 64; private static final int MAX_ROW_OR_QUALIFIER_LENGTH = 128; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompoundBloomFilter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompoundBloomFilter.java index 9628623..739175c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompoundBloomFilter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompoundBloomFilter.java @@ -23,6 +23,8 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; import java.io.IOException; import java.util.ArrayList; @@ -37,6 +39,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.client.Scan; @@ -282,9 +285,12 @@ public class TestCompoundBloomFilter { private boolean isInBloom(StoreFileScanner scanner, byte[] row, byte[] qualifier) { Scan scan = new Scan(row, row); - TreeSet columns = new TreeSet(Bytes.BYTES_COMPARATOR); - columns.add(qualifier); - return scanner.shouldUseScanner(scan, columns, Long.MIN_VALUE); + scan.addColumn(Bytes.toBytes(TestHFileWriterV2.COLUMN_FAMILY_NAME), qualifier); + Store store = mock(Store.class); + HColumnDescriptor hcd = mock(HColumnDescriptor.class); + when(hcd.getName()).thenReturn(Bytes.toBytes(TestHFileWriterV2.COLUMN_FAMILY_NAME)); + when(store.getFamily()).thenReturn(hcd); + return scanner.shouldUseScanner(scan, store, Long.MIN_VALUE); } private Path writeStoreFile(int t, BloomType bt, List kvs) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMemStore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMemStore.java index 7fdade9..8a365f9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMemStore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMemStore.java @@ -53,6 +53,9 @@ import com.google.common.base.Joiner; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + /** memstore test case */ @Category(MediumTests.class) public class TestMemStore extends TestCase { @@ -733,28 +736,31 @@ public class TestMemStore extends TestCase { * Test to ensure correctness when using Memstore with multiple timestamps */ public void testMultipleTimestamps() throws IOException { - long[] timestamps = new long[] {20,10,5,1}; + long[] timestamps = new long[] { 20, 10, 5, 1 }; Scan scan = new Scan(); - for (long timestamp: timestamps) - addRows(memstore,timestamp); + for (long timestamp : timestamps) + addRows(memstore, timestamp); - scan.setTimeRange(0, 2); - assertTrue(memstore.shouldSeek(scan, Long.MIN_VALUE)); + byte[] fam = Bytes.toBytes("fam"); + HColumnDescriptor hcd = mock(HColumnDescriptor.class); + when(hcd.getName()).thenReturn(fam); + Store store = mock(Store.class); + when(store.getFamily()).thenReturn(hcd); + scan.setColumnFamilyTimeRange(fam, 0, 2); + assertTrue(memstore.shouldSeek(scan, store, Long.MIN_VALUE)); - scan.setTimeRange(20, 82); - assertTrue(memstore.shouldSeek(scan, Long.MIN_VALUE)); + scan.setColumnFamilyTimeRange(fam, 20, 82); + assertTrue(memstore.shouldSeek(scan, store, Long.MIN_VALUE)); - scan.setTimeRange(10, 20); - assertTrue(memstore.shouldSeek(scan, Long.MIN_VALUE)); + scan.setColumnFamilyTimeRange(fam, 10, 20); + assertTrue(memstore.shouldSeek(scan, store, Long.MIN_VALUE)); - scan.setTimeRange(8, 12); - assertTrue(memstore.shouldSeek(scan, Long.MIN_VALUE)); + scan.setColumnFamilyTimeRange(fam, 8, 12); + assertTrue(memstore.shouldSeek(scan, store, Long.MIN_VALUE)); - /*This test is not required for correctness but it should pass when - * timestamp range optimization is on*/ - //scan.setTimeRange(28, 42); - //assertTrue(!memstore.shouldSeek(scan)); + scan.setColumnFamilyTimeRange(fam, 28, 42); + assertTrue(!memstore.shouldSeek(scan, store, Long.MIN_VALUE)); } //////////////////////////////////// diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java index d302180..c27e6bc 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java @@ -33,12 +33,7 @@ import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.HBaseTestCase; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.HRegionInfo; -import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.io.HFileLink; import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding; @@ -55,6 +50,7 @@ import org.apache.hadoop.hbase.util.BloomFilterFactory; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.ChecksumType; import org.apache.hadoop.hbase.util.FSUtils; +import org.junit.Test; import org.junit.experimental.categories.Category; import org.mockito.Mockito; @@ -62,6 +58,9 @@ import com.google.common.base.Joiner; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + /** * Test HStoreFile */ @@ -472,8 +471,13 @@ public class TestStoreFile extends HBaseTestCase { columns.add("family:col".getBytes()); Scan scan = new Scan(row.getBytes(),row.getBytes()); - scan.addColumn("family".getBytes(), "family:col".getBytes()); - boolean exists = scanner.shouldUseScanner(scan, columns, Long.MIN_VALUE); + byte[] family = "family".getBytes(); + scan.addColumn(family, "family:col".getBytes()); + Store store = mock(Store.class); + HColumnDescriptor hcd = mock(HColumnDescriptor.class); + when(hcd.getName()).thenReturn(family); + when(store.getFamily()).thenReturn(hcd); + boolean exists = scanner.shouldUseScanner(scan, store, Long.MIN_VALUE); if (i % 2 == 0) { if (!exists) falseNeg++; } else { @@ -662,9 +666,14 @@ public class TestStoreFile extends HBaseTestCase { columns.add(("col" + col).getBytes()); Scan scan = new Scan(row.getBytes(),row.getBytes()); - scan.addColumn("family".getBytes(), ("col"+col).getBytes()); + byte[] family = "family".getBytes(); + scan.addColumn(family, ("col" + col).getBytes()); + Store store = mock(Store.class); + HColumnDescriptor hcd = mock(HColumnDescriptor.class); + when(hcd.getName()).thenReturn(family); + when(store.getFamily()).thenReturn(hcd); boolean exists = - scanner.shouldUseScanner(scan, columns, Long.MIN_VALUE); + scanner.shouldUseScanner(scan, store, Long.MIN_VALUE); boolean shouldRowExist = i % 2 == 0; boolean shouldColExist = j % 2 == 0; shouldColExist = shouldColExist || bt[x] == BloomType.ROW; @@ -771,7 +780,7 @@ public class TestStoreFile extends HBaseTestCase { Scan scan = new Scan(); // Make up a directory hierarchy that has a regiondir ("7e0102") and familyname. - Path storedir = new Path(new Path(this.testDir, "7e0102"), "familyname"); + Path storedir = new Path(new Path(this.testDir, "7e0102"), Bytes.toString(family)); Path dir = new Path(storedir, "1234567890"); HFileContext meta = new HFileContextBuilder().withBlockSize(8 * 1024).build(); // Make a store file and write data to it. @@ -781,7 +790,7 @@ public class TestStoreFile extends HBaseTestCase { .build(); List kvList = getKeyValueSet(timestamps,numRows, - family, qualifier); + qualifier, family); for (KeyValue kv : kvList) { writer.append(kv); @@ -796,21 +805,34 @@ public class TestStoreFile extends HBaseTestCase { TreeSet columns = new TreeSet(Bytes.BYTES_COMPARATOR); columns.add(qualifier); + Store store = mock(Store.class); + HColumnDescriptor hcd = mock(HColumnDescriptor.class); + when(hcd.getName()).thenReturn(family); + when(store.getFamily()).thenReturn(hcd); + scan.setTimeRange(20, 100); - assertTrue(scanner.shouldUseScanner(scan, columns, Long.MIN_VALUE)); + assertTrue(scanner.shouldUseScanner(scan, store, Long.MIN_VALUE)); scan.setTimeRange(1, 2); - assertTrue(scanner.shouldUseScanner(scan, columns, Long.MIN_VALUE)); + assertTrue(scanner.shouldUseScanner(scan, store, Long.MIN_VALUE)); scan.setTimeRange(8, 10); - assertTrue(scanner.shouldUseScanner(scan, columns, Long.MIN_VALUE)); + assertTrue(scanner.shouldUseScanner(scan, store, Long.MIN_VALUE)); - scan.setTimeRange(7, 50); - assertTrue(scanner.shouldUseScanner(scan, columns, Long.MIN_VALUE)); + // lets make sure it still works with column family time ranges + scan.setColumnFamilyTimeRange(family, 7, 50); + assertTrue(scanner.shouldUseScanner(scan, store, Long.MIN_VALUE)); // This test relies on the timestamp range optimization + scan = new Scan(); + scan.setTimeRange(27, 50); + assertTrue(!scanner.shouldUseScanner(scan, store, Long.MIN_VALUE)); + + // should still use the scanner because we override the family time range + scan = new Scan(); scan.setTimeRange(27, 50); - assertTrue(!scanner.shouldUseScanner(scan, columns, Long.MIN_VALUE)); + scan.setColumnFamilyTimeRange(family, 7, 50); + assertTrue(scanner.shouldUseScanner(scan, store, Long.MIN_VALUE)); } public void testCacheOnWriteEvictOnClose() throws Exception { -- 2.3.2 (Apple Git-55)