use of org.apache.hadoop.hbase.CompareOperator in project hbase by apache.
the class QualifierFilter method createFilterFromArguments.
public static Filter createFilterFromArguments(ArrayList<byte[]> filterArguments) {
ArrayList<?> arguments = CompareFilter.extractArguments(filterArguments);
CompareOperator compareOp = (CompareOperator) arguments.get(0);
ByteArrayComparable comparator = (ByteArrayComparable) arguments.get(1);
return new QualifierFilter(compareOp, comparator);
}
use of org.apache.hadoop.hbase.CompareOperator in project hbase by apache.
the class RowFilter method parseFrom.
/**
* @param pbBytes A pb serialized {@link RowFilter} instance
* @return An instance of {@link RowFilter} made from <code>bytes</code>
* @throws DeserializationException
* @see #toByteArray
*/
public static RowFilter parseFrom(final byte[] pbBytes) throws DeserializationException {
FilterProtos.RowFilter proto;
try {
proto = FilterProtos.RowFilter.parseFrom(pbBytes);
} catch (InvalidProtocolBufferException e) {
throw new DeserializationException(e);
}
final CompareOperator valueCompareOp = CompareOperator.valueOf(proto.getCompareFilter().getCompareOp().name());
ByteArrayComparable valueComparator = null;
try {
if (proto.getCompareFilter().hasComparator()) {
valueComparator = ProtobufUtil.toComparator(proto.getCompareFilter().getComparator());
}
} catch (IOException ioe) {
throw new DeserializationException(ioe);
}
return new RowFilter(valueCompareOp, valueComparator);
}
use of org.apache.hadoop.hbase.CompareOperator in project hbase by apache.
the class RowFilter method createFilterFromArguments.
public static Filter createFilterFromArguments(ArrayList<byte[]> filterArguments) {
// for arguments
@SuppressWarnings("rawtypes") ArrayList arguments = CompareFilter.extractArguments(filterArguments);
CompareOperator compareOp = (CompareOperator) arguments.get(0);
ByteArrayComparable comparator = (ByteArrayComparable) arguments.get(1);
return new RowFilter(compareOp, comparator);
}
use of org.apache.hadoop.hbase.CompareOperator in project hbase by apache.
the class SingleColumnValueExcludeFilter method parseFrom.
/**
* @param pbBytes A pb serialized {@link SingleColumnValueExcludeFilter} instance
* @return An instance of {@link SingleColumnValueExcludeFilter} made from <code>bytes</code>
* @throws DeserializationException
* @see #toByteArray
*/
public static SingleColumnValueExcludeFilter parseFrom(final byte[] pbBytes) throws DeserializationException {
FilterProtos.SingleColumnValueExcludeFilter proto;
try {
proto = FilterProtos.SingleColumnValueExcludeFilter.parseFrom(pbBytes);
} catch (InvalidProtocolBufferException e) {
throw new DeserializationException(e);
}
FilterProtos.SingleColumnValueFilter parentProto = proto.getSingleColumnValueFilter();
final CompareOperator compareOp = CompareOperator.valueOf(parentProto.getCompareOp().name());
final ByteArrayComparable comparator;
try {
comparator = ProtobufUtil.toComparator(parentProto.getComparator());
} catch (IOException ioe) {
throw new DeserializationException(ioe);
}
return new SingleColumnValueExcludeFilter(parentProto.hasColumnFamily() ? parentProto.getColumnFamily().toByteArray() : null, parentProto.hasColumnQualifier() ? parentProto.getColumnQualifier().toByteArray() : null, compareOp, comparator, parentProto.getFilterIfMissing(), parentProto.getLatestVersionOnly());
}
use of org.apache.hadoop.hbase.CompareOperator in project hbase by apache.
the class FamilyFilter method createFilterFromArguments.
public static Filter createFilterFromArguments(ArrayList<byte[]> filterArguments) {
ArrayList<?> arguments = CompareFilter.extractArguments(filterArguments);
CompareOperator compareOp = (CompareOperator) arguments.get(0);
ByteArrayComparable comparator = (ByteArrayComparable) arguments.get(1);
return new FamilyFilter(compareOp, comparator);
}
Aggregations