本文整理汇总了Java中org.apache.hadoop.hbase.protobuf.ProtobufUtil.toFilter方法的典型用法代码示例。如果您正苦于以下问题:Java ProtobufUtil.toFilter方法的具体用法?Java ProtobufUtil.toFilter怎么用?Java ProtobufUtil.toFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hbase.protobuf.ProtobufUtil
的用法示例。
在下文中一共展示了ProtobufUtil.toFilter方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: serializeFilter
import org.apache.hadoop.hbase.protobuf.ProtobufUtil; //导入方法依赖的package包/类
public static byte[] serializeFilter(Filter filter) {
if (filter == null) {
return null;
}
try {
FilterProtos.Filter pbFilter = ProtobufUtil.toFilter(filter);
return pbFilter.toByteArray();
} catch (IOException e) {
throw new DrillRuntimeException("Error serializing filter: " + filter, e);
}
}
示例2: deserializeFilter
import org.apache.hadoop.hbase.protobuf.ProtobufUtil; //导入方法依赖的package包/类
public static Filter deserializeFilter(byte[] filterBytes) {
if (filterBytes == null) {
return null;
}
try {
FilterProtos.Filter pbFilter = FilterProtos.Filter.parseFrom(filterBytes);
return ProtobufUtil.toFilter(pbFilter);
} catch (Exception e) {
throw new DrillRuntimeException("Error deserializing filter: " + filterBytes, e);
}
}
示例3: serializeFilter
import org.apache.hadoop.hbase.protobuf.ProtobufUtil; //导入方法依赖的package包/类
public static byte[] serializeFilter(Filter filter) {
if (filter == null) {
return null;
}
try {
FilterProtos.Filter pbFilter = ProtobufUtil.toFilter(filter);
return pbFilter.toByteArray();
} catch (IOException e) {
throw new RuntimeException("Error serializing filter: " + filter, e);
}
}
示例4: deserializeFilter
import org.apache.hadoop.hbase.protobuf.ProtobufUtil; //导入方法依赖的package包/类
public static Filter deserializeFilter(byte[] filterBytes) {
if (filterBytes == null) {
return null;
}
try {
FilterProtos.Filter pbFilter = FilterProtos.Filter.parseFrom(filterBytes);
return ProtobufUtil.toFilter(pbFilter);
} catch (Exception e) {
throw new RuntimeException("Error deserializing filter: " + filterBytes, e);
}
}
示例5: parseFrom
import org.apache.hadoop.hbase.protobuf.ProtobufUtil; //导入方法依赖的package包/类
/**
* @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);
}
}
示例6: parseFrom
import org.apache.hadoop.hbase.protobuf.ProtobufUtil; //导入方法依赖的package包/类
/**
* @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);
}
}
示例7: parseFrom
import org.apache.hadoop.hbase.protobuf.ProtobufUtil; //导入方法依赖的package包/类
/**
* @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);
}
}
示例8: serializationTest
import org.apache.hadoop.hbase.protobuf.ProtobufUtil; //导入方法依赖的package包/类
private Filter serializationTest(Filter filter) throws Exception {
FilterProtos.Filter filterProto = ProtobufUtil.toFilter(filter);
Filter newFilter = ProtobufUtil.toFilter(filterProto);
return newFilter;
}