From 6f97c02b06e6c23beb45121c0b32960e3b173b9e Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Tue, 13 Mar 2018 15:35:19 -0700 Subject: [PATCH] HBASE-17528 Remove the Scan.ReadType flag introduced in HBASE-17045 --- .../java/org/apache/hadoop/hbase/client/Scan.java | 24 +++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) 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 7139b26da9..a745e6ab3a 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 @@ -73,9 +73,7 @@ import org.apache.hadoop.hbase.util.Bytes; * For small scan, it is deprecated in 2.0.0. Now we have a {@link #setLimit(int)} method in Scan * object which is used to tell RS how many rows we want. If the rows return reaches the limit, the * RS will close the RegionScanner automatically. And we will also fetch data when openScanner in - * the new implementation, this means we can also finish a scan operation in one rpc call. And we - * have also introduced a {@link #setReadType(ReadType)} method. You can use this method to tell RS - * to use pread explicitly. + * the new implementation, this means we can also finish a scan operation in one rpc call. *

* Expert: To explicitly disable server-side block caching for this scan, execute * {@link #setCacheBlocks(boolean)}. @@ -1016,12 +1014,11 @@ public class Scan extends Query { * better performance for small scan. [HBASE-9488]. Generally, if the scan range is within one * data block(64KB), it could be considered as a small scan. * @param small - * @deprecated since 2.0.0. Use {@link #setLimit(int)} and {@link #setReadType(ReadType)} instead. + * @deprecated since 2.0.0. Use {@link #setLimit(int)} instead. * And for the one rpc optimization, now we will also fetch data when openScanner, and * if the number of rows reaches the limit then we will close the scanner * automatically which means we will fall back to one rpc. * @see #setLimit(int) - * @see #setReadType(ReadType) */ @Deprecated public Scan setSmall(boolean small) { @@ -1146,33 +1143,40 @@ public class Scan extends Query { } /** - * Call this when you only want to get one row. It will set {@code limit} to {@code 1}, and also - * set {@code readType} to {@link ReadType#PREAD}. + * Call this when you only want to get one row. It will set {@code limit} to {@code 1}. * @return this */ public Scan setOneRowLimit() { return setLimit(1).setReadType(ReadType.PREAD); } + /** + * @deprecated Since hbase-2.0.0. Will be removed in 3.0.0. Server will decide whether a + * streaming- or pread-type read. + */ @InterfaceAudience.Public + @Deprecated public enum ReadType { DEFAULT, STREAM, PREAD } /** * @return the read type for this scan + * @deprecated Since hbase-2.0.0. Will be removed in 3.0.0. Server will decide whether a + * streaming- or pread-type read. */ + @Deprecated public ReadType getReadType() { return readType; } /** * Set the read type for this scan. - *

- * Notice that we may choose to use pread even if you specific {@link ReadType#STREAM} here. For - * example, we will always use pread if this is a get scan. + * @deprecated Since hbase-2.0.0. Will be removed in 3.0.0. Server will decide whether a + * streaming- or pread-type read. * @return this */ + @Deprecated public Scan setReadType(ReadType readType) { this.readType = readType; return this; -- 2.11.0 (Apple Git-81)