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 efb437f..a3f62ee 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 @@ -72,8 +72,8 @@ public class Get extends Query private byte [] row = null; private int maxVersions = 1; private boolean cacheBlocks = true; - private int storeLimit = -1; - private int storeOffset = 0; + private long storeLimit = -1; + private long storeOffset = 0; private TimeRange tr = new TimeRange(); private boolean checkExistenceOnly = false; private boolean closestRowBefore = false; @@ -256,7 +256,7 @@ public class Get extends Query * @param limit the maximum number of values returned / row / CF * @return this for invocation chaining */ - public Get setMaxResultsPerColumnFamily(int limit) { + public Get setMaxResultsPerColumnFamily(long limit) { this.storeLimit = limit; return this; } @@ -267,7 +267,7 @@ public class Get extends Query * @param offset is the number of kvs that will be skipped. * @return this for invocation chaining */ - public Get setRowOffsetPerColumnFamily(int offset) { + public Get setRowOffsetPerColumnFamily(long offset) { this.storeOffset = offset; return this; } @@ -326,7 +326,7 @@ public class Get extends Query * to return per Column Family * @return the maximum number of values to fetch per CF */ - public int getMaxResultsPerColumnFamily() { + public long getMaxResultsPerColumnFamily() { return this.storeLimit; } @@ -335,7 +335,7 @@ public class Get extends Query * family (#kvs to be skipped) * @return the row offset */ - public int getRowOffsetPerColumnFamily() { + public long getRowOffsetPerColumnFamily() { return this.storeOffset; } 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 fe9745e..75030fd 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 @@ -104,8 +104,8 @@ public class Scan extends Query { */ private boolean allowPartialResults = false; - private int storeLimit = -1; - private int storeOffset = 0; + private long storeLimit = -1; + private long storeOffset = 0; private boolean getScan; /** @@ -494,7 +494,7 @@ public class Scan extends Query { * Set the maximum number of values to return per row per Column Family * @param limit the maximum number of values returned / row / CF */ - public Scan setMaxResultsPerColumnFamily(int limit) { + public Scan setMaxResultsPerColumnFamily(long limit) { this.storeLimit = limit; return this; } @@ -503,7 +503,7 @@ public class Scan extends Query { * Set offset for the row per Column Family. * @param offset is the number of kvs that will be skipped. */ - public Scan setRowOffsetPerColumnFamily(int offset) { + public Scan setRowOffsetPerColumnFamily(long offset) { this.storeOffset = offset; return this; } @@ -621,7 +621,7 @@ public class Scan extends Query { /** * @return maximum number of values to return per row per CF */ - public int getMaxResultsPerColumnFamily() { + public long getMaxResultsPerColumnFamily() { return this.storeLimit; } @@ -630,7 +630,7 @@ public class Scan extends Query { * family (#kvs to be skipped) * @return row offset */ - public int getRowOffsetPerColumnFamily() { + public long getRowOffsetPerColumnFamily() { return this.storeOffset; } 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 d188531..fa28ec3 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 @@ -1886,25 +1886,25 @@ public final class ClientProtos { */ boolean getCacheBlocks(); - // optional uint32 store_limit = 8; + // optional uint64 store_limit = 8; /** - * optional uint32 store_limit = 8; + * optional uint64 store_limit = 8; */ boolean hasStoreLimit(); /** - * optional uint32 store_limit = 8; + * optional uint64 store_limit = 8; */ - int getStoreLimit(); + long getStoreLimit(); - // optional uint32 store_offset = 9; + // optional uint64 store_offset = 9; /** - * optional uint32 store_offset = 9; + * optional uint64 store_offset = 9; */ boolean hasStoreOffset(); /** - * optional uint32 store_offset = 9; + * optional uint64 store_offset = 9; */ - int getStoreOffset(); + long getStoreOffset(); // optional bool existence_only = 10 [default = false]; /** @@ -2078,12 +2078,12 @@ public final class ClientProtos { } case 64: { bitField0_ |= 0x00000020; - storeLimit_ = input.readUInt32(); + storeLimit_ = input.readUInt64(); break; } case 72: { bitField0_ |= 0x00000040; - storeOffset_ = input.readUInt32(); + storeOffset_ = input.readUInt64(); break; } case 80: { @@ -2323,35 +2323,35 @@ public final class ClientProtos { return cacheBlocks_; } - // optional uint32 store_limit = 8; + // optional uint64 store_limit = 8; public static final int STORE_LIMIT_FIELD_NUMBER = 8; - private int storeLimit_; + private long storeLimit_; /** - * optional uint32 store_limit = 8; + * optional uint64 store_limit = 8; */ public boolean hasStoreLimit() { return ((bitField0_ & 0x00000020) == 0x00000020); } /** - * optional uint32 store_limit = 8; + * optional uint64 store_limit = 8; */ - public int getStoreLimit() { + public long getStoreLimit() { return storeLimit_; } - // optional uint32 store_offset = 9; + // optional uint64 store_offset = 9; public static final int STORE_OFFSET_FIELD_NUMBER = 9; - private int storeOffset_; + private long storeOffset_; /** - * optional uint32 store_offset = 9; + * optional uint64 store_offset = 9; */ public boolean hasStoreOffset() { return ((bitField0_ & 0x00000040) == 0x00000040); } /** - * optional uint32 store_offset = 9; + * optional uint64 store_offset = 9; */ - public int getStoreOffset() { + public long getStoreOffset() { return storeOffset_; } @@ -2441,8 +2441,8 @@ public final class ClientProtos { timeRange_ = org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TimeRange.getDefaultInstance(); maxVersions_ = 1; cacheBlocks_ = true; - storeLimit_ = 0; - storeOffset_ = 0; + storeLimit_ = 0L; + storeOffset_ = 0L; existenceOnly_ = false; consistency_ = org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Consistency.STRONG; cfTimeRange_ = java.util.Collections.emptyList(); @@ -2509,10 +2509,10 @@ public final class ClientProtos { output.writeBool(7, cacheBlocks_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeUInt32(8, storeLimit_); + output.writeUInt64(8, storeLimit_); } if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeUInt32(9, storeOffset_); + output.writeUInt64(9, storeOffset_); } if (((bitField0_ & 0x00000080) == 0x00000080)) { output.writeBool(10, existenceOnly_); @@ -2562,11 +2562,11 @@ public final class ClientProtos { } if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(8, storeLimit_); + .computeUInt64Size(8, storeLimit_); } if (((bitField0_ & 0x00000040) == 0x00000040)) { size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(9, storeOffset_); + .computeUInt64Size(9, storeOffset_); } if (((bitField0_ & 0x00000080) == 0x00000080)) { size += com.google.protobuf.CodedOutputStream @@ -2697,11 +2697,11 @@ public final class ClientProtos { } if (hasStoreLimit()) { hash = (37 * hash) + STORE_LIMIT_FIELD_NUMBER; - hash = (53 * hash) + getStoreLimit(); + hash = (53 * hash) + hashLong(getStoreLimit()); } if (hasStoreOffset()) { hash = (37 * hash) + STORE_OFFSET_FIELD_NUMBER; - hash = (53 * hash) + getStoreOffset(); + hash = (53 * hash) + hashLong(getStoreOffset()); } if (hasExistenceOnly()) { hash = (37 * hash) + EXISTENCE_ONLY_FIELD_NUMBER; @@ -2866,9 +2866,9 @@ public final class ClientProtos { bitField0_ = (bitField0_ & ~0x00000020); cacheBlocks_ = true; bitField0_ = (bitField0_ & ~0x00000040); - storeLimit_ = 0; + storeLimit_ = 0L; bitField0_ = (bitField0_ & ~0x00000080); - storeOffset_ = 0; + storeOffset_ = 0L; bitField0_ = (bitField0_ & ~0x00000100); existenceOnly_ = false; bitField0_ = (bitField0_ & ~0x00000200); @@ -3971,68 +3971,68 @@ public final class ClientProtos { return this; } - // optional uint32 store_limit = 8; - private int storeLimit_ ; + // optional uint64 store_limit = 8; + private long storeLimit_ ; /** - * optional uint32 store_limit = 8; + * optional uint64 store_limit = 8; */ public boolean hasStoreLimit() { return ((bitField0_ & 0x00000080) == 0x00000080); } /** - * optional uint32 store_limit = 8; + * optional uint64 store_limit = 8; */ - public int getStoreLimit() { + public long getStoreLimit() { return storeLimit_; } /** - * optional uint32 store_limit = 8; + * optional uint64 store_limit = 8; */ - public Builder setStoreLimit(int value) { + public Builder setStoreLimit(long value) { bitField0_ |= 0x00000080; storeLimit_ = value; onChanged(); return this; } /** - * optional uint32 store_limit = 8; + * optional uint64 store_limit = 8; */ public Builder clearStoreLimit() { bitField0_ = (bitField0_ & ~0x00000080); - storeLimit_ = 0; + storeLimit_ = 0L; onChanged(); return this; } - // optional uint32 store_offset = 9; - private int storeOffset_ ; + // optional uint64 store_offset = 9; + private long storeOffset_ ; /** - * optional uint32 store_offset = 9; + * optional uint64 store_offset = 9; */ public boolean hasStoreOffset() { return ((bitField0_ & 0x00000100) == 0x00000100); } /** - * optional uint32 store_offset = 9; + * optional uint64 store_offset = 9; */ - public int getStoreOffset() { + public long getStoreOffset() { return storeOffset_; } /** - * optional uint32 store_offset = 9; + * optional uint64 store_offset = 9; */ - public Builder setStoreOffset(int value) { + public Builder setStoreOffset(long value) { bitField0_ |= 0x00000100; storeOffset_ = value; onChanged(); return this; } /** - * optional uint32 store_offset = 9; + * optional uint64 store_offset = 9; */ public Builder clearStoreOffset() { bitField0_ = (bitField0_ & ~0x00000100); - storeOffset_ = 0; + storeOffset_ = 0L; onChanged(); return this; } @@ -13985,25 +13985,25 @@ public final class ClientProtos { */ long getMaxResultSize(); - // optional uint32 store_limit = 11; + // optional uint64 store_limit = 11; /** - * optional uint32 store_limit = 11; + * optional uint64 store_limit = 11; */ boolean hasStoreLimit(); /** - * optional uint32 store_limit = 11; + * optional uint64 store_limit = 11; */ - int getStoreLimit(); + long getStoreLimit(); - // optional uint32 store_offset = 12; + // optional uint64 store_offset = 12; /** - * optional uint32 store_offset = 12; + * optional uint64 store_offset = 12; */ boolean hasStoreOffset(); /** - * optional uint32 store_offset = 12; + * optional uint64 store_offset = 12; */ - int getStoreOffset(); + long getStoreOffset(); // optional bool load_column_families_on_demand = 13; /** @@ -14234,12 +14234,12 @@ public final class ClientProtos { } case 88: { bitField0_ |= 0x00000100; - storeLimit_ = input.readUInt32(); + storeLimit_ = input.readUInt64(); break; } case 96: { bitField0_ |= 0x00000200; - storeOffset_ = input.readUInt32(); + storeOffset_ = input.readUInt64(); break; } case 104: { @@ -14547,35 +14547,35 @@ public final class ClientProtos { return maxResultSize_; } - // optional uint32 store_limit = 11; + // optional uint64 store_limit = 11; public static final int STORE_LIMIT_FIELD_NUMBER = 11; - private int storeLimit_; + private long storeLimit_; /** - * optional uint32 store_limit = 11; + * optional uint64 store_limit = 11; */ public boolean hasStoreLimit() { return ((bitField0_ & 0x00000100) == 0x00000100); } /** - * optional uint32 store_limit = 11; + * optional uint64 store_limit = 11; */ - public int getStoreLimit() { + public long getStoreLimit() { return storeLimit_; } - // optional uint32 store_offset = 12; + // optional uint64 store_offset = 12; public static final int STORE_OFFSET_FIELD_NUMBER = 12; - private int storeOffset_; + private long storeOffset_; /** - * optional uint32 store_offset = 12; + * optional uint64 store_offset = 12; */ public boolean hasStoreOffset() { return ((bitField0_ & 0x00000200) == 0x00000200); } /** - * optional uint32 store_offset = 12; + * optional uint64 store_offset = 12; */ - public int getStoreOffset() { + public long getStoreOffset() { return storeOffset_; } @@ -14730,8 +14730,8 @@ public final class ClientProtos { cacheBlocks_ = true; batchSize_ = 0; maxResultSize_ = 0L; - storeLimit_ = 0; - storeOffset_ = 0; + storeLimit_ = 0L; + storeOffset_ = 0L; loadColumnFamiliesOnDemand_ = false; small_ = false; reversed_ = false; @@ -14807,10 +14807,10 @@ public final class ClientProtos { output.writeUInt64(10, maxResultSize_); } if (((bitField0_ & 0x00000100) == 0x00000100)) { - output.writeUInt32(11, storeLimit_); + output.writeUInt64(11, storeLimit_); } if (((bitField0_ & 0x00000200) == 0x00000200)) { - output.writeUInt32(12, storeOffset_); + output.writeUInt64(12, storeOffset_); } if (((bitField0_ & 0x00000400) == 0x00000400)) { output.writeBool(13, loadColumnFamiliesOnDemand_); @@ -14884,11 +14884,11 @@ public final class ClientProtos { } if (((bitField0_ & 0x00000100) == 0x00000100)) { size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(11, storeLimit_); + .computeUInt64Size(11, storeLimit_); } if (((bitField0_ & 0x00000200) == 0x00000200)) { size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(12, storeOffset_); + .computeUInt64Size(12, storeOffset_); } if (((bitField0_ & 0x00000400) == 0x00000400)) { size += com.google.protobuf.CodedOutputStream @@ -15082,11 +15082,11 @@ public final class ClientProtos { } if (hasStoreLimit()) { hash = (37 * hash) + STORE_LIMIT_FIELD_NUMBER; - hash = (53 * hash) + getStoreLimit(); + hash = (53 * hash) + hashLong(getStoreLimit()); } if (hasStoreOffset()) { hash = (37 * hash) + STORE_OFFSET_FIELD_NUMBER; - hash = (53 * hash) + getStoreOffset(); + hash = (53 * hash) + hashLong(getStoreOffset()); } if (hasLoadColumnFamiliesOnDemand()) { hash = (37 * hash) + LOAD_COLUMN_FAMILIES_ON_DEMAND_FIELD_NUMBER; @@ -15277,9 +15277,9 @@ public final class ClientProtos { bitField0_ = (bitField0_ & ~0x00000100); maxResultSize_ = 0L; bitField0_ = (bitField0_ & ~0x00000200); - storeLimit_ = 0; + storeLimit_ = 0L; bitField0_ = (bitField0_ & ~0x00000400); - storeOffset_ = 0; + storeOffset_ = 0L; bitField0_ = (bitField0_ & ~0x00000800); loadColumnFamiliesOnDemand_ = false; bitField0_ = (bitField0_ & ~0x00001000); @@ -16537,68 +16537,68 @@ public final class ClientProtos { return this; } - // optional uint32 store_limit = 11; - private int storeLimit_ ; + // optional uint64 store_limit = 11; + private long storeLimit_ ; /** - * optional uint32 store_limit = 11; + * optional uint64 store_limit = 11; */ public boolean hasStoreLimit() { return ((bitField0_ & 0x00000400) == 0x00000400); } /** - * optional uint32 store_limit = 11; + * optional uint64 store_limit = 11; */ - public int getStoreLimit() { + public long getStoreLimit() { return storeLimit_; } /** - * optional uint32 store_limit = 11; + * optional uint64 store_limit = 11; */ - public Builder setStoreLimit(int value) { + public Builder setStoreLimit(long value) { bitField0_ |= 0x00000400; storeLimit_ = value; onChanged(); return this; } /** - * optional uint32 store_limit = 11; + * optional uint64 store_limit = 11; */ public Builder clearStoreLimit() { bitField0_ = (bitField0_ & ~0x00000400); - storeLimit_ = 0; + storeLimit_ = 0L; onChanged(); return this; } - // optional uint32 store_offset = 12; - private int storeOffset_ ; + // optional uint64 store_offset = 12; + private long storeOffset_ ; /** - * optional uint32 store_offset = 12; + * optional uint64 store_offset = 12; */ public boolean hasStoreOffset() { return ((bitField0_ & 0x00000800) == 0x00000800); } /** - * optional uint32 store_offset = 12; + * optional uint64 store_offset = 12; */ - public int getStoreOffset() { + public long getStoreOffset() { return storeOffset_; } /** - * optional uint32 store_offset = 12; + * optional uint64 store_offset = 12; */ - public Builder setStoreOffset(int value) { + public Builder setStoreOffset(long value) { bitField0_ |= 0x00000800; storeOffset_ = value; onChanged(); return this; } /** - * optional uint32 store_offset = 12; + * optional uint64 store_offset = 12; */ public Builder clearStoreOffset() { bitField0_ = (bitField0_ & ~0x00000800); - storeOffset_ = 0; + storeOffset_ = 0L; onChanged(); return this; } @@ -34189,8 +34189,8 @@ public final class ClientProtos { "ter\030\004 \001(\0132\020.hbase.pb.Filter\022\'\n\ntime_rang" + "e\030\005 \001(\0132\023.hbase.pb.TimeRange\022\027\n\014max_vers", "ions\030\006 \001(\r:\0011\022\032\n\014cache_blocks\030\007 \001(\010:\004tru" + - "e\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\0222\n\013c" + + "e\022\023\n\013store_limit\030\010 \001(\004\022\024\n\014store_offset\030\t" + + " \001(\004\022\035\n\016existence_only\030\n \001(\010:\005false\0222\n\013c" + "onsistency\030\014 \001(\0162\025.hbase.pb.Consistency:" + "\006STRONG\0226\n\rcf_time_range\030\r \003(\0132\037.hbase.p" + "b.ColumnFamilyTimeRange\"\203\001\n\006Result\022\034\n\004ce" + @@ -34240,7 +34240,7 @@ public final class ClientProtos { "ge\022\027\n\014max_versions\030\007 \001(\r:\0011\022\032\n\014cache_blo", "cks\030\010 \001(\010:\004true\022\022\n\nbatch_size\030\t \001(\r\022\027\n\017m" + "ax_result_size\030\n \001(\004\022\023\n\013store_limit\030\013 \001(" + - "\r\022\024\n\014store_offset\030\014 \001(\r\022&\n\036load_column_f" + + "\004\022\024\n\014store_offset\030\014 \001(\004\022&\n\036load_column_f" + "amilies_on_demand\030\r \001(\010\022\r\n\005small\030\016 \001(\010\022\027" + "\n\010reversed\030\017 \001(\010:\005false\0222\n\013consistency\030\020" + " \001(\0162\025.hbase.pb.Consistency:\006STRONG\022\017\n\007c" + diff --git a/hbase-protocol/src/main/protobuf/Client.proto b/hbase-protocol/src/main/protobuf/Client.proto index ca9abdc..68b76c5 100644 --- a/hbase-protocol/src/main/protobuf/Client.proto +++ b/hbase-protocol/src/main/protobuf/Client.proto @@ -74,8 +74,8 @@ message Get { optional TimeRange time_range = 5; optional uint32 max_versions = 6 [default = 1]; optional bool cache_blocks = 7 [default = true]; - optional uint32 store_limit = 8; - optional uint32 store_offset = 9; + optional uint64 store_limit = 8; + optional uint64 store_offset = 9; // The result isn't asked for, just check for // the existence. @@ -245,8 +245,8 @@ message Scan { optional bool cache_blocks = 8 [default = true]; optional uint32 batch_size = 9; optional uint64 max_result_size = 10; - optional uint32 store_limit = 11; - optional uint32 store_offset = 12; + optional uint64 store_limit = 11; + optional uint64 store_offset = 12; optional bool load_column_families_on_demand = 13; /* DO NOT add defaults to load_column_families_on_demand. */ optional bool small = 14; optional bool reversed = 15 [default = false]; 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 3049608..11d53d1 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 @@ -64,9 +64,9 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner protected KeyValueHeap heap; protected boolean cacheBlocks; - protected int countPerRow = 0; - protected int storeLimit = -1; - protected int storeOffset = 0; + protected long countPerRow = 0; + protected long storeLimit = -1; + protected long storeOffset = 0; // Used to indicate that the scanner has closed (see HBASE-1107) // Doesnt need to be volatile because it's always accessed via synchronized methods diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIntraRowPagination.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIntraRowPagination.java index 1f6dc98..7b98ab7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIntraRowPagination.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIntraRowPagination.java @@ -70,8 +70,8 @@ public class TestIntraRowPagination { List kvListExp = new ArrayList(); - int storeOffset = 1; - int storeLimit = 3; + long storeOffset = 1; + long storeLimit = 3; for (int r = 0; r < ROWS.length; r++) { put = new Put(ROWS[r]); for (int c = 0; c < FAMILIES.length; c++) {