HBASE-6658 Rename WritableByteArrayComparable to something not mentioning Writable

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1384191 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
gchanan 2012-09-13 02:41:05 +00:00
parent 6d2e7cccf4
commit 476a274729
30 changed files with 107 additions and 107 deletions

View File

@ -33,7 +33,7 @@ import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
import org.apache.hadoop.hbase.filter.WritableByteArrayComparable;
import org.apache.hadoop.hbase.filter.ByteArrayComparable;
import org.apache.hadoop.hbase.regionserver.HRegion;
import org.apache.hadoop.hbase.regionserver.InternalScanner;
import org.apache.hadoop.hbase.regionserver.KeyValueScanner;
@ -213,7 +213,7 @@ public abstract class BaseRegionObserver implements RegionObserver {
@Override
public boolean preCheckAndPut(final ObserverContext<RegionCoprocessorEnvironment> e,
final byte [] row, final byte [] family, final byte [] qualifier,
final CompareOp compareOp, final WritableByteArrayComparable comparator,
final CompareOp compareOp, final ByteArrayComparable comparator,
final Put put, final boolean result) throws IOException {
return result;
}
@ -221,7 +221,7 @@ public abstract class BaseRegionObserver implements RegionObserver {
@Override
public boolean postCheckAndPut(final ObserverContext<RegionCoprocessorEnvironment> e,
final byte [] row, final byte [] family, final byte [] qualifier,
final CompareOp compareOp, final WritableByteArrayComparable comparator,
final CompareOp compareOp, final ByteArrayComparable comparator,
final Put put, final boolean result) throws IOException {
return result;
}
@ -229,7 +229,7 @@ public abstract class BaseRegionObserver implements RegionObserver {
@Override
public boolean preCheckAndDelete(final ObserverContext<RegionCoprocessorEnvironment> e,
final byte [] row, final byte [] family, final byte [] qualifier,
final CompareOp compareOp, final WritableByteArrayComparable comparator,
final CompareOp compareOp, final ByteArrayComparable comparator,
final Delete delete, final boolean result) throws IOException {
return result;
}
@ -237,7 +237,7 @@ public abstract class BaseRegionObserver implements RegionObserver {
@Override
public boolean postCheckAndDelete(final ObserverContext<RegionCoprocessorEnvironment> e,
final byte [] row, final byte [] family, final byte [] qualifier,
final CompareOp compareOp, final WritableByteArrayComparable comparator,
final CompareOp compareOp, final ByteArrayComparable comparator,
final Delete delete, final boolean result) throws IOException {
return result;
}

View File

@ -32,7 +32,7 @@ import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
import org.apache.hadoop.hbase.filter.WritableByteArrayComparable;
import org.apache.hadoop.hbase.filter.ByteArrayComparable;
import org.apache.hadoop.hbase.regionserver.HRegion;
import org.apache.hadoop.hbase.regionserver.InternalScanner;
import org.apache.hadoop.hbase.regionserver.KeyValueScanner;
@ -456,7 +456,7 @@ public interface RegionObserver extends Coprocessor {
*/
boolean preCheckAndPut(final ObserverContext<RegionCoprocessorEnvironment> c,
final byte [] row, final byte [] family, final byte [] qualifier,
final CompareOp compareOp, final WritableByteArrayComparable comparator,
final CompareOp compareOp, final ByteArrayComparable comparator,
final Put put, final boolean result)
throws IOException;
@ -478,7 +478,7 @@ public interface RegionObserver extends Coprocessor {
*/
boolean postCheckAndPut(final ObserverContext<RegionCoprocessorEnvironment> c,
final byte [] row, final byte [] family, final byte [] qualifier,
final CompareOp compareOp, final WritableByteArrayComparable comparator,
final CompareOp compareOp, final ByteArrayComparable comparator,
final Put put, final boolean result)
throws IOException;
@ -502,7 +502,7 @@ public interface RegionObserver extends Coprocessor {
*/
boolean preCheckAndDelete(final ObserverContext<RegionCoprocessorEnvironment> c,
final byte [] row, final byte [] family, final byte [] qualifier,
final CompareOp compareOp, final WritableByteArrayComparable comparator,
final CompareOp compareOp, final ByteArrayComparable comparator,
final Delete delete, final boolean result)
throws IOException;
@ -524,7 +524,7 @@ public interface RegionObserver extends Coprocessor {
*/
boolean postCheckAndDelete(final ObserverContext<RegionCoprocessorEnvironment> c,
final byte [] row, final byte [] family, final byte [] qualifier,
final CompareOp compareOp, final WritableByteArrayComparable comparator,
final CompareOp compareOp, final ByteArrayComparable comparator,
final Delete delete, final boolean result)
throws IOException;

View File

@ -33,7 +33,7 @@ import com.google.protobuf.InvalidProtocolBufferException;
*/
@InterfaceAudience.Public
@InterfaceStability.Stable
public class BinaryComparator extends WritableByteArrayComparable {
public class BinaryComparator extends ByteArrayComparable {
/**
* Constructor
@ -80,7 +80,7 @@ public class BinaryComparator extends WritableByteArrayComparable {
* @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.
*/
boolean areSerializedFieldsEqual(WritableByteArrayComparable other) {
boolean areSerializedFieldsEqual(ByteArrayComparable other) {
if (other == this) return true;
if (!(other instanceof BinaryComparator)) return false;

View File

@ -34,7 +34,7 @@ import com.google.protobuf.InvalidProtocolBufferException;
*/
@InterfaceAudience.Public
@InterfaceStability.Stable
public class BinaryPrefixComparator extends WritableByteArrayComparable {
public class BinaryPrefixComparator extends ByteArrayComparable {
/**
* Constructor
@ -82,7 +82,7 @@ public class BinaryPrefixComparator extends WritableByteArrayComparable {
* @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.
*/
boolean areSerializedFieldsEqual(WritableByteArrayComparable other) {
boolean areSerializedFieldsEqual(ByteArrayComparable other) {
if (other == this) return true;
if (!(other instanceof BinaryPrefixComparator)) return false;

View File

@ -32,7 +32,7 @@ import com.google.protobuf.InvalidProtocolBufferException;
*/
@InterfaceAudience.Public
@InterfaceStability.Stable
public class BitComparator extends WritableByteArrayComparable {
public class BitComparator extends ByteArrayComparable {
/** Bit operators. */
public enum BitwiseOp {
@ -98,7 +98,7 @@ public class BitComparator extends WritableByteArrayComparable {
* @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.
*/
boolean areSerializedFieldsEqual(WritableByteArrayComparable other) {
boolean areSerializedFieldsEqual(ByteArrayComparable other) {
if (other == this) return true;
if (!(other instanceof BitComparator)) return false;

View File

@ -30,7 +30,7 @@ import com.google.protobuf.ByteString;
/** Base class for byte array comparators */
@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract class WritableByteArrayComparable implements Comparable<byte[]> {
public abstract class ByteArrayComparable implements Comparable<byte[]> {
byte[] value;
@ -38,7 +38,7 @@ public abstract class WritableByteArrayComparable implements Comparable<byte[]>
* Constructor.
* @param value the value to compare against
*/
public WritableByteArrayComparable(byte [] value) {
public ByteArrayComparable(byte [] value) {
this.value = value;
}
@ -59,15 +59,15 @@ public abstract class WritableByteArrayComparable implements Comparable<byte[]>
}
/**
* @param pbBytes A pb serialized {@link WritableByteArrayComparable} instance
* @return An instance of {@link WritableByteArrayComparable} made from <code>bytes</code>
* @param pbBytes A pb serialized {@link ByteArrayComparable} instance
* @return An instance of {@link ByteArrayComparable} made from <code>bytes</code>
* @throws DeserializationException
* @see {@link #toByteArray()}
*/
public static WritableByteArrayComparable parseFrom(final byte [] pbBytes)
public static ByteArrayComparable parseFrom(final byte [] pbBytes)
throws DeserializationException {
throw new DeserializationException(
"parseFrom called on base WritableByteArrayComparable, but should be called on derived type");
"parseFrom called on base ByteArrayComparable, but should be called on derived type");
}
/**
@ -75,9 +75,9 @@ public abstract class WritableByteArrayComparable implements Comparable<byte[]>
* @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.
*/
boolean areSerializedFieldsEqual(WritableByteArrayComparable o) {
boolean areSerializedFieldsEqual(ByteArrayComparable o) {
if (o == this) return true;
if (!(o instanceof WritableByteArrayComparable)) return false;
if (!(o instanceof ByteArrayComparable)) return false;
return Bytes.equals(this.getValue(), o.getValue());
}

View File

@ -68,7 +68,7 @@ public abstract class CompareFilter extends FilterBase {
}
protected CompareOp compareOp;
protected WritableByteArrayComparable comparator;
protected ByteArrayComparable comparator;
/**
* Constructor.
@ -76,7 +76,7 @@ public abstract class CompareFilter extends FilterBase {
* @param comparator the comparator for row matching
*/
public CompareFilter(final CompareOp compareOp,
final WritableByteArrayComparable comparator) {
final ByteArrayComparable comparator) {
this.compareOp = compareOp;
this.comparator = comparator;
}
@ -91,12 +91,12 @@ public abstract class CompareFilter extends FilterBase {
/**
* @return the comparator
*/
public WritableByteArrayComparable getComparator() {
public ByteArrayComparable getComparator() {
return comparator;
}
protected boolean doCompare(final CompareOp compareOp,
final WritableByteArrayComparable comparator, final byte [] data,
final ByteArrayComparable comparator, final byte [] data,
final int offset, final int length) {
if (compareOp == CompareOp.NO_OP) {
return true;
@ -125,7 +125,7 @@ public abstract class CompareFilter extends FilterBase {
Preconditions.checkArgument(filterArguments.size() == 2,
"Expected 2 but got: %s", filterArguments.size());
CompareOp compareOp = ParseFilter.createCompareOp(filterArguments.get(0));
WritableByteArrayComparable comparator = ParseFilter.createComparator(
ByteArrayComparable comparator = ParseFilter.createComparator(
ParseFilter.removeQuotesFromByteArray(filterArguments.get(1)));
if (comparator instanceof RegexStringComparator ||

View File

@ -68,7 +68,7 @@ public class DependentColumnFilter extends CompareFilter {
*/
public DependentColumnFilter(final byte [] family, final byte[] qualifier,
final boolean dropDependentColumn, final CompareOp valueCompareOp,
final WritableByteArrayComparable valueComparator) {
final ByteArrayComparable valueComparator) {
// set up the comparator
super(valueCompareOp, valueComparator);
this.columnFamily = family;
@ -204,7 +204,7 @@ public class DependentColumnFilter extends CompareFilter {
byte [] qualifier = ParseFilter.removeQuotesFromByteArray(filterArguments.get(1));
boolean dropDependentColumn = ParseFilter.convertByteArrayToBoolean(filterArguments.get(2));
CompareOp compareOp = ParseFilter.createCompareOp(filterArguments.get(3));
WritableByteArrayComparable comparator = ParseFilter.createComparator(
ByteArrayComparable comparator = ParseFilter.createComparator(
ParseFilter.removeQuotesFromByteArray(filterArguments.get(4)));
return new DependentColumnFilter(family, qualifier, dropDependentColumn,
compareOp, comparator);
@ -246,7 +246,7 @@ public class DependentColumnFilter extends CompareFilter {
}
final CompareOp valueCompareOp =
CompareOp.valueOf(proto.getCompareFilter().getCompareOp().name());
WritableByteArrayComparable valueComparator = null;
ByteArrayComparable valueComparator = null;
try {
if (proto.getCompareFilter().hasComparator()) {
valueComparator = ProtobufUtil.toComparator(proto.getCompareFilter().getComparator());

View File

@ -55,7 +55,7 @@ public class FamilyFilter extends CompareFilter {
* @param familyComparator the comparator for column family matching
*/
public FamilyFilter(final CompareOp familyCompareOp,
final WritableByteArrayComparable familyComparator) {
final ByteArrayComparable familyComparator) {
super(familyCompareOp, familyComparator);
}
@ -74,7 +74,7 @@ public class FamilyFilter extends CompareFilter {
public static Filter createFilterFromArguments(ArrayList<byte []> filterArguments) {
ArrayList arguments = CompareFilter.extractArguments(filterArguments);
CompareOp compareOp = (CompareOp)arguments.get(0);
WritableByteArrayComparable comparator = (WritableByteArrayComparable)arguments.get(1);
ByteArrayComparable comparator = (ByteArrayComparable)arguments.get(1);
return new FamilyFilter(compareOp, comparator);
}
@ -104,7 +104,7 @@ public class FamilyFilter extends CompareFilter {
}
final CompareOp valueCompareOp =
CompareOp.valueOf(proto.getCompareFilter().getCompareOp().name());
WritableByteArrayComparable valueComparator = null;
ByteArrayComparable valueComparator = null;
try {
if (proto.getCompareFilter().hasComparator()) {
valueComparator = ProtobufUtil.toComparator(proto.getCompareFilter().getComparator());

View File

@ -41,7 +41,7 @@ import java.util.List;
* </li>
* </ul>
*
* Filter instances are created one per region/scan. This interface replaces
* Filter instances are created one per region/scan. This abstract class replaces
* the old RowFilterInterface.
*
* When implementing your own filters, consider inheriting {@link FilterBase} to help

View File

@ -32,7 +32,7 @@ import com.google.protobuf.InvalidProtocolBufferException;
*/
@InterfaceAudience.Public
@InterfaceStability.Stable
public class NullComparator extends WritableByteArrayComparable {
public class NullComparator extends ByteArrayComparable {
public NullComparator() {
super(new byte[0]);
@ -79,7 +79,7 @@ public class NullComparator extends WritableByteArrayComparable {
* @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.
*/
boolean areSerializedFieldsEqual(WritableByteArrayComparable other) {
boolean areSerializedFieldsEqual(ByteArrayComparable other) {
if (other == this) return true;
if (!(other instanceof NullComparator)) return false;

View File

@ -785,7 +785,7 @@ public class ParseFilter {
* @param comparator the comparator in the form comparatorType:comparatorValue
* @return the parsed comparator
*/
public static WritableByteArrayComparable createComparator (byte [] comparator) {
public static ByteArrayComparable createComparator (byte [] comparator) {
if (comparator == null)
throw new IllegalArgumentException("Incorrect Comparator");
byte [][] parsedComparator = ParseFilter.parseComparator(comparator);

View File

@ -55,7 +55,7 @@ public class QualifierFilter extends CompareFilter {
* @param qualifierComparator the comparator for column qualifier matching
*/
public QualifierFilter(final CompareOp op,
final WritableByteArrayComparable qualifierComparator) {
final ByteArrayComparable qualifierComparator) {
super(op, qualifierComparator);
}
@ -74,7 +74,7 @@ public class QualifierFilter extends CompareFilter {
public static Filter createFilterFromArguments(ArrayList<byte []> filterArguments) {
ArrayList arguments = CompareFilter.extractArguments(filterArguments);
CompareOp compareOp = (CompareOp)arguments.get(0);
WritableByteArrayComparable comparator = (WritableByteArrayComparable)arguments.get(1);
ByteArrayComparable comparator = (ByteArrayComparable)arguments.get(1);
return new QualifierFilter(compareOp, comparator);
}
@ -104,7 +104,7 @@ public class QualifierFilter extends CompareFilter {
}
final CompareOp valueCompareOp =
CompareOp.valueOf(proto.getCompareFilter().getCompareOp().name());
WritableByteArrayComparable valueComparator = null;
ByteArrayComparable valueComparator = null;
try {
if (proto.getCompareFilter().hasComparator()) {
valueComparator = ProtobufUtil.toComparator(proto.getCompareFilter().getComparator());

View File

@ -66,7 +66,7 @@ import java.util.regex.Pattern;
*/
@InterfaceAudience.Public
@InterfaceStability.Stable
public class RegexStringComparator extends WritableByteArrayComparable {
public class RegexStringComparator extends ByteArrayComparable {
private static final Log LOG = LogFactory.getLog(RegexStringComparator.class);
@ -161,7 +161,7 @@ public class RegexStringComparator extends WritableByteArrayComparable {
* @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.
*/
boolean areSerializedFieldsEqual(WritableByteArrayComparable other) {
boolean areSerializedFieldsEqual(ByteArrayComparable other) {
if (other == this) return true;
if (!(other instanceof RegexStringComparator)) return false;

View File

@ -56,7 +56,7 @@ public class RowFilter extends CompareFilter {
* @param rowComparator the comparator for row matching
*/
public RowFilter(final CompareOp rowCompareOp,
final WritableByteArrayComparable rowComparator) {
final ByteArrayComparable rowComparator) {
super(rowCompareOp, rowComparator);
}
@ -89,7 +89,7 @@ public class RowFilter extends CompareFilter {
public static Filter createFilterFromArguments(ArrayList<byte []> filterArguments) {
ArrayList arguments = CompareFilter.extractArguments(filterArguments);
CompareOp compareOp = (CompareOp)arguments.get(0);
WritableByteArrayComparable comparator = (WritableByteArrayComparable)arguments.get(1);
ByteArrayComparable comparator = (ByteArrayComparable)arguments.get(1);
return new RowFilter(compareOp, comparator);
}
@ -119,7 +119,7 @@ public class RowFilter extends CompareFilter {
}
final CompareOp valueCompareOp =
CompareOp.valueOf(proto.getCompareFilter().getCompareOp().name());
WritableByteArrayComparable valueComparator = null;
ByteArrayComparable valueComparator = null;
try {
if (proto.getCompareFilter().hasComparator()) {
valueComparator = ProtobufUtil.toComparator(proto.getCompareFilter().getComparator());

View File

@ -74,7 +74,7 @@ public class SingleColumnValueExcludeFilter extends SingleColumnValueFilter {
* @param comparator Comparator to use.
*/
public SingleColumnValueExcludeFilter(byte[] family, byte[] qualifier,
CompareOp compareOp, WritableByteArrayComparable comparator) {
CompareOp compareOp, ByteArrayComparable comparator) {
super(family, qualifier, compareOp, comparator);
}
@ -90,7 +90,7 @@ public class SingleColumnValueExcludeFilter extends SingleColumnValueFilter {
* @param latestVersionOnly
*/
protected SingleColumnValueExcludeFilter(final byte[] family, final byte [] qualifier,
final CompareOp compareOp, WritableByteArrayComparable comparator, final boolean foundColumn,
final CompareOp compareOp, ByteArrayComparable comparator, final boolean foundColumn,
final boolean matchedColumn, final boolean filterIfMissing, final boolean latestVersionOnly) {
super(family,qualifier,compareOp,comparator,foundColumn,
matchedColumn,filterIfMissing,latestVersionOnly);
@ -150,7 +150,7 @@ public class SingleColumnValueExcludeFilter extends SingleColumnValueFilter {
FilterProtos.SingleColumnValueFilter parentProto = proto.getSingleColumnValueFilter();
final CompareOp compareOp =
CompareOp.valueOf(parentProto.getCompareOp().name());
final WritableByteArrayComparable comparator;
final ByteArrayComparable comparator;
try {
comparator = ProtobufUtil.toComparator(parentProto.getComparator());
} catch (IOException ioe) {

View File

@ -43,7 +43,7 @@ import com.google.protobuf.InvalidProtocolBufferException;
/**
* This filter is used to filter cells based on value. It takes a {@link CompareFilter.CompareOp}
* operator (equal, greater, not equal, etc), and either a byte [] value or
* a WritableByteArrayComparable.
* a ByteArrayComparable.
* <p>
* If we have a byte [] value then we just do a lexicographic compare. For
* example, if passed value is 'b' and cell has 'a' and the compare operator
@ -75,7 +75,7 @@ public class SingleColumnValueFilter extends FilterBase {
protected byte [] columnFamily;
protected byte [] columnQualifier;
private CompareOp compareOp;
private WritableByteArrayComparable comparator;
private ByteArrayComparable comparator;
private boolean foundColumn = false;
private boolean matchedColumn = false;
private boolean filterIfMissing = false;
@ -115,7 +115,7 @@ public class SingleColumnValueFilter extends FilterBase {
* @param comparator Comparator to use.
*/
public SingleColumnValueFilter(final byte [] family, final byte [] qualifier,
final CompareOp compareOp, final WritableByteArrayComparable comparator) {
final CompareOp compareOp, final ByteArrayComparable comparator) {
this.columnFamily = family;
this.columnQualifier = qualifier;
this.compareOp = compareOp;
@ -134,7 +134,7 @@ public class SingleColumnValueFilter extends FilterBase {
* @param latestVersionOnly
*/
protected SingleColumnValueFilter(final byte[] family, final byte [] qualifier,
final CompareOp compareOp, WritableByteArrayComparable comparator, final boolean foundColumn,
final CompareOp compareOp, ByteArrayComparable comparator, final boolean foundColumn,
final boolean matchedColumn, final boolean filterIfMissing, final boolean latestVersionOnly) {
this(family,qualifier,compareOp,comparator);
this.foundColumn = foundColumn;
@ -153,7 +153,7 @@ public class SingleColumnValueFilter extends FilterBase {
/**
* @return the comparator
*/
public WritableByteArrayComparable getComparator() {
public ByteArrayComparable getComparator() {
return comparator;
}
@ -277,7 +277,7 @@ public class SingleColumnValueFilter extends FilterBase {
byte [] family = ParseFilter.removeQuotesFromByteArray(filterArguments.get(0));
byte [] qualifier = ParseFilter.removeQuotesFromByteArray(filterArguments.get(1));
CompareOp compareOp = ParseFilter.createCompareOp(filterArguments.get(2));
WritableByteArrayComparable comparator = ParseFilter.createComparator(
ByteArrayComparable comparator = ParseFilter.createComparator(
ParseFilter.removeQuotesFromByteArray(filterArguments.get(3)));
if (comparator instanceof RegexStringComparator ||
@ -345,7 +345,7 @@ public class SingleColumnValueFilter extends FilterBase {
final CompareOp compareOp =
CompareOp.valueOf(proto.getCompareOp().name());
final WritableByteArrayComparable comparator;
final ByteArrayComparable comparator;
try {
comparator = ProtobufUtil.toComparator(proto.getComparator());
} catch (IOException ioe) {

View File

@ -44,7 +44,7 @@ import com.google.protobuf.InvalidProtocolBufferException;
*/
@InterfaceAudience.Public
@InterfaceStability.Stable
public class SubstringComparator extends WritableByteArrayComparable {
public class SubstringComparator extends ByteArrayComparable {
private String substr;
@ -100,7 +100,7 @@ public class SubstringComparator extends WritableByteArrayComparable {
* @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.
*/
boolean areSerializedFieldsEqual(WritableByteArrayComparable other) {
boolean areSerializedFieldsEqual(ByteArrayComparable other) {
if (other == this) return true;
if (!(other instanceof SubstringComparator)) return false;

View File

@ -54,7 +54,7 @@ public class ValueFilter extends CompareFilter {
* @param valueComparator the comparator for value matching
*/
public ValueFilter(final CompareOp valueCompareOp,
final WritableByteArrayComparable valueComparator) {
final ByteArrayComparable valueComparator) {
super(valueCompareOp, valueComparator);
}
@ -70,7 +70,7 @@ public class ValueFilter extends CompareFilter {
public static Filter createFilterFromArguments(ArrayList<byte []> filterArguments) {
ArrayList arguments = CompareFilter.extractArguments(filterArguments);
CompareOp compareOp = (CompareOp)arguments.get(0);
WritableByteArrayComparable comparator = (WritableByteArrayComparable)arguments.get(1);
ByteArrayComparable comparator = (ByteArrayComparable)arguments.get(1);
return new ValueFilter(compareOp, comparator);
}
@ -100,7 +100,7 @@ public class ValueFilter extends CompareFilter {
}
final CompareOp valueCompareOp =
CompareOp.valueOf(proto.getCompareFilter().getCompareOp().name());
WritableByteArrayComparable valueComparator = null;
ByteArrayComparable valueComparator = null;
try {
if (proto.getCompareFilter().hasComparator()) {
valueComparator = ProtobufUtil.toComparator(proto.getCompareFilter().getComparator());

View File

@ -84,7 +84,7 @@ import org.apache.hadoop.hbase.filter.SingleColumnValueFilter;
import org.apache.hadoop.hbase.filter.SkipFilter;
import org.apache.hadoop.hbase.filter.ValueFilter;
import org.apache.hadoop.hbase.filter.WhileMatchFilter;
import org.apache.hadoop.hbase.filter.WritableByteArrayComparable;
import org.apache.hadoop.hbase.filter.ByteArrayComparable;
import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
import org.apache.hadoop.hbase.protobuf.generated.ClientProtos;
import org.apache.hadoop.hbase.regionserver.HRegion;
@ -218,7 +218,7 @@ public class HbaseObjectWritable implements Writable, WritableWithSize, Configur
addToMap(ValueFilter.class, code++);
addToMap(QualifierFilter.class, code++);
addToMap(SkipFilter.class, code++);
addToMap(WritableByteArrayComparable.class, code++);
addToMap(ByteArrayComparable.class, code++);
addToMap(FirstKeyOnlyFilter.class, code++);
addToMap(DependentColumnFilter.class, code++);

View File

@ -66,7 +66,7 @@ import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.client.coprocessor.Exec;
import org.apache.hadoop.hbase.client.coprocessor.ExecResult;
import org.apache.hadoop.hbase.filter.Filter;
import org.apache.hadoop.hbase.filter.WritableByteArrayComparable;
import org.apache.hadoop.hbase.filter.ByteArrayComparable;
import org.apache.hadoop.hbase.io.HbaseObjectWritable;
import org.apache.hadoop.hbase.io.TimeRange;
import org.apache.hadoop.hbase.ipc.CoprocessorProtocol;
@ -936,12 +936,12 @@ public final class ProtobufUtil {
}
/**
* Convert a WritableByteArrayComparable to a protocol buffer Comparator
* Convert a ByteArrayComparable to a protocol buffer Comparator
*
* @param comparator the WritableByteArrayComparable to convert
* @param comparator the ByteArrayComparable to convert
* @return the converted protocol buffer Comparator
*/
public static ComparatorProtos.Comparator toComparator(WritableByteArrayComparable comparator) {
public static ComparatorProtos.Comparator toComparator(ByteArrayComparable comparator) {
ComparatorProtos.Comparator.Builder builder = ComparatorProtos.Comparator.newBuilder();
builder.setName(comparator.getClass().getName());
builder.setSerializedComparator(ByteString.copyFrom(comparator.toByteArray()));
@ -949,24 +949,24 @@ public final class ProtobufUtil {
}
/**
* Convert a protocol buffer Comparator to a WritableByteArrayComparable
* Convert a protocol buffer Comparator to a ByteArrayComparable
*
* @param proto the protocol buffer Comparator to convert
* @return the converted WritableByteArrayComparable
* @return the converted ByteArrayComparable
*/
public static WritableByteArrayComparable toComparator(ComparatorProtos.Comparator proto)
public static ByteArrayComparable toComparator(ComparatorProtos.Comparator proto)
throws IOException {
String type = proto.getName();
String funcName = "parseFrom";
byte [] value = proto.getSerializedComparator().toByteArray();
try {
Class<? extends WritableByteArrayComparable> c =
(Class<? extends WritableByteArrayComparable>)(Class.forName(type));
Class<? extends ByteArrayComparable> c =
(Class<? extends ByteArrayComparable>)(Class.forName(type));
Method parseFrom = c.getMethod(funcName, byte[].class);
if (parseFrom == null) {
throw new IOException("Unable to locate function: " + funcName + " in type: " + type);
}
return (WritableByteArrayComparable)parseFrom.invoke(null, value);
return (ByteArrayComparable)parseFrom.invoke(null, value);
} catch (Exception e) {
throw new IOException(e);
}

View File

@ -42,7 +42,7 @@ import org.apache.hadoop.hbase.client.Row;
import org.apache.hadoop.hbase.client.RowMutations;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.client.coprocessor.Exec;
import org.apache.hadoop.hbase.filter.WritableByteArrayComparable;
import org.apache.hadoop.hbase.filter.ByteArrayComparable;
import org.apache.hadoop.hbase.protobuf.generated.AdminProtos;
import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.CloseRegionRequest;
import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.CompactRegionRequest;
@ -231,7 +231,7 @@ public final class RequestConverter {
*/
public static MutateRequest buildMutateRequest(
final byte[] regionName, final byte[] row, final byte[] family,
final byte [] qualifier, final WritableByteArrayComparable comparator,
final byte [] qualifier, final ByteArrayComparable comparator,
final CompareType compareType, final Put put) throws IOException {
MutateRequest.Builder builder = MutateRequest.newBuilder();
RegionSpecifier region = buildRegionSpecifier(
@ -259,7 +259,7 @@ public final class RequestConverter {
*/
public static MutateRequest buildMutateRequest(
final byte[] regionName, final byte[] row, final byte[] family,
final byte [] qualifier, final WritableByteArrayComparable comparator,
final byte [] qualifier, final ByteArrayComparable comparator,
final CompareType compareType, final Delete delete) throws IOException {
MutateRequest.Builder builder = MutateRequest.newBuilder();
RegionSpecifier region = buildRegionSpecifier(
@ -866,7 +866,7 @@ public final class RequestConverter {
*/
private static Condition buildCondition(final byte[] row,
final byte[] family, final byte [] qualifier,
final WritableByteArrayComparable comparator,
final ByteArrayComparable comparator,
final CompareType compareType) throws IOException {
Condition.Builder builder = Condition.newBuilder();
builder.setRow(ByteString.copyFrom(row));

View File

@ -13967,7 +13967,7 @@ public final class ClientProtos {
getFamilyPathOrBuilderList();
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.BulkLoadHFileRequest.FamilyPathOrBuilder getFamilyPathOrBuilder(
int index);
// optional bool assignSeqNum = 3;
boolean hasAssignSeqNum();
boolean getAssignSeqNum();
@ -14537,7 +14537,7 @@ public final class ClientProtos {
public boolean getAssignSeqNum() {
return assignSeqNum_;
}
private void initFields() {
region_ = org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.RegionSpecifier.getDefaultInstance();
familyPath_ = java.util.Collections.emptyList();
@ -15261,7 +15261,7 @@ public final class ClientProtos {
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:BulkLoadHFileRequest)
}

View File

@ -103,7 +103,7 @@ import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
import org.apache.hadoop.hbase.filter.Filter;
import org.apache.hadoop.hbase.filter.FilterWrapper;
import org.apache.hadoop.hbase.filter.IncompatibleFilterException;
import org.apache.hadoop.hbase.filter.WritableByteArrayComparable;
import org.apache.hadoop.hbase.filter.ByteArrayComparable;
import org.apache.hadoop.hbase.io.HeapSize;
import org.apache.hadoop.hbase.io.TimeRange;
import org.apache.hadoop.hbase.io.hfile.BlockCache;
@ -2405,7 +2405,7 @@ public class HRegion implements HeapSize { // , Writable{
* @return true if the new put was execute, false otherwise
*/
public boolean checkAndMutate(byte [] row, byte [] family, byte [] qualifier,
CompareOp compareOp, WritableByteArrayComparable comparator, Writable w,
CompareOp compareOp, ByteArrayComparable comparator, Writable w,
Integer lockId, boolean writeToWAL)
throws IOException{
checkReadOnly();

View File

@ -102,7 +102,7 @@ import org.apache.hadoop.hbase.coprocessor.CoprocessorHost;
import org.apache.hadoop.hbase.executor.ExecutorService;
import org.apache.hadoop.hbase.executor.ExecutorService.ExecutorType;
import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
import org.apache.hadoop.hbase.filter.WritableByteArrayComparable;
import org.apache.hadoop.hbase.filter.ByteArrayComparable;
import org.apache.hadoop.hbase.fs.HFileSystem;
import org.apache.hadoop.hbase.io.hfile.BlockCache;
import org.apache.hadoop.hbase.io.hfile.CacheConfig;
@ -2930,7 +2930,7 @@ public class HRegionServer implements ClientProtocol,
byte[] family = condition.getFamily().toByteArray();
byte[] qualifier = condition.getQualifier().toByteArray();
CompareOp compareOp = CompareOp.valueOf(condition.getCompareType().name());
WritableByteArrayComparable comparator =
ByteArrayComparable comparator =
ProtobufUtil.toComparator(condition.getComparator());
if (region.getCoprocessorHost() != null) {
processed = region.getCoprocessorHost().preCheckAndPut(
@ -2959,7 +2959,7 @@ public class HRegionServer implements ClientProtocol,
byte[] family = condition.getFamily().toByteArray();
byte[] qualifier = condition.getQualifier().toByteArray();
CompareOp compareOp = CompareOp.valueOf(condition.getCompareType().name());
WritableByteArrayComparable comparator =
ByteArrayComparable comparator =
ProtobufUtil.toComparator(condition.getComparator());
if (region.getCoprocessorHost() != null) {
processed = region.getCoprocessorHost().preCheckAndDelete(

View File

@ -53,7 +53,7 @@ import org.apache.hadoop.hbase.coprocessor.ObserverContext;
import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
import org.apache.hadoop.hbase.coprocessor.RegionObserver;
import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
import org.apache.hadoop.hbase.filter.WritableByteArrayComparable;
import org.apache.hadoop.hbase.filter.ByteArrayComparable;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.ipc.CoprocessorProtocol;
import org.apache.hadoop.hbase.regionserver.wal.HLogKey;
@ -981,7 +981,7 @@ public class RegionCoprocessorHost
*/
public Boolean preCheckAndPut(final byte [] row, final byte [] family,
final byte [] qualifier, final CompareOp compareOp,
final WritableByteArrayComparable comparator, Put put)
final ByteArrayComparable comparator, Put put)
throws IOException {
boolean bypass = false;
boolean result = false;
@ -1017,7 +1017,7 @@ public class RegionCoprocessorHost
*/
public boolean postCheckAndPut(final byte [] row, final byte [] family,
final byte [] qualifier, final CompareOp compareOp,
final WritableByteArrayComparable comparator, final Put put,
final ByteArrayComparable comparator, final Put put,
boolean result)
throws IOException {
ObserverContext<RegionCoprocessorEnvironment> ctx = null;
@ -1051,7 +1051,7 @@ public class RegionCoprocessorHost
*/
public Boolean preCheckAndDelete(final byte [] row, final byte [] family,
final byte [] qualifier, final CompareOp compareOp,
final WritableByteArrayComparable comparator, Delete delete)
final ByteArrayComparable comparator, Delete delete)
throws IOException {
boolean bypass = false;
boolean result = false;
@ -1085,7 +1085,7 @@ public class RegionCoprocessorHost
*/
public boolean postCheckAndDelete(final byte [] row, final byte [] family,
final byte [] qualifier, final CompareOp compareOp,
final WritableByteArrayComparable comparator, final Delete delete,
final ByteArrayComparable comparator, final Delete delete,
boolean result)
throws IOException {
ObserverContext<RegionCoprocessorEnvironment> ctx = null;

View File

@ -86,7 +86,7 @@ public class ScannerModel implements ProtobufMessageHandler, Serializable {
static class FilterModel {
@XmlRootElement
static class WritableByteArrayComparableModel {
static class ByteArrayComparableModel {
@XmlAttribute public String type;
@XmlAttribute public String value;
@XmlAttribute public String op;
@ -100,10 +100,10 @@ public class ScannerModel implements ProtobufMessageHandler, Serializable {
SubstringComparator
}
public WritableByteArrayComparableModel() { }
public ByteArrayComparableModel() { }
public WritableByteArrayComparableModel(
WritableByteArrayComparable comparator) {
public ByteArrayComparableModel(
ByteArrayComparable comparator) {
String typeName = comparator.getClass().getSimpleName();
ComparatorType type = ComparatorType.valueOf(typeName);
this.type = typeName;
@ -127,8 +127,8 @@ public class ScannerModel implements ProtobufMessageHandler, Serializable {
}
}
public WritableByteArrayComparable build() {
WritableByteArrayComparable comparator;
public ByteArrayComparable build() {
ByteArrayComparable comparator;
switch (ComparatorType.valueOf(type)) {
case BinaryComparator:
comparator = new BinaryComparator(Base64.decode(value));
@ -161,7 +161,7 @@ public class ScannerModel implements ProtobufMessageHandler, Serializable {
// These are null by default and will only be serialized if set (non null).
@XmlAttribute public String type;
@XmlAttribute public String op;
@XmlElement WritableByteArrayComparableModel comparator;
@XmlElement ByteArrayComparableModel comparator;
@XmlAttribute public String value;
@XmlElement public List<FilterModel> filters;
@XmlAttribute public Integer limit;
@ -235,7 +235,7 @@ public class ScannerModel implements ProtobufMessageHandler, Serializable {
this.qualifier = Base64.encodeBytes(qualifier);
}
this.op = dcf.getOperator().toString();
this.comparator = new WritableByteArrayComparableModel(dcf.getComparator());
this.comparator = new ByteArrayComparableModel(dcf.getComparator());
this.dropDependentColumn = dcf.dropDependentColumn();
} break;
case FilterList:
@ -270,7 +270,7 @@ public class ScannerModel implements ProtobufMessageHandler, Serializable {
case ValueFilter:
this.op = ((CompareFilter)filter).getOperator().toString();
this.comparator =
new WritableByteArrayComparableModel(
new ByteArrayComparableModel(
((CompareFilter)filter).getComparator());
break;
case RandomRowFilter:
@ -286,7 +286,7 @@ public class ScannerModel implements ProtobufMessageHandler, Serializable {
}
this.op = scvf.getOperator().toString();
this.comparator =
new WritableByteArrayComparableModel(scvf.getComparator());
new ByteArrayComparableModel(scvf.getComparator());
if (scvf.getFilterIfMissing()) {
this.ifMissing = true;
}

View File

@ -48,7 +48,7 @@ import org.apache.hadoop.hbase.coprocessor.ObserverContext;
import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
import org.apache.hadoop.hbase.filter.CompareFilter;
import org.apache.hadoop.hbase.filter.FilterList;
import org.apache.hadoop.hbase.filter.WritableByteArrayComparable;
import org.apache.hadoop.hbase.filter.ByteArrayComparable;
import org.apache.hadoop.hbase.ipc.HBaseRPC;
import org.apache.hadoop.hbase.ipc.ProtocolSignature;
import org.apache.hadoop.hbase.ipc.RequestContext;
@ -909,7 +909,7 @@ public class AccessController extends BaseRegionObserver
public boolean preCheckAndPut(final ObserverContext<RegionCoprocessorEnvironment> c,
final byte [] row, final byte [] family, final byte [] qualifier,
final CompareFilter.CompareOp compareOp,
final WritableByteArrayComparable comparator, final Put put,
final ByteArrayComparable comparator, final Put put,
final boolean result) throws IOException {
Collection<byte[]> familyMap = Arrays.asList(new byte[][]{family});
requirePermission(Permission.Action.READ, c.getEnvironment(), familyMap);
@ -921,7 +921,7 @@ public class AccessController extends BaseRegionObserver
public boolean preCheckAndDelete(final ObserverContext<RegionCoprocessorEnvironment> c,
final byte [] row, final byte [] family, final byte [] qualifier,
final CompareFilter.CompareOp compareOp,
final WritableByteArrayComparable comparator, final Delete delete,
final ByteArrayComparable comparator, final Delete delete,
final boolean result) throws IOException {
Collection<byte[]> familyMap = Arrays.asList(new byte[][]{family});
requirePermission(Permission.Action.READ, c.getEnvironment(), familyMap);

View File

@ -69,7 +69,7 @@ public class TestFakeKeyInFilter extends BinaryComparator {
region.flushcache();
Scan scan = new Scan();
scan.addColumn(cf, cq);
WritableByteArrayComparable comparable = new TestFakeKeyInFilter();
ByteArrayComparable comparable = new TestFakeKeyInFilter();
Filter filter = new RowFilter(CompareFilter.CompareOp.EQUAL, comparable);
scan.setFilter(filter);
RegionScanner scanner = region.getScanner(scan);

View File

@ -82,7 +82,7 @@ import org.apache.hadoop.hbase.filter.SingleColumnValueFilter;
import org.apache.hadoop.hbase.filter.SkipFilter;
import org.apache.hadoop.hbase.filter.ValueFilter;
import org.apache.hadoop.hbase.filter.WhileMatchFilter;
import org.apache.hadoop.hbase.filter.WritableByteArrayComparable;
import org.apache.hadoop.hbase.filter.ByteArrayComparable;
import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
import org.apache.hadoop.hbase.protobuf.generated.FilterProtos;
import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos;
@ -517,7 +517,7 @@ public class TestHbaseObjectWritable extends TestCase {
assertEquals(51,HbaseObjectWritable.getClassCode(ValueFilter.class).intValue());
assertEquals(52,HbaseObjectWritable.getClassCode(QualifierFilter.class).intValue());
assertEquals(53,HbaseObjectWritable.getClassCode(SkipFilter.class).intValue());
assertEquals(54,HbaseObjectWritable.getClassCode(WritableByteArrayComparable.class).intValue());
assertEquals(54,HbaseObjectWritable.getClassCode(ByteArrayComparable.class).intValue());
assertEquals(55,HbaseObjectWritable.getClassCode(FirstKeyOnlyFilter.class).intValue());
assertEquals(56,HbaseObjectWritable.getClassCode(DependentColumnFilter.class).intValue());