Java Code Examples for org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil#toFilter()

The following examples show how to use org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil#toFilter() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FilterWrapper.java    From hbase with Apache License 2.0 5 votes vote down vote up
/**
 * @param pbBytes A pb serialized {@link FilterWrapper} instance
 * @return An instance of {@link FilterWrapper} made from <code>bytes</code>
 * @throws org.apache.hadoop.hbase.exceptions.DeserializationException
 * @see #toByteArray
 */
public static FilterWrapper parseFrom(final byte [] pbBytes)
throws DeserializationException {
  FilterProtos.FilterWrapper proto;
  try {
    proto = FilterProtos.FilterWrapper.parseFrom(pbBytes);
  } catch (InvalidProtocolBufferException e) {
    throw new DeserializationException(e);
  }
  try {
    return new FilterWrapper(ProtobufUtil.toFilter(proto.getFilter()));
  } catch (IOException ioe) {
    throw new DeserializationException(ioe);
  }
}
 
Example 2
Source File: WhileMatchFilter.java    From hbase with Apache License 2.0 5 votes vote down vote up
/**
 * @param pbBytes A pb serialized {@link WhileMatchFilter} instance
 * @return An instance of {@link WhileMatchFilter} made from <code>bytes</code>
 * @throws org.apache.hadoop.hbase.exceptions.DeserializationException
 * @see #toByteArray
 */
public static WhileMatchFilter parseFrom(final byte [] pbBytes)
throws DeserializationException {
  FilterProtos.WhileMatchFilter proto;
  try {
    proto = FilterProtos.WhileMatchFilter.parseFrom(pbBytes);
  } catch (InvalidProtocolBufferException e) {
    throw new DeserializationException(e);
  }
  try {
    return new WhileMatchFilter(ProtobufUtil.toFilter(proto.getFilter()));
  } catch (IOException ioe) {
    throw new DeserializationException(ioe);
  }
}
 
Example 3
Source File: SkipFilter.java    From hbase with Apache License 2.0 5 votes vote down vote up
/**
 * @param pbBytes A pb serialized {@link SkipFilter} instance
 * @return An instance of {@link SkipFilter} made from <code>bytes</code>
 * @throws DeserializationException
 * @see #toByteArray
 */
public static SkipFilter parseFrom(final byte [] pbBytes)
throws DeserializationException {
  FilterProtos.SkipFilter proto;
  try {
    proto = FilterProtos.SkipFilter.parseFrom(pbBytes);
  } catch (InvalidProtocolBufferException e) {
    throw new DeserializationException(e);
  }
  try {
    return new SkipFilter(ProtobufUtil.toFilter(proto.getFilter()));
  } catch (IOException ioe) {
    throw new DeserializationException(ioe);
  }
}
 
Example 4
Source File: ThriftUtilities.java    From hbase with Apache License 2.0 4 votes vote down vote up
public static byte[] filterFromHBase(Filter filter) throws IOException {
  FilterProtos.Filter filterPB = ProtobufUtil.toFilter(filter);
  return filterPB.toByteArray();
}
 
Example 5
Source File: ThriftUtilities.java    From hbase with Apache License 2.0 4 votes vote down vote up
public static Filter filterFromThrift(byte[] filterBytes) throws IOException {
  FilterProtos.Filter filterPB  = FilterProtos.Filter.parseFrom(filterBytes);
  return ProtobufUtil.toFilter(filterPB);
}
 
Example 6
Source File: TestColumnPaginationFilter.java    From hbase with Apache License 2.0 4 votes vote down vote up
private Filter serializationTest(Filter filter) throws Exception {
  FilterProtos.Filter filterProto = ProtobufUtil.toFilter(filter);
  Filter newFilter = ProtobufUtil.toFilter(filterProto);

  return newFilter;
}