pair = getRegion(nameOfRegionA);
if (pair != null && pair.getFirst().getReplicaId() != HRegionInfo.DEFAULT_REPLICA_ID)
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionKey.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionKey.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionKey.java
index f37690c..3d3ad33 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionKey.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionKey.java
@@ -23,6 +23,7 @@ import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
+import java.util.Objects;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HConstants;
@@ -124,8 +125,7 @@ class HConnectionKey {
for (String property : CONNECTION_PROPERTIES) {
String thisValue = this.properties.get(property);
String thatValue = that.properties.get(property);
- //noinspection StringEquality
- if (thisValue == thatValue) {
+ if (Objects.equals(thisValue, thatValue)) {
continue;
}
if (thisValue == null || !thisValue.equals(thatValue)) {
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java
index e9531f3..5fb9e63 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java
@@ -1808,6 +1808,7 @@ public class HTable implements HTableInterface, RegionLocator {
return getKeysAndRegionsInRange(start, end, true).getFirst();
}
+ @Override
public void setOperationTimeout(int operationTimeout) {
this.operationTimeout = operationTimeout;
if (mutator != null) {
@@ -1816,6 +1817,7 @@ public class HTable implements HTableInterface, RegionLocator {
multiAp.setOperationTimeout(operationTimeout);
}
+ @Override
public int getOperationTimeout() {
return operationTimeout;
}
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableMultiplexer.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableMultiplexer.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableMultiplexer.java
index 7b2b136..21e3ce6 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableMultiplexer.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableMultiplexer.java
@@ -468,7 +468,7 @@ public class HTableMultiplexer {
}
public long getTotalBufferedCount() {
- return queue.size() + currentProcessingCount.get();
+ return (long) queue.size() + currentProcessingCount.get();
}
public AtomicAverageCounter getAverageLatencyCounter() {
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java
index 502703b..d219306 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java
@@ -308,6 +308,7 @@ public class HTablePool implements Closeable {
*
* Note: this is a 'shutdown' of all the table pools.
*/
+ @Override
public void close() throws IOException {
for (String tableName : tables.keySet()) {
closeTablePool(tableName);
@@ -524,6 +525,7 @@ public class HTablePool implements Closeable {
*
* @throws IOException
*/
+ @Override
public void close() throws IOException {
checkState();
open = false;
@@ -635,7 +637,8 @@ public class HTablePool implements Closeable {
private void checkState() {
if (!isOpen()) {
- throw new IllegalStateException("Table=" + new String(table.getTableName()) + " already closed");
+ throw new IllegalStateException("Table=" + table.getName().getNameAsString()
+ + " already closed");
}
}
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Increment.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Increment.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Increment.java
index 48f2fd6..76759b7 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Increment.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Increment.java
@@ -50,7 +50,7 @@ import org.apache.hadoop.hbase.util.ClassSize;
@InterfaceAudience.Public
@InterfaceStability.Stable
public class Increment extends Mutation implements Comparable {
- private static final long HEAP_OVERHEAD = ClassSize.REFERENCE + ClassSize.TIMERANGE;
+ private static final long HEAP_OVERHEAD = (long) ClassSize.REFERENCE + ClassSize.TIMERANGE;
private TimeRange tr = new TimeRange();
/**
@@ -164,6 +164,7 @@ public class Increment extends Mutation implements Comparable {
* client that is not interested in the result can save network bandwidth setting this
* to false.
*/
+ @Override
public Increment setReturnResults(boolean returnResults) {
super.setReturnResults(returnResults);
return this;
@@ -173,6 +174,7 @@ public class Increment extends Mutation implements Comparable {
* @return current setting for returnResults
*/
// This method makes public the superclasses's protected method.
+ @Override
public boolean isReturnResults() {
return super.isReturnResults();
}
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java
index 126b117..b9ebac3 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java
@@ -27,7 +27,7 @@ import org.apache.hadoop.hbase.classification.InterfaceStability;
@InterfaceAudience.Public
@InterfaceStability.Stable
public class NoServerForRegionException extends DoNotRetryRegionException {
- private static final long serialVersionUID = 1L << 11 - 1L;
+ private static final long serialVersionUID = (1L << 11) - 1L;
/** default constructor */
public NoServerForRegionException() {
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PerClientRandomNonceGenerator.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PerClientRandomNonceGenerator.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PerClientRandomNonceGenerator.java
index 7ac4546..64b44a9 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PerClientRandomNonceGenerator.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PerClientRandomNonceGenerator.java
@@ -38,10 +38,12 @@ public class PerClientRandomNonceGenerator implements NonceGenerator {
this.clientId = (((long)Arrays.hashCode(clientIdBase)) << 32) + rdm.nextInt();
}
+ @Override
public long getNonceGroup() {
return this.clientId;
}
+ @Override
public long newNonce() {
long result = HConstants.NO_NONCE;
do {
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegistryFactory.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegistryFactory.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegistryFactory.java
index d7aa739..789e2e1 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegistryFactory.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegistryFactory.java
@@ -38,7 +38,7 @@ class RegistryFactory {
ZooKeeperRegistry.class.getName());
Registry registry = null;
try {
- registry = (Registry)Class.forName(registryClass).newInstance();
+ registry = (Registry)Class.forName(registryClass).getDeclaredConstructor().newInstance();
} catch (Throwable t) {
throw new IOException(t);
}
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCaller.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCaller.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCaller.java
index b03595a..af24d5c 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCaller.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCaller.java
@@ -66,6 +66,7 @@ public class RpcRetryingCaller {
private final long pauseForCQTBE;
private final int retries;
private final int rpcTimeout;// timeout for each rpc request
+ private final Object lock = new Object();
private final AtomicBoolean cancelled = new AtomicBoolean(false);
private final RetryingCallerInterceptor interceptor;
private final RetryingCallerInterceptorContext context;
@@ -105,16 +106,16 @@ public class RpcRetryingCaller {
private int getTimeout(int callTimeout){
int timeout = getRemainingTime(callTimeout);
- if (timeout <= 0 || rpcTimeout > 0 && rpcTimeout < timeout){
+ if (timeout <= 0 || (rpcTimeout > 0 && rpcTimeout < timeout)){
timeout = rpcTimeout;
}
return timeout;
}
public void cancel(){
- synchronized (cancelled){
+ synchronized (lock){
cancelled.set(true);
- cancelled.notifyAll();
+ lock.notifyAll();
}
}
@@ -181,9 +182,9 @@ public class RpcRetryingCaller {
}
try {
if (expectedSleep > 0) {
- synchronized (cancelled) {
+ synchronized (lock) {
if (cancelled.get()) return null;
- cancelled.wait(expectedSleep);
+ lock.wait(expectedSleep);
}
}
if (cancelled.get()) return null;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
----------------------------------------------------------------------
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 1340602..541b3d8 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
@@ -871,6 +871,7 @@ public class Scan extends Query {
return allowPartialResults;
}
+ @Override
public Scan setLoadColumnFamiliesOnDemand(boolean value) {
return (Scan) super.setLoadColumnFamiliesOnDemand(value);
}
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/LongColumnInterpreter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/LongColumnInterpreter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/LongColumnInterpreter.java
index 3ea3802..5e1d162 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/LongColumnInterpreter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/LongColumnInterpreter.java
@@ -42,6 +42,7 @@ import org.apache.hadoop.hbase.util.Bytes;
public class LongColumnInterpreter extends ColumnInterpreter {
+ @Override
public Long getValue(byte[] colFamily, byte[] colQualifier, Cell kv)
throws IOException {
if (kv == null || kv.getValueLength() != Bytes.SIZEOF_LONG)
@@ -49,7 +50,7 @@ public class LongColumnInterpreter extends ColumnInterpreter clazz = Class.forName(filter);
+ Object o = clazz.getDeclaredConstructor().newInstance();
} catch (Exception e) {
throw new ReplicationException("Configured WALEntryFilter " + filter +
" could not be created. Failing add/update " + "peer operation.", e);
@@ -777,12 +778,12 @@ public class ReplicationAdmin implements Closeable {
* @see java.lang.Object#equals(java.lang.Object)
*/
private boolean compareForReplication(HTableDescriptor peerHtd, HTableDescriptor localHtd) {
- if (peerHtd == localHtd) {
- return true;
- }
if (peerHtd == null) {
return false;
}
+ if (peerHtd.equals(localHtd)) {
+ return true;
+ }
boolean result = false;
// Create a copy of peer HTD as we need to change its replication
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/security/SecurityCapability.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/security/SecurityCapability.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/security/SecurityCapability.java
index 1847b2e..5fc97ba 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/security/SecurityCapability.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/security/SecurityCapability.java
@@ -34,7 +34,7 @@ public enum SecurityCapability {
CELL_AUTHORIZATION(3),
CELL_VISIBILITY(4);
- private int value;
+ private final int value;
public int getValue() {
return value;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BinaryComparator.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BinaryComparator.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BinaryComparator.java
index d5c2613..09fe7e1 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BinaryComparator.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BinaryComparator.java
@@ -50,6 +50,7 @@ public class BinaryComparator extends ByteArrayComparable {
/**
* @return The comparator serialized using pb
*/
+ @Override
public byte [] toByteArray() {
ComparatorProtos.BinaryComparator.Builder builder =
ComparatorProtos.BinaryComparator.newBuilder();
@@ -79,6 +80,7 @@ public class BinaryComparator extends ByteArrayComparable {
* @return true if and only if the fields of the comparator that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(ByteArrayComparable other) {
if (other == this) return true;
if (!(other instanceof BinaryComparator)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BinaryPrefixComparator.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BinaryPrefixComparator.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BinaryPrefixComparator.java
index c05eb8f..366b2f9 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BinaryPrefixComparator.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BinaryPrefixComparator.java
@@ -52,6 +52,7 @@ public class BinaryPrefixComparator extends ByteArrayComparable {
/**
* @return The comparator serialized using pb
*/
+ @Override
public byte [] toByteArray() {
ComparatorProtos.BinaryPrefixComparator.Builder builder =
ComparatorProtos.BinaryPrefixComparator.newBuilder();
@@ -81,6 +82,7 @@ public class BinaryPrefixComparator extends ByteArrayComparable {
* @return true if and only if the fields of the comparator that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(ByteArrayComparable other) {
if (other == this) return true;
if (!(other instanceof BinaryPrefixComparator)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BitComparator.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BitComparator.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BitComparator.java
index 0b7c52d..07af22f 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BitComparator.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BitComparator.java
@@ -66,6 +66,7 @@ public class BitComparator extends ByteArrayComparable {
/**
* @return The comparator serialized using pb
*/
+ @Override
public byte [] toByteArray() {
ComparatorProtos.BitComparator.Builder builder =
ComparatorProtos.BitComparator.newBuilder();
@@ -99,6 +100,7 @@ public class BitComparator extends ByteArrayComparable {
* @return true if and only if the fields of the comparator that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(ByteArrayComparable other) {
if (other == this) return true;
if (!(other instanceof BitComparator)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnCountGetFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnCountGetFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnCountGetFilter.java
index 18f49f6..d2f6ec8 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnCountGetFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnCountGetFilter.java
@@ -84,6 +84,7 @@ public class ColumnCountGetFilter extends FilterBase {
/**
* @return The filter serialized using pb
*/
+ @Override
public byte [] toByteArray() {
FilterProtos.ColumnCountGetFilter.Builder builder =
FilterProtos.ColumnCountGetFilter.newBuilder();
@@ -113,6 +114,7 @@ public class ColumnCountGetFilter extends FilterBase {
* @return true if and only if the fields of the filter that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this) return true;
if (!(o instanceof ColumnCountGetFilter)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPaginationFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPaginationFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPaginationFilter.java
index 6f297fb..806863a 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPaginationFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPaginationFilter.java
@@ -174,6 +174,7 @@ public class ColumnPaginationFilter extends FilterBase
/**
* @return The filter serialized using pb
*/
+ @Override
public byte [] toByteArray() {
FilterProtos.ColumnPaginationFilter.Builder builder =
FilterProtos.ColumnPaginationFilter.newBuilder();
@@ -213,6 +214,7 @@ public class ColumnPaginationFilter extends FilterBase
* @return true if and only if the fields of the filter that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this) return true;
if (!(o instanceof ColumnPaginationFilter)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPrefixFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPrefixFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPrefixFilter.java
index 6a9e6e9..eb0be8d 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPrefixFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPrefixFilter.java
@@ -99,6 +99,7 @@ public class ColumnPrefixFilter extends FilterBase {
/**
* @return The filter serialized using pb
*/
+ @Override
public byte [] toByteArray() {
FilterProtos.ColumnPrefixFilter.Builder builder =
FilterProtos.ColumnPrefixFilter.newBuilder();
@@ -128,6 +129,7 @@ public class ColumnPrefixFilter extends FilterBase {
* @return true if and only if the fields of the filter that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this) return true;
if (!(o instanceof ColumnPrefixFilter)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnRangeFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnRangeFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnRangeFilter.java
index 9e6c90f..9006f87 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnRangeFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnRangeFilter.java
@@ -143,8 +143,8 @@ public class ColumnRangeFilter extends FilterBase {
int cmpMax = Bytes.compareTo(buffer, qualifierOffset, qualifierLength,
this.maxColumn, 0, this.maxColumn.length);
- if (this.maxColumnInclusive && cmpMax <= 0 ||
- !this.maxColumnInclusive && cmpMax < 0) {
+ if ((this.maxColumnInclusive && cmpMax <= 0) ||
+ (!this.maxColumnInclusive && cmpMax < 0)) {
return ReturnCode.INCLUDE;
}
@@ -177,6 +177,7 @@ public class ColumnRangeFilter extends FilterBase {
/**
* @return The filter serialized using pb
*/
+ @Override
public byte [] toByteArray() {
FilterProtos.ColumnRangeFilter.Builder builder =
FilterProtos.ColumnRangeFilter.newBuilder();
@@ -211,6 +212,7 @@ public class ColumnRangeFilter extends FilterBase {
* @return true if and only if the fields of the filter that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this) return true;
if (!(o instanceof ColumnRangeFilter)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/CompareFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/CompareFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/CompareFilter.java
index 9987e23..b7595d5 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/CompareFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/CompareFilter.java
@@ -170,6 +170,7 @@ public abstract class CompareFilter extends FilterBase {
* @return true if and only if the fields of the filter that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this) return true;
if (!(o instanceof CompareFilter)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/DependentColumnFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/DependentColumnFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/DependentColumnFilter.java
index 2843751..8582e38 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/DependentColumnFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/DependentColumnFilter.java
@@ -217,6 +217,7 @@ public class DependentColumnFilter extends CompareFilter {
/**
* @return The filter serialized using pb
*/
+ @Override
public byte [] toByteArray() {
FilterProtos.DependentColumnFilter.Builder builder =
FilterProtos.DependentColumnFilter.newBuilder();
@@ -268,6 +269,7 @@ public class DependentColumnFilter extends CompareFilter {
*/
@edu.umd.cs.findbugs.annotations.SuppressWarnings(
value="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE")
+ @Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this) return true;
if (!(o instanceof DependentColumnFilter)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FamilyFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FamilyFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FamilyFilter.java
index f9722d3..9aa078c 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FamilyFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FamilyFilter.java
@@ -82,6 +82,7 @@ public class FamilyFilter extends CompareFilter {
/**
* @return The filter serialized using pb
*/
+ @Override
public byte [] toByteArray() {
FilterProtos.FamilyFilter.Builder builder =
FilterProtos.FamilyFilter.newBuilder();
@@ -121,6 +122,7 @@ public class FamilyFilter extends CompareFilter {
* @return true if and only if the fields of the filter that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this) return true;
if (!(o instanceof FamilyFilter)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterBase.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterBase.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterBase.java
index 3c6bcab..812252c 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterBase.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterBase.java
@@ -142,6 +142,7 @@ public abstract class FilterBase extends Filter {
*
* {@inheritDoc}
*/
+ @Override
public Cell getNextCellHint(Cell currentKV) throws IOException {
// Old filters based off of this class will override KeyValue getNextKeyHint(KeyValue).
// Thus to maintain compatibility we need to call the old version.
@@ -154,6 +155,7 @@ public abstract class FilterBase extends Filter {
*
* {@inheritDoc}
*/
+ @Override
public boolean isFamilyEssential(byte[] name) throws IOException {
return true;
}
@@ -171,6 +173,7 @@ public abstract class FilterBase extends Filter {
/**
* Return filter's info for debugging and logging purpose.
*/
+ @Override
public String toString() {
return this.getClass().getSimpleName();
}
@@ -178,6 +181,7 @@ public abstract class FilterBase extends Filter {
/**
* Return length 0 byte array for Filters that don't require special serialization
*/
+ @Override
public byte[] toByteArray() throws IOException {
return new byte[0];
}
@@ -189,6 +193,7 @@ public abstract class FilterBase extends Filter {
* @return true if and only if the fields of the filter that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter other) {
return true;
}
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java
index 0b39b56..8345fcf 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java
@@ -221,6 +221,7 @@ final public class FilterList extends Filter {
/**
* @return The filter serialized using pb
*/
+ @Override
public byte[] toByteArray() throws IOException {
FilterProtos.FilterList.Builder builder = FilterProtos.FilterList.newBuilder();
builder.setOperator(FilterProtos.FilterList.Operator.valueOf(operator.name()));
@@ -262,6 +263,7 @@ final public class FilterList extends Filter {
* @return true if and only if the fields of the filter that are serialized are equal to the
* corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter other) {
if (other == this) return true;
if (!(other instanceof FilterList)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterWrapper.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterWrapper.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterWrapper.java
index 4418527..71370ec 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterWrapper.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterWrapper.java
@@ -54,6 +54,7 @@ final public class FilterWrapper extends Filter {
/**
* @return The filter serialized using pb
*/
+ @Override
public byte[] toByteArray() throws IOException {
FilterProtos.FilterWrapper.Builder builder =
FilterProtos.FilterWrapper.newBuilder();
@@ -181,6 +182,7 @@ final public class FilterWrapper extends Filter {
* @return true if and only if the fields of the filter that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this) return true;
if (!(o instanceof FilterWrapper)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyOnlyFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyOnlyFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyOnlyFilter.java
index dafb485..d18a1f8a 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyOnlyFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyOnlyFilter.java
@@ -42,6 +42,7 @@ public class FirstKeyOnlyFilter extends FilterBase {
public FirstKeyOnlyFilter() {
}
+ @Override
public void reset() {
foundKV = false;
}
@@ -84,6 +85,7 @@ public class FirstKeyOnlyFilter extends FilterBase {
/**
* @return The filter serialized using pb
*/
+ @Override
public byte [] toByteArray() {
FilterProtos.FirstKeyOnlyFilter.Builder builder =
FilterProtos.FirstKeyOnlyFilter.newBuilder();
@@ -113,6 +115,7 @@ public class FirstKeyOnlyFilter extends FilterBase {
* @return true if and only if the fields of the filter that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this) return true;
if (!(o instanceof FirstKeyOnlyFilter)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyValueMatchingQualifiersFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyValueMatchingQualifiersFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyValueMatchingQualifiersFilter.java
index fc40982..2f1c037 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyValueMatchingQualifiersFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyValueMatchingQualifiersFilter.java
@@ -82,6 +82,7 @@ public class FirstKeyValueMatchingQualifiersFilter extends FirstKeyOnlyFilter {
/**
* @return The filter serialized using pb
*/
+ @Override
public byte [] toByteArray() {
FilterProtos.FirstKeyValueMatchingQualifiersFilter.Builder builder =
FilterProtos.FirstKeyValueMatchingQualifiersFilter.newBuilder();
@@ -118,6 +119,7 @@ public class FirstKeyValueMatchingQualifiersFilter extends FirstKeyOnlyFilter {
* @return true if and only if the fields of the filter that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this) return true;
if (!(o instanceof FirstKeyValueMatchingQualifiersFilter)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java
index 88fc17b..d93d234 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java
@@ -258,6 +258,7 @@ public class FuzzyRowFilter extends FilterBase {
/**
* @return The filter serialized using pb
*/
+ @Override
public byte[] toByteArray() {
FilterProtos.FuzzyRowFilter.Builder builder = FilterProtos.FuzzyRowFilter.newBuilder();
for (Pair fuzzyData : fuzzyKeysData) {
@@ -466,45 +467,55 @@ public class FuzzyRowFilter extends FilterBase {
/** Abstracts directional comparisons based on scan direction. */
private enum Order {
ASC {
+ @Override
public boolean lt(int lhs, int rhs) {
return lhs < rhs;
}
+ @Override
public boolean gt(int lhs, int rhs) {
return lhs > rhs;
}
+ @Override
public byte inc(byte val) {
// TODO: what about over/underflow?
return (byte) (val + 1);
}
+ @Override
public boolean isMax(byte val) {
return val == (byte) 0xff;
}
+ @Override
public byte min() {
return 0;
}
},
DESC {
+ @Override
public boolean lt(int lhs, int rhs) {
return lhs > rhs;
}
+ @Override
public boolean gt(int lhs, int rhs) {
return lhs < rhs;
}
+ @Override
public byte inc(byte val) {
// TODO: what about over/underflow?
return (byte) (val - 1);
}
+ @Override
public boolean isMax(byte val) {
return val == 0;
}
+ @Override
public byte min() {
return (byte) 0xFF;
}
@@ -627,6 +638,7 @@ public class FuzzyRowFilter extends FilterBase {
* @return true if and only if the fields of the filter that are serialized are equal to the
* corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this) return true;
if (!(o instanceof FuzzyRowFilter)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/InclusiveStopFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/InclusiveStopFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/InclusiveStopFilter.java
index a16e48b..671e596 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/InclusiveStopFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/InclusiveStopFilter.java
@@ -65,6 +65,7 @@ public class InclusiveStopFilter extends FilterBase {
return v;
}
+ @Override
public boolean filterRowKey(byte[] buffer, int offset, int length) {
if (buffer == null) {
//noinspection RedundantIfStatement
@@ -81,6 +82,7 @@ public class InclusiveStopFilter extends FilterBase {
return done;
}
+ @Override
public boolean filterAllRemaining() {
return done;
}
@@ -95,6 +97,7 @@ public class InclusiveStopFilter extends FilterBase {
/**
* @return The filter serialized using pb
*/
+ @Override
public byte [] toByteArray() {
FilterProtos.InclusiveStopFilter.Builder builder =
FilterProtos.InclusiveStopFilter.newBuilder();
@@ -124,6 +127,7 @@ public class InclusiveStopFilter extends FilterBase {
* @return true if and only if the fields of the filter that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this) return true;
if (!(o instanceof InclusiveStopFilter)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/KeyOnlyFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/KeyOnlyFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/KeyOnlyFilter.java
index cebb26a..3895b2a 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/KeyOnlyFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/KeyOnlyFilter.java
@@ -88,6 +88,7 @@ public class KeyOnlyFilter extends FilterBase {
/**
* @return The filter serialized using pb
*/
+ @Override
public byte [] toByteArray() {
FilterProtos.KeyOnlyFilter.Builder builder =
FilterProtos.KeyOnlyFilter.newBuilder();
@@ -117,6 +118,7 @@ public class KeyOnlyFilter extends FilterBase {
* @return true if and only if the fields of the filter that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this) return true;
if (!(o instanceof KeyOnlyFilter)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultiRowRangeFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultiRowRangeFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultiRowRangeFilter.java
index 7e9503c..fd21dbd 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultiRowRangeFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultiRowRangeFilter.java
@@ -141,6 +141,7 @@ public class MultiRowRangeFilter extends FilterBase {
/**
* @return The filter serialized using pb
*/
+ @Override
public byte[] toByteArray() {
FilterProtos.MultiRowRangeFilter.Builder builder = FilterProtos.MultiRowRangeFilter
.newBuilder();
@@ -193,6 +194,7 @@ public class MultiRowRangeFilter extends FilterBase {
* @return true if and only if the fields of the filter that are serialized are equal to the
* corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this)
return true;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultipleColumnPrefixFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultipleColumnPrefixFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultipleColumnPrefixFilter.java
index d3eb642..96a0b38 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultipleColumnPrefixFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultipleColumnPrefixFilter.java
@@ -115,6 +115,7 @@ public class MultipleColumnPrefixFilter extends FilterBase {
/**
* @return The filter serialized using pb
*/
+ @Override
public byte [] toByteArray() {
FilterProtos.MultipleColumnPrefixFilter.Builder builder =
FilterProtos.MultipleColumnPrefixFilter.newBuilder();
@@ -152,6 +153,7 @@ public class MultipleColumnPrefixFilter extends FilterBase {
* @return true if and only if the fields of the filter that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this) return true;
if (!(o instanceof MultipleColumnPrefixFilter)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/NullComparator.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/NullComparator.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/NullComparator.java
index a9b3c8e..d2f7f45 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/NullComparator.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/NullComparator.java
@@ -62,6 +62,7 @@ public class NullComparator extends ByteArrayComparable {
/**
* @return The comparator serialized using pb
*/
+ @Override
public byte [] toByteArray() {
ComparatorProtos.NullComparator.Builder builder =
ComparatorProtos.NullComparator.newBuilder();
@@ -90,6 +91,7 @@ public class NullComparator extends ByteArrayComparable {
* @return true if and only if the fields of the comparator that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(ByteArrayComparable other) {
if (other == this) return true;
if (!(other instanceof NullComparator)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/PageFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/PageFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/PageFilter.java
index ee94d4c..9692f22 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/PageFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/PageFilter.java
@@ -24,11 +24,11 @@ import org.apache.hadoop.hbase.classification.InterfaceAudience;
import org.apache.hadoop.hbase.classification.InterfaceStability;
import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.exceptions.DeserializationException;
-import org.apache.hadoop.hbase.filter.Filter.ReturnCode;
import org.apache.hadoop.hbase.protobuf.generated.FilterProtos;
import java.io.IOException;
import java.util.ArrayList;
+
/**
* Implementation of Filter interface that limits results to a specific page
* size. It terminates scanning once the number of filter-passed rows is >
@@ -72,15 +72,18 @@ public class PageFilter extends FilterBase {
return v;
}
+ @Override
public boolean filterAllRemaining() {
return this.rowsAccepted >= this.pageSize;
}
+ @Override
public boolean filterRow() {
this.rowsAccepted++;
return this.rowsAccepted > this.pageSize;
}
+ @Override
public boolean hasFilterRow() {
return true;
}
@@ -95,6 +98,7 @@ public class PageFilter extends FilterBase {
/**
* @return The filter serialized using pb
*/
+ @Override
public byte [] toByteArray() {
FilterProtos.PageFilter.Builder builder =
FilterProtos.PageFilter.newBuilder();
@@ -124,6 +128,7 @@ public class PageFilter extends FilterBase {
* @return true if and only if the fields of the filter that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this) return true;
if (!(o instanceof PageFilter)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ParseFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ParseFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ParseFilter.java
index 4ba675b..cdb611c 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ParseFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ParseFilter.java
@@ -30,6 +30,7 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.nio.ByteBuffer;
import java.nio.charset.CharacterCodingException;
+import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
import java.util.EmptyStackException;
@@ -263,7 +264,7 @@ public class ParseFilter {
e.printStackTrace();
}
throw new IllegalArgumentException("Incorrect filter string " +
- new String(filterStringAsByteArray));
+ new String(filterStringAsByteArray, StandardCharsets.UTF_8));
}
/**
@@ -811,9 +812,9 @@ public class ParseFilter {
else if (Bytes.equals(comparatorType, ParseConstants.binaryPrefixType))
return new BinaryPrefixComparator(comparatorValue);
else if (Bytes.equals(comparatorType, ParseConstants.regexStringType))
- return new RegexStringComparator(new String(comparatorValue));
+ return new RegexStringComparator(new String(comparatorValue, StandardCharsets.UTF_8));
else if (Bytes.equals(comparatorType, ParseConstants.substringType))
- return new SubstringComparator(new String(comparatorValue));
+ return new SubstringComparator(new String(comparatorValue, StandardCharsets.UTF_8));
else
throw new IllegalArgumentException("Incorrect comparatorType");
}
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/PrefixFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/PrefixFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/PrefixFilter.java
index 8030ff6..a3fc440 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/PrefixFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/PrefixFilter.java
@@ -50,6 +50,7 @@ public class PrefixFilter extends FilterBase {
return prefix;
}
+ @Override
public boolean filterRowKey(byte[] buffer, int offset, int length) {
if (buffer == null || this.prefix == null)
return true;
@@ -80,14 +81,17 @@ public class PrefixFilter extends FilterBase {
return v;
}
+ @Override
public boolean filterRow() {
return filterRow;
}
+ @Override
public void reset() {
filterRow = true;
}
+ @Override
public boolean filterAllRemaining() {
return passedPrefix;
}
@@ -102,6 +106,7 @@ public class PrefixFilter extends FilterBase {
/**
* @return The filter serialized using pb
*/
+ @Override
public byte [] toByteArray() {
FilterProtos.PrefixFilter.Builder builder =
FilterProtos.PrefixFilter.newBuilder();
@@ -131,6 +136,7 @@ public class PrefixFilter extends FilterBase {
* @return true if and only if the fields of the filter that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this) return true;
if (!(o instanceof PrefixFilter)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/QualifierFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/QualifierFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/QualifierFilter.java
index bf3a5f9..bf503c2 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/QualifierFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/QualifierFilter.java
@@ -81,6 +81,7 @@ public class QualifierFilter extends CompareFilter {
/**
* @return The filter serialized using pb
*/
+ @Override
public byte [] toByteArray() {
FilterProtos.QualifierFilter.Builder builder =
FilterProtos.QualifierFilter.newBuilder();
@@ -120,6 +121,7 @@ public class QualifierFilter extends CompareFilter {
* @return true if and only if the fields of the filter that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this) return true;
if (!(o instanceof QualifierFilter)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RandomRowFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RandomRowFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RandomRowFilter.java
index 243923f..f6d091f 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RandomRowFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RandomRowFilter.java
@@ -90,7 +90,8 @@ public class RandomRowFilter extends FilterBase {
public boolean filterRow() {
return filterOutRow;
}
-
+
+ @Override
public boolean hasFilterRow() {
return true;
}
@@ -118,6 +119,7 @@ public class RandomRowFilter extends FilterBase {
/**
* @return The filter serialized using pb
*/
+ @Override
public byte [] toByteArray() {
FilterProtos.RandomRowFilter.Builder builder =
FilterProtos.RandomRowFilter.newBuilder();
@@ -147,6 +149,7 @@ public class RandomRowFilter extends FilterBase {
* @return true if and only if the fields of the filter that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this) return true;
if (!(o instanceof RandomRowFilter)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RowFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RowFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RowFilter.java
index 23a1e5d..ee32a92 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RowFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RowFilter.java
@@ -97,6 +97,7 @@ public class RowFilter extends CompareFilter {
/**
* @return The filter serialized using pb
*/
+ @Override
public byte [] toByteArray() {
FilterProtos.RowFilter.Builder builder =
FilterProtos.RowFilter.newBuilder();
@@ -136,6 +137,7 @@ public class RowFilter extends CompareFilter {
* @return true if and only if the fields of the filter that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this) return true;
if (!(o instanceof RowFilter)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueExcludeFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueExcludeFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueExcludeFilter.java
index 5c8668b..7dc0387 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueExcludeFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueExcludeFilter.java
@@ -97,6 +97,7 @@ public class SingleColumnValueExcludeFilter extends SingleColumnValueFilter {
}
// We cleaned result row in FilterRow to be consistent with scanning process.
+ @Override
public boolean hasFilterRow() {
return true;
}
@@ -132,6 +133,7 @@ public class SingleColumnValueExcludeFilter extends SingleColumnValueFilter {
/**
* @return The filter serialized using pb
*/
+ @Override
public byte [] toByteArray() {
FilterProtos.SingleColumnValueExcludeFilter.Builder builder =
FilterProtos.SingleColumnValueExcludeFilter.newBuilder();
@@ -175,6 +177,7 @@ public class SingleColumnValueExcludeFilter extends SingleColumnValueFilter {
* @return true if and only if the fields of the filter that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this) return true;
if (!(o instanceof SingleColumnValueExcludeFilter)) return false;
http://git-wip-us.apache.org/repos/asf/hbase/blob/3444059a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueFilter.java
index 7dad1a4..0cf3e2f 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueFilter.java
@@ -216,16 +216,19 @@ public class SingleColumnValueFilter extends FilterBase {
}
}
+ @Override
public boolean filterRow() {
// If column was found, return false if it was matched, true if it was not
// If column not found, return true if we filter if missing, false if not
return this.foundColumn? !this.matchedColumn: this.filterIfMissing;
}
+ @Override
public boolean hasFilterRow() {
return true;
}
+ @Override
public void reset() {
foundColumn = false;
matchedColumn = false;
@@ -325,6 +328,7 @@ public class SingleColumnValueFilter extends FilterBase {
/**
* @return The filter serialized using pb
*/
+ @Override
public byte [] toByteArray() {
return convert().toByteArray();
}
@@ -364,6 +368,7 @@ public class SingleColumnValueFilter extends FilterBase {
* @return true if and only if the fields of the filter that are serialized
* are equal to the corresponding fields in other. Used for testing.
*/
+ @Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this) return true;
if (!(o instanceof SingleColumnValueFilter)) return false;
@@ -382,6 +387,7 @@ public class SingleColumnValueFilter extends FilterBase {
* column in whole scan. If filterIfMissing == false, all families are essential,
* because of possibility of skipping the rows without any data in filtered CF.
*/
+ @Override
public boolean isFamilyEssential(byte[] name) {
return !this.filterIfMissing || Bytes.equals(name, this.columnFamily);
}