Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHOENIX-7476 HBase 3 compatibility changes for Filters, ByteStringer,… #2035

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public boolean filterAllRemaining() {
return isDone;
}

@Override
// No @Override for HBase 3 compatibility
public ReturnCode filterKeyValue(Cell kv) {
return filterCell(kv);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading