diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java b/phoenix-core-client/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java index 9c6bb116952..f538e2ea4d7 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java @@ -47,8 +47,8 @@ import org.apache.hadoop.hbase.io.ImmutableBytesWritable; import org.apache.hadoop.hbase.ipc.CoprocessorRpcUtils.BlockingRpcCallback; import org.apache.hadoop.hbase.ipc.ServerRpcController; -import org.apache.hadoop.hbase.util.ByteStringer; import org.apache.hadoop.hbase.util.Bytes; +import org.apache.phoenix.compat.hbase.ByteStringer; import org.apache.phoenix.compile.QueryPlan; import org.apache.phoenix.compile.ScanRanges; import org.apache.phoenix.coprocessorclient.MetaDataProtocol; diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/coprocessorclient/MetaDataProtocol.java b/phoenix-core-client/src/main/java/org/apache/phoenix/coprocessorclient/MetaDataProtocol.java index 46d7888beb1..947803ec8e0 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/coprocessorclient/MetaDataProtocol.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/coprocessorclient/MetaDataProtocol.java @@ -24,7 +24,7 @@ import java.util.NavigableMap; import java.util.TreeMap; -import org.apache.hadoop.hbase.util.ByteStringer; +import org.apache.phoenix.compat.hbase.ByteStringer; import org.apache.phoenix.coprocessor.generated.MetaDataProtos; import org.apache.phoenix.coprocessor.generated.MetaDataProtos.MetaDataResponse; import org.apache.phoenix.coprocessor.generated.MetaDataProtos.MetaDataService; diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/AllVersionsIndexRebuildFilter.java b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/AllVersionsIndexRebuildFilter.java index f52c9336793..a4663b60b7f 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/AllVersionsIndexRebuildFilter.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/AllVersionsIndexRebuildFilter.java @@ -33,7 +33,7 @@ public AllVersionsIndexRebuildFilter(Filter originalFilter) { super(originalFilter); } - @Override + // No @Override for HBase 3 compatibility public ReturnCode filterKeyValue(Cell v) throws IOException { return filterCell(v); } diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/ColumnProjectionFilter.java b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/ColumnProjectionFilter.java index b58b9b8a9c7..60c3971c284 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/ColumnProjectionFilter.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/ColumnProjectionFilter.java @@ -185,7 +185,7 @@ public String toString() { return ""; } - @Override + // No @Override for HBase 3 compatibility public ReturnCode filterKeyValue(Cell ignored) throws IOException { return filterCell(ignored); } diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/DelegateFilter.java b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/DelegateFilter.java index 1f732419720..fff129297dc 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/DelegateFilter.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/DelegateFilter.java @@ -21,7 +21,6 @@ import java.util.List; import org.apache.hadoop.hbase.Cell; -import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.filter.Filter; import org.apache.hadoop.hbase.filter.FilterBase; @@ -38,11 +37,6 @@ public void reset() throws IOException { delegate.reset(); } - @Override - public boolean filterRowKey(byte[] buffer, int offset, int length) throws IOException { - return delegate.filterRowKey(buffer, offset, length); - } - @Override public boolean filterRowKey(Cell cell) throws IOException { return delegate.filterRowKey(cell); @@ -58,11 +52,6 @@ public boolean filterAllRemaining() throws IOException { return delegate.filterAllRemaining(); } - @Override - public ReturnCode filterKeyValue(Cell v) throws IOException { - return delegate.filterKeyValue(v); - } - @Override public Cell transformCell(Cell v) throws IOException { return delegate.transformCell(v); diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/DistinctPrefixFilter.java b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/DistinctPrefixFilter.java index e3e78d4c230..04626c73947 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/DistinctPrefixFilter.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/DistinctPrefixFilter.java @@ -57,7 +57,7 @@ public void setOffset(int offset) { this.offset = offset; } - @Override + // No @Override for HBase 3 compatibility public ReturnCode filterKeyValue(Cell v) throws IOException { return filterCell(v); } diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/EmptyColumnOnlyFilter.java b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/EmptyColumnOnlyFilter.java index b31ed263564..058a7251be3 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/EmptyColumnOnlyFilter.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/EmptyColumnOnlyFilter.java @@ -56,8 +56,8 @@ public void reset() throws IOException { found = false; first = true; } - @Deprecated - @Override + + // No @Override for HBase 3 compatibility public ReturnCode filterKeyValue(final Cell c) throws IOException { return filterCell(c); } diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/EncodedQualifiersColumnProjectionFilter.java b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/EncodedQualifiersColumnProjectionFilter.java index ef1d161dea5..8c352075996 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/EncodedQualifiersColumnProjectionFilter.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/EncodedQualifiersColumnProjectionFilter.java @@ -148,7 +148,7 @@ public String toString() { return sb.toString(); } - @Override + // No @Override for HBase 3 compatibility public ReturnCode filterKeyValue(Cell ignored) throws IOException { return filterCell(ignored); } diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/MultiEncodedCQKeyValueComparisonFilter.java b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/MultiEncodedCQKeyValueComparisonFilter.java index 75773abd77e..99c5f405dbd 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/MultiEncodedCQKeyValueComparisonFilter.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/MultiEncodedCQKeyValueComparisonFilter.java @@ -215,7 +215,7 @@ private boolean isQualifierForColumnInWhereExpression(int qualifier) { return qualifier >= whereExpressionMinQualifier ? whereExpressionQualifiers.get(qualifier - whereExpressionMinQualifier) : false; } - @Override + // No @Override for HBase 3 compatibility public ReturnCode filterKeyValue(Cell cell) { return filterCell(cell); } diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/MultiKeyValueComparisonFilter.java b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/MultiKeyValueComparisonFilter.java index 6a6cf224194..e46a368f015 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/MultiKeyValueComparisonFilter.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/MultiKeyValueComparisonFilter.java @@ -200,7 +200,7 @@ public Void visit(KeyValueColumnExpression expression) { expression.accept(visitor); } - @Override + // No @Override for Hbase 3 compatibility public ReturnCode filterKeyValue(Cell cell) { return filterCell(cell); } diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/PagingFilter.java b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/PagingFilter.java index eb9eb3b4261..38d892c9477 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/PagingFilter.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/PagingFilter.java @@ -29,9 +29,9 @@ import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.filter.Filter; -import org.apache.hadoop.hbase.filter.FilterBase; import org.apache.hadoop.hbase.util.Writables; import org.apache.hadoop.io.Writable; +import org.apache.phoenix.compat.hbase.CompatPagingFilter; import org.apache.phoenix.util.EnvironmentEdgeManager; /** @@ -71,19 +71,19 @@ * filterRowKey(). In this method, PagingFilter records the last row that is scanned. * */ -public class PagingFilter extends FilterBase implements Writable { +public class PagingFilter extends CompatPagingFilter implements Writable { private long pageSizeMs; private long startTime; // tracks the row we last visited private Cell currentCell; private boolean isStopped; - private Filter delegate = null; public PagingFilter() { + super(null); } public PagingFilter(Filter delegate, long pageSizeMs) { - this.delegate = delegate; + super(delegate); this.pageSizeMs = pageSizeMs; } @@ -208,14 +208,6 @@ public boolean isFamilyEssential(byte[] name) throws IOException { return super.isFamilyEssential(name); } - @Override - public ReturnCode filterKeyValue(Cell v) throws IOException { - if (delegate != null) { - return delegate.filterKeyValue(v); - } - return super.filterKeyValue(v); - } - @Override public Filter.ReturnCode filterCell(Cell c) throws IOException { if (delegate != null) { diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/RowKeyComparisonFilter.java b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/RowKeyComparisonFilter.java index 6982564c11f..de8f4f14067 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/RowKeyComparisonFilter.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/RowKeyComparisonFilter.java @@ -65,7 +65,7 @@ public void reset() { * Evaluate in filterKeyValue instead of filterRowKey, because HBASE-6562 causes filterRowKey * to be called with deleted or partial row keys. */ - @Override + // No @Override for HBase 3 compatibility public ReturnCode filterKeyValue(Cell v) { return filterCell(v); } diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/SingleKeyValueComparisonFilter.java b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/SingleKeyValueComparisonFilter.java index a55ed3784dc..5dd3257ff47 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/SingleKeyValueComparisonFilter.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/SingleKeyValueComparisonFilter.java @@ -71,7 +71,7 @@ private boolean foundColumn() { return inputTuple.size() > 0; } - @Override + // No @Override for HBase 3 compatibility public ReturnCode filterKeyValue(Cell keyValue) { return filterCell(keyValue); } diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java index b0d75c20eb5..344525869ae 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java @@ -166,7 +166,7 @@ public boolean filterAllRemaining() { return isDone; } - @Override + // No @Override for HBase 3 compatibility public ReturnCode filterKeyValue(Cell kv) { return filterCell(kv); } diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/SystemCatalogViewIndexIdFilter.java b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/SystemCatalogViewIndexIdFilter.java index 6aa8c559a01..3408ea8bba1 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/SystemCatalogViewIndexIdFilter.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/SystemCatalogViewIndexIdFilter.java @@ -54,7 +54,7 @@ public SystemCatalogViewIndexIdFilter(int clientVersion) { this.clientVersion = clientVersion; } - @Override + // No @Override for HBase 3 compatibility public ReturnCode filterKeyValue(Cell keyValue) { return filterCell(keyValue); } diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/UnverifiedRowFilter.java b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/UnverifiedRowFilter.java index 400b48d477c..fa8b40232e0 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/filter/UnverifiedRowFilter.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/filter/UnverifiedRowFilter.java @@ -68,7 +68,7 @@ public void reset() throws IOException { delegate.reset(); } - @Override + // No @Override for HBase 3 compatibility public ReturnCode filterKeyValue(Cell v) throws IOException { return filterCell(v); } diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/hbase/index/covered/filter/ApplyAndFilterDeletesFilter.java b/phoenix-core-client/src/main/java/org/apache/phoenix/hbase/index/covered/filter/ApplyAndFilterDeletesFilter.java index 51d82fd83c9..07df2f06d58 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/hbase/index/covered/filter/ApplyAndFilterDeletesFilter.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/hbase/index/covered/filter/ApplyAndFilterDeletesFilter.java @@ -102,7 +102,7 @@ public Cell getNextCellHint(Cell peeked){ return currentHint.getHint(PhoenixKeyValueUtil.maybeCopyCell(peeked)); } - @Override + // No @Override for HBase 3 compatibility public ReturnCode filterKeyValue(Cell next) { return this.filterCell(next); } diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/hbase/index/covered/filter/ColumnTrackingNextLargestTimestampFilter.java b/phoenix-core-client/src/main/java/org/apache/phoenix/hbase/index/covered/filter/ColumnTrackingNextLargestTimestampFilter.java index 21250af1869..e59ebdfbdfb 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/hbase/index/covered/filter/ColumnTrackingNextLargestTimestampFilter.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/hbase/index/covered/filter/ColumnTrackingNextLargestTimestampFilter.java @@ -47,7 +47,7 @@ public ColumnTrackingNextLargestTimestampFilter(long maxTime, ColumnTracker toTr this.column = toTrack; } - @Override + // No @Override for HBase 3 compatibility public ReturnCode filterKeyValue(Cell v) { return this.filterCell(v); } diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/hbase/index/covered/filter/MaxTimestampFilter.java b/phoenix-core-client/src/main/java/org/apache/phoenix/hbase/index/covered/filter/MaxTimestampFilter.java index b9640d7e669..df56c35fa39 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/hbase/index/covered/filter/MaxTimestampFilter.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/hbase/index/covered/filter/MaxTimestampFilter.java @@ -51,7 +51,7 @@ public Cell getNextCellHint(Cell currentKV) { return kv; } - @Override + // No @Override for HBase 3 compatibility public ReturnCode filterKeyValue(Cell v) { return this.filterCell(v); } diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/hbase/index/covered/filter/NewerTimestampFilter.java b/phoenix-core-client/src/main/java/org/apache/phoenix/hbase/index/covered/filter/NewerTimestampFilter.java index 85d16d90154..cb3dc10c58d 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/hbase/index/covered/filter/NewerTimestampFilter.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/hbase/index/covered/filter/NewerTimestampFilter.java @@ -34,7 +34,7 @@ public NewerTimestampFilter(long timestamp) { this.timestamp = timestamp; } - @Override + // No @Override for HBase 3 compatibility public ReturnCode filterKeyValue(Cell ignored) { return this.filterCell(ignored); } diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/index/CDCTableInfo.java b/phoenix-core-client/src/main/java/org/apache/phoenix/index/CDCTableInfo.java index 02fe008ab39..192b981805d 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/index/CDCTableInfo.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/index/CDCTableInfo.java @@ -18,7 +18,7 @@ package org.apache.phoenix.index; -import org.apache.hadoop.hbase.util.ByteStringer; +import org.apache.phoenix.compat.hbase.ByteStringer; import org.apache.phoenix.compile.StatementContext; import org.apache.phoenix.compile.TupleProjectionCompiler; import org.apache.phoenix.coprocessor.generated.CDCInfoProtos; diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/index/IndexMaintainer.java b/phoenix-core-client/src/main/java/org/apache/phoenix/index/IndexMaintainer.java index 24645b29a93..501c52d8f37 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/index/IndexMaintainer.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/index/IndexMaintainer.java @@ -50,11 +50,11 @@ import org.apache.hadoop.hbase.client.Mutation; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; -import org.apache.hadoop.hbase.util.ByteStringer; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Pair; import org.apache.hadoop.io.Writable; import org.apache.hadoop.io.WritableUtils; +import org.apache.phoenix.compat.hbase.ByteStringer; import org.apache.phoenix.compile.ColumnResolver; import org.apache.phoenix.compile.FromCompiler; import org.apache.phoenix.compile.IndexExpressionCompiler; diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/parse/PFunction.java b/phoenix-core-client/src/main/java/org/apache/phoenix/parse/PFunction.java index f914fbae865..4489cff7c07 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/parse/PFunction.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/parse/PFunction.java @@ -22,7 +22,7 @@ import java.util.List; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.util.ByteStringer; +import org.apache.phoenix.compat.hbase.ByteStringer; import org.apache.phoenix.coprocessor.generated.PFunctionProtos; import org.apache.phoenix.coprocessor.generated.PFunctionProtos.PFunctionArg; import org.apache.phoenix.expression.LiteralExpression; diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/protobuf/ProtobufUtil.java b/phoenix-core-client/src/main/java/org/apache/phoenix/protobuf/ProtobufUtil.java index 66528dc5c92..18a30368cbd 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/protobuf/ProtobufUtil.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/protobuf/ProtobufUtil.java @@ -28,8 +28,8 @@ import org.apache.hadoop.hbase.ipc.ServerRpcController; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.MutationType; -import org.apache.hadoop.hbase.util.ByteStringer; import org.apache.hadoop.util.StringUtils; +import org.apache.phoenix.compat.hbase.ByteStringer; import org.apache.phoenix.coprocessor.generated.ChildLinkMetaDataProtos.CreateViewAddChildLinkRequest; import org.apache.phoenix.coprocessor.generated.MetaDataProtos; import org.apache.phoenix.coprocessor.generated.PTableProtos; diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java b/phoenix-core-client/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java index bb6a648c7d5..d84b44c6680 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java @@ -181,12 +181,12 @@ import org.apache.hadoop.hbase.security.AccessDeniedException; import org.apache.hadoop.hbase.security.User; import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; -import org.apache.hadoop.hbase.util.ByteStringer; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Pair; import org.apache.hadoop.hbase.util.VersionInfo; import org.apache.hadoop.hbase.zookeeper.ZKConfig; import org.apache.hadoop.ipc.RemoteException; +import org.apache.phoenix.compat.hbase.ByteStringer; import org.apache.phoenix.compile.MutationPlan; import org.apache.phoenix.coprocessor.generated.ChildLinkMetaDataProtos.ChildLinkMetaDataService; import org.apache.phoenix.coprocessor.generated.MetaDataProtos; diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/schema/PColumnImpl.java b/phoenix-core-client/src/main/java/org/apache/phoenix/schema/PColumnImpl.java index e3123a7502f..32c4c1820f3 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/schema/PColumnImpl.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/schema/PColumnImpl.java @@ -18,7 +18,7 @@ package org.apache.phoenix.schema; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.util.ByteStringer; +import org.apache.phoenix.compat.hbase.ByteStringer; import org.apache.phoenix.coprocessor.generated.PTableProtos; import org.apache.phoenix.query.QueryConstants; import org.apache.phoenix.schema.types.PDataType; diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/schema/PTableImpl.java b/phoenix-core-client/src/main/java/org/apache/phoenix/schema/PTableImpl.java index 8caa0f72e63..4800e74622e 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/schema/PTableImpl.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/schema/PTableImpl.java @@ -59,9 +59,9 @@ import org.apache.hadoop.hbase.client.Mutation; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; -import org.apache.hadoop.hbase.util.ByteStringer; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Pair; +import org.apache.phoenix.compat.hbase.ByteStringer; import org.apache.phoenix.compile.ExpressionCompiler; import org.apache.phoenix.compile.FromCompiler; import org.apache.phoenix.compile.QueryPlan; @@ -141,7 +141,6 @@ import org.apache.hadoop.hbase.client.Mutation; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; -import org.apache.hadoop.hbase.util.ByteStringer; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Pair; import org.apache.phoenix.compile.ExpressionCompiler; diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/schema/transform/TransformMaintainer.java b/phoenix-core-client/src/main/java/org/apache/phoenix/schema/transform/TransformMaintainer.java index 50c9948faaf..ffd82ac6b40 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/schema/transform/TransformMaintainer.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/schema/transform/TransformMaintainer.java @@ -24,9 +24,9 @@ import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; -import org.apache.hadoop.hbase.util.ByteStringer; import org.apache.hadoop.hbase.util.Pair; import org.apache.hadoop.io.WritableUtils; +import org.apache.phoenix.compat.hbase.ByteStringer; import org.apache.phoenix.coprocessor.generated.ServerCachingProtos; import org.apache.phoenix.expression.Expression; import org.apache.phoenix.expression.ExpressionType; diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/util/ValidateLastDDLTimestampUtil.java b/phoenix-core-client/src/main/java/org/apache/phoenix/util/ValidateLastDDLTimestampUtil.java index 95b1d1537a3..d7ae8487c88 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/util/ValidateLastDDLTimestampUtil.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/util/ValidateLastDDLTimestampUtil.java @@ -28,7 +28,7 @@ import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.client.Admin; -import org.apache.hadoop.hbase.util.ByteStringer; +import org.apache.phoenix.compat.hbase.ByteStringer; import org.apache.phoenix.coprocessor.generated.RegionServerEndpointProtos; import org.apache.phoenix.exception.StaleMetadataCacheException; import org.apache.phoenix.jdbc.PhoenixConnection; diff --git a/phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/SuffixFilter.java b/phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/SuffixFilter.java deleted file mode 100644 index 57dffbc9f7a..00000000000 --- a/phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/SuffixFilter.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.phoenix.coprocessor; - -import java.io.IOException; - -import org.apache.hadoop.hbase.Cell; -import org.apache.hadoop.hbase.exceptions.DeserializationException; -import org.apache.hadoop.hbase.filter.FilterBase; -import org.apache.hadoop.hbase.util.Bytes; - -/** - * - * Matches rows that end with a given byte array suffix - * - * - * @since 3.0 - */ -public class SuffixFilter extends FilterBase { - protected byte[] suffix = null; - - public SuffixFilter(final byte[] suffix) { - this.suffix = suffix; - } - - @Override - public byte[] toByteArray() throws IOException { - return suffix; - } - - @Override - public ReturnCode filterCell(Cell ignored) throws IOException { - return ReturnCode.INCLUDE; - } - - @Override - public ReturnCode filterKeyValue(Cell ignored) throws IOException { - return ReturnCode.INCLUDE; - } - - @Override - public boolean filterRowKey(byte[] buffer, int offset, int length) { - if (buffer == null || this.suffix == null) return true; - if (length < suffix.length) return true; - // if they are equal, return false => pass row - // else return true, filter row - // if we are passed the suffix, set flag - int cmp = Bytes.compareTo(buffer, offset + (length - this.suffix.length), - this.suffix.length, this.suffix, 0, this.suffix.length); - return cmp != 0; - } - - - public static SuffixFilter parseFrom(final byte [] pbBytes) throws DeserializationException { - return new SuffixFilter(pbBytes); - } -} \ No newline at end of file diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixRegionServerEndpointIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixRegionServerEndpointIT.java index 89969392901..73cd669da84 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixRegionServerEndpointIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixRegionServerEndpointIT.java @@ -20,7 +20,7 @@ import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ipc.ServerRpcController; import org.apache.hadoop.hbase.regionserver.HRegionServer; -import org.apache.hadoop.hbase.util.ByteStringer; +import org.apache.phoenix.compat.hbase.ByteStringer; import org.apache.hadoop.hbase.util.Bytes; import org.apache.phoenix.coprocessor.PhoenixRegionServerEndpoint; import org.apache.phoenix.coprocessor.generated.RegionServerEndpointProtos; diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/InvalidIndexStateClientSideIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/InvalidIndexStateClientSideIT.java index 1228afbfcb8..1111c563f7f 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/InvalidIndexStateClientSideIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/InvalidIndexStateClientSideIT.java @@ -31,7 +31,7 @@ import org.apache.hadoop.hbase.client.coprocessor.Batch; import org.apache.hadoop.hbase.ipc.CoprocessorRpcUtils.BlockingRpcCallback; import org.apache.hadoop.hbase.ipc.ServerRpcController; -import org.apache.hadoop.hbase.util.ByteStringer; +import org.apache.phoenix.compat.hbase.ByteStringer; import org.apache.phoenix.coprocessor.generated.MetaDataProtos.GetTableRequest; import org.apache.phoenix.coprocessor.generated.MetaDataProtos.MetaDataResponse; import org.apache.phoenix.coprocessor.generated.MetaDataProtos.MetaDataService; diff --git a/phoenix-core/src/test/java/org/apache/phoenix/filter/SkipScanFilterTest.java b/phoenix-core/src/test/java/org/apache/phoenix/filter/SkipScanFilterTest.java index 1e02c9de9d8..025daa060e0 100644 --- a/phoenix-core/src/test/java/org/apache/phoenix/filter/SkipScanFilterTest.java +++ b/phoenix-core/src/test/java/org/apache/phoenix/filter/SkipScanFilterTest.java @@ -646,7 +646,7 @@ public SeekNext(byte[] rowkey, byte[] hint) { KeyValue kv = KeyValueUtil.createFirstOnRow(rowkey); skipper.reset(); assertFalse(skipper.filterAllRemaining()); - assertFalse(skipper.filterRowKey(kv.getBuffer(), kv.getRowOffset(), kv.getRowLength())); + assertFalse(skipper.filterRowKey(kv)); assertEquals(ReturnCode.SEEK_NEXT_USING_HINT, skipper.filterCell(kv)); assertEquals(KeyValueUtil.createFirstOnRow(hint), skipper.getNextCellHint(kv)); @@ -672,7 +672,7 @@ public Include(byte[] rowkey) { KeyValue kv = KeyValueUtil.createFirstOnRow(rowkey); skipper.reset(); assertFalse(skipper.filterAllRemaining()); - assertFalse(skipper.filterRowKey(kv.getBuffer(), kv.getRowOffset(), kv.getRowLength())); + assertFalse(skipper.filterRowKey(kv)); assertEquals(kv.toString(), ReturnCode.INCLUDE_AND_NEXT_COL, skipper.filterCell(kv)); } diff --git a/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/ByteStringer.java b/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/ByteStringer.java new file mode 100644 index 00000000000..299e8c57a40 --- /dev/null +++ b/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/ByteStringer.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.phoenix.compat.hbase; + +import com.google.protobuf.ByteString; + +// This has different signature in the HBase 2 and 3 modules +// This only comes together after the maven-replacer plugin relocates all protobuf code. +public class ByteStringer { + + private ByteStringer() { } + + public static ByteString wrap(final byte[] array) { + return org.apache.hadoop.hbase.util.ByteStringer.wrap(array); + } +} diff --git a/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/CompatDelegateFilter.java b/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/CompatDelegateFilter.java new file mode 100644 index 00000000000..9ee36844296 --- /dev/null +++ b/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/CompatDelegateFilter.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.phoenix.compat.hbase; + +import java.io.IOException; + +import org.apache.hadoop.hbase.Cell; +import org.apache.hadoop.hbase.filter.Filter; +import org.apache.hadoop.hbase.filter.FilterBase; + +public class CompatDelegateFilter extends FilterBase { + protected Filter delegate = null; + + public CompatDelegateFilter(Filter delegate) { + this.delegate = delegate; + } + + @Override + public ReturnCode filterKeyValue(Cell v) throws IOException { + return delegate.filterKeyValue(v); + } + +} diff --git a/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/CompatPagingFilter.java b/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/CompatPagingFilter.java new file mode 100644 index 00000000000..37ec99c757a --- /dev/null +++ b/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/CompatPagingFilter.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.phoenix.compat.hbase; + +import java.io.IOException; + +import org.apache.hadoop.hbase.Cell; +import org.apache.hadoop.hbase.filter.Filter; +import org.apache.hadoop.hbase.filter.FilterBase; + +public abstract class CompatPagingFilter extends FilterBase { + protected Filter delegate = null; + + public CompatPagingFilter(Filter delegate) { + this.delegate = delegate; + } + + @Override + public ReturnCode filterKeyValue(Cell v) throws IOException { + + if (delegate != null) { + return delegate.filterKeyValue(v); + } + return super.filterKeyValue(v); + } +} diff --git a/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/package-info.java b/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/package-info.java new file mode 100644 index 00000000000..bd7e62090cf --- /dev/null +++ b/phoenix-hbase-compat-2.4.1/src/main/java/org/apache/phoenix/compat/hbase/package-info.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * This package contains compatibility classes for bridging differences + * between different versions of HBase. + */ +package org.apache.phoenix.compat.hbase; diff --git a/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/ByteStringer.java b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/ByteStringer.java new file mode 100644 index 00000000000..299e8c57a40 --- /dev/null +++ b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/ByteStringer.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.phoenix.compat.hbase; + +import com.google.protobuf.ByteString; + +// This has different signature in the HBase 2 and 3 modules +// This only comes together after the maven-replacer plugin relocates all protobuf code. +public class ByteStringer { + + private ByteStringer() { } + + public static ByteString wrap(final byte[] array) { + return org.apache.hadoop.hbase.util.ByteStringer.wrap(array); + } +} diff --git a/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatDelegateFilter.java b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatDelegateFilter.java new file mode 100644 index 00000000000..9ee36844296 --- /dev/null +++ b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatDelegateFilter.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.phoenix.compat.hbase; + +import java.io.IOException; + +import org.apache.hadoop.hbase.Cell; +import org.apache.hadoop.hbase.filter.Filter; +import org.apache.hadoop.hbase.filter.FilterBase; + +public class CompatDelegateFilter extends FilterBase { + protected Filter delegate = null; + + public CompatDelegateFilter(Filter delegate) { + this.delegate = delegate; + } + + @Override + public ReturnCode filterKeyValue(Cell v) throws IOException { + return delegate.filterKeyValue(v); + } + +} diff --git a/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPagingFilter.java b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPagingFilter.java new file mode 100644 index 00000000000..37ec99c757a --- /dev/null +++ b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPagingFilter.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.phoenix.compat.hbase; + +import java.io.IOException; + +import org.apache.hadoop.hbase.Cell; +import org.apache.hadoop.hbase.filter.Filter; +import org.apache.hadoop.hbase.filter.FilterBase; + +public abstract class CompatPagingFilter extends FilterBase { + protected Filter delegate = null; + + public CompatPagingFilter(Filter delegate) { + this.delegate = delegate; + } + + @Override + public ReturnCode filterKeyValue(Cell v) throws IOException { + + if (delegate != null) { + return delegate.filterKeyValue(v); + } + return super.filterKeyValue(v); + } +} diff --git a/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/package-info.java b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/package-info.java new file mode 100644 index 00000000000..bd7e62090cf --- /dev/null +++ b/phoenix-hbase-compat-2.5.0/src/main/java/org/apache/phoenix/compat/hbase/package-info.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * This package contains compatibility classes for bridging differences + * between different versions of HBase. + */ +package org.apache.phoenix.compat.hbase; diff --git a/phoenix-hbase-compat-2.5.4/src/main/java/org/apache/phoenix/compat/hbase/ByteStringer.java b/phoenix-hbase-compat-2.5.4/src/main/java/org/apache/phoenix/compat/hbase/ByteStringer.java new file mode 100644 index 00000000000..299e8c57a40 --- /dev/null +++ b/phoenix-hbase-compat-2.5.4/src/main/java/org/apache/phoenix/compat/hbase/ByteStringer.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.phoenix.compat.hbase; + +import com.google.protobuf.ByteString; + +// This has different signature in the HBase 2 and 3 modules +// This only comes together after the maven-replacer plugin relocates all protobuf code. +public class ByteStringer { + + private ByteStringer() { } + + public static ByteString wrap(final byte[] array) { + return org.apache.hadoop.hbase.util.ByteStringer.wrap(array); + } +} diff --git a/phoenix-hbase-compat-2.5.4/src/main/java/org/apache/phoenix/compat/hbase/CompatDelegateFilter.java b/phoenix-hbase-compat-2.5.4/src/main/java/org/apache/phoenix/compat/hbase/CompatDelegateFilter.java new file mode 100644 index 00000000000..bbc1bf3b67f --- /dev/null +++ b/phoenix-hbase-compat-2.5.4/src/main/java/org/apache/phoenix/compat/hbase/CompatDelegateFilter.java @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.phoenix.compat.hbase; + +import java.io.IOException; + +import org.apache.hadoop.hbase.Cell; +import org.apache.hadoop.hbase.filter.Filter; +import org.apache.hadoop.hbase.filter.FilterBase; + +public class CompatDelegateFilter extends FilterBase { + protected Filter delegate = null; + + public CompatDelegateFilter(Filter delegate) { + this.delegate = delegate; + } + + @Override + public ReturnCode filterKeyValue(Cell v) throws IOException { + return delegate.filterKeyValue(v); + } + + @Override + public boolean filterRowKey(byte[] buffer, int offset, int length) throws IOException { + return delegate.filterRowKey(buffer, offset, length); + } +} diff --git a/phoenix-hbase-compat-2.5.4/src/main/java/org/apache/phoenix/compat/hbase/CompatPagingFilter.java b/phoenix-hbase-compat-2.5.4/src/main/java/org/apache/phoenix/compat/hbase/CompatPagingFilter.java new file mode 100644 index 00000000000..37ec99c757a --- /dev/null +++ b/phoenix-hbase-compat-2.5.4/src/main/java/org/apache/phoenix/compat/hbase/CompatPagingFilter.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.phoenix.compat.hbase; + +import java.io.IOException; + +import org.apache.hadoop.hbase.Cell; +import org.apache.hadoop.hbase.filter.Filter; +import org.apache.hadoop.hbase.filter.FilterBase; + +public abstract class CompatPagingFilter extends FilterBase { + protected Filter delegate = null; + + public CompatPagingFilter(Filter delegate) { + this.delegate = delegate; + } + + @Override + public ReturnCode filterKeyValue(Cell v) throws IOException { + + if (delegate != null) { + return delegate.filterKeyValue(v); + } + return super.filterKeyValue(v); + } +} diff --git a/phoenix-hbase-compat-2.5.4/src/main/java/org/apache/phoenix/compat/hbase/package-info.java b/phoenix-hbase-compat-2.5.4/src/main/java/org/apache/phoenix/compat/hbase/package-info.java new file mode 100644 index 00000000000..bd7e62090cf --- /dev/null +++ b/phoenix-hbase-compat-2.5.4/src/main/java/org/apache/phoenix/compat/hbase/package-info.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * This package contains compatibility classes for bridging differences + * between different versions of HBase. + */ +package org.apache.phoenix.compat.hbase; diff --git a/phoenix-hbase-compat-2.6.0/src/main/java/org/apache/phoenix/compat/hbase/ByteStringer.java b/phoenix-hbase-compat-2.6.0/src/main/java/org/apache/phoenix/compat/hbase/ByteStringer.java new file mode 100644 index 00000000000..299e8c57a40 --- /dev/null +++ b/phoenix-hbase-compat-2.6.0/src/main/java/org/apache/phoenix/compat/hbase/ByteStringer.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.phoenix.compat.hbase; + +import com.google.protobuf.ByteString; + +// This has different signature in the HBase 2 and 3 modules +// This only comes together after the maven-replacer plugin relocates all protobuf code. +public class ByteStringer { + + private ByteStringer() { } + + public static ByteString wrap(final byte[] array) { + return org.apache.hadoop.hbase.util.ByteStringer.wrap(array); + } +} diff --git a/phoenix-hbase-compat-2.6.0/src/main/java/org/apache/phoenix/compat/hbase/CompatDelegateFilter.java b/phoenix-hbase-compat-2.6.0/src/main/java/org/apache/phoenix/compat/hbase/CompatDelegateFilter.java new file mode 100644 index 00000000000..9ee36844296 --- /dev/null +++ b/phoenix-hbase-compat-2.6.0/src/main/java/org/apache/phoenix/compat/hbase/CompatDelegateFilter.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.phoenix.compat.hbase; + +import java.io.IOException; + +import org.apache.hadoop.hbase.Cell; +import org.apache.hadoop.hbase.filter.Filter; +import org.apache.hadoop.hbase.filter.FilterBase; + +public class CompatDelegateFilter extends FilterBase { + protected Filter delegate = null; + + public CompatDelegateFilter(Filter delegate) { + this.delegate = delegate; + } + + @Override + public ReturnCode filterKeyValue(Cell v) throws IOException { + return delegate.filterKeyValue(v); + } + +} diff --git a/phoenix-hbase-compat-2.6.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPagingFilter.java b/phoenix-hbase-compat-2.6.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPagingFilter.java new file mode 100644 index 00000000000..37ec99c757a --- /dev/null +++ b/phoenix-hbase-compat-2.6.0/src/main/java/org/apache/phoenix/compat/hbase/CompatPagingFilter.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.phoenix.compat.hbase; + +import java.io.IOException; + +import org.apache.hadoop.hbase.Cell; +import org.apache.hadoop.hbase.filter.Filter; +import org.apache.hadoop.hbase.filter.FilterBase; + +public abstract class CompatPagingFilter extends FilterBase { + protected Filter delegate = null; + + public CompatPagingFilter(Filter delegate) { + this.delegate = delegate; + } + + @Override + public ReturnCode filterKeyValue(Cell v) throws IOException { + + if (delegate != null) { + return delegate.filterKeyValue(v); + } + return super.filterKeyValue(v); + } +} diff --git a/phoenix-hbase-compat-2.6.0/src/main/java/org/apache/phoenix/compat/hbase/package-info.java b/phoenix-hbase-compat-2.6.0/src/main/java/org/apache/phoenix/compat/hbase/package-info.java new file mode 100644 index 00000000000..bd7e62090cf --- /dev/null +++ b/phoenix-hbase-compat-2.6.0/src/main/java/org/apache/phoenix/compat/hbase/package-info.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * This package contains compatibility classes for bridging differences + * between different versions of HBase. + */ +package org.apache.phoenix.compat.hbase;