本文整理汇总了Java中org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos类的典型用法代码示例。如果您正苦于以下问题:Java ComparatorProtos类的具体用法?Java ComparatorProtos怎么用?Java ComparatorProtos使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ComparatorProtos类属于org.apache.hadoop.hbase.protobuf.generated包,在下文中一共展示了ComparatorProtos类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: toComparator
import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; //导入依赖的package包/类
/**
* Convert a protocol buffer Comparator to a ByteArrayComparable
*
* @param proto the protocol buffer Comparator to convert
* @return the converted ByteArrayComparable
*/
@SuppressWarnings("unchecked")
public static ByteArrayComparable toComparator(ComparatorProtos.Comparator proto)
throws IOException {
String type = proto.getName();
String funcName = "parseFrom";
byte [] value = proto.getSerializedComparator().toByteArray();
try {
Class<? extends ByteArrayComparable> c =
(Class<? extends ByteArrayComparable>)Class.forName(type, true, CLASS_LOADER);
Method parseFrom = c.getMethod(funcName, byte[].class);
if (parseFrom == null) {
throw new IOException("Unable to locate function: " + funcName + " in type: " + type);
}
return (ByteArrayComparable)parseFrom.invoke(null, value);
} catch (Exception e) {
throw new IOException(e);
}
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:25,代码来源:ProtobufUtil.java
示例2: toComparator
import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; //导入依赖的package包/类
/**
* Convert a protocol buffer Comparator to a ByteArrayComparable
*
* @param proto the protocol buffer Comparator to convert
* @return the converted ByteArrayComparable
*/
@SuppressWarnings("unchecked")
public static ByteArrayComparable toComparator(ComparatorProtos.Comparator proto)
throws IOException {
String type = proto.getName();
String funcName = "parseFrom";
byte [] value = proto.getSerializedComparator().toByteArray();
try {
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 (ByteArrayComparable)parseFrom.invoke(null, value);
} catch (Exception e) {
throw new IOException(e);
}
}
开发者ID:daidong,项目名称:DominoHBase,代码行数:25,代码来源:ProtobufUtil.java
示例3: toByteArray
import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; //导入依赖的package包/类
/**
* @return The comparator serialized using pb
*/
@Override
public byte [] toByteArray() {
ComparatorProtos.LongComparator.Builder builder =
ComparatorProtos.LongComparator.newBuilder();
builder.setComparable(super.convert());
return builder.build().toByteArray();
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:LongComparator.java
示例4: parseFrom
import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; //导入依赖的package包/类
/**
* @param pbBytes A pb serialized {@link BinaryComparator} instance
* @return An instance of {@link BinaryComparator} made from <code>bytes</code>
* @throws org.apache.hadoop.hbase.exceptions.DeserializationException
* @see #toByteArray
*/
public static LongComparator parseFrom(final byte [] pbBytes)
throws DeserializationException {
ComparatorProtos.LongComparator proto;
try {
proto = ComparatorProtos.LongComparator.parseFrom(pbBytes);
} catch (InvalidProtocolBufferException e) {
throw new DeserializationException(e);
}
return new LongComparator(Bytes.toLong(proto.getComparable().getValue().toByteArray()));
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:17,代码来源:LongComparator.java
示例5: toByteArray
import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; //导入依赖的package包/类
/**
* @return The comparator serialized using pb
*/
public byte [] toByteArray() {
ComparatorProtos.BitComparator.Builder builder =
ComparatorProtos.BitComparator.newBuilder();
builder.setComparable(super.convert());
ComparatorProtos.BitComparator.BitwiseOp bitwiseOpPb =
ComparatorProtos.BitComparator.BitwiseOp.valueOf(bitOperator.name());
builder.setBitwiseOp(bitwiseOpPb);
return builder.build().toByteArray();
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:13,代码来源:BitComparator.java
示例6: parseFrom
import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; //导入依赖的package包/类
/**
* @param pbBytes A pb serialized {@link BitComparator} instance
* @return An instance of {@link BitComparator} made from <code>bytes</code>
* @throws DeserializationException
* @see #toByteArray
*/
public static BitComparator parseFrom(final byte [] pbBytes)
throws DeserializationException {
ComparatorProtos.BitComparator proto;
try {
proto = ComparatorProtos.BitComparator.parseFrom(pbBytes);
} catch (InvalidProtocolBufferException e) {
throw new DeserializationException(e);
}
BitwiseOp bitwiseOp = BitwiseOp.valueOf(proto.getBitwiseOp().name());
return new BitComparator(proto.getComparable().getValue().toByteArray(),bitwiseOp);
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:18,代码来源:BitComparator.java
示例7: toByteArray
import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; //导入依赖的package包/类
/**
* @return The comparator serialized using pb
*/
public byte [] toByteArray() {
ComparatorProtos.BinaryPrefixComparator.Builder builder =
ComparatorProtos.BinaryPrefixComparator.newBuilder();
builder.setComparable(super.convert());
return builder.build().toByteArray();
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:10,代码来源:BinaryPrefixComparator.java
示例8: parseFrom
import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; //导入依赖的package包/类
/**
* @param pbBytes A pb serialized {@link BinaryPrefixComparator} instance
* @return An instance of {@link BinaryPrefixComparator} made from <code>bytes</code>
* @throws DeserializationException
* @see #toByteArray
*/
public static BinaryPrefixComparator parseFrom(final byte [] pbBytes)
throws DeserializationException {
ComparatorProtos.BinaryPrefixComparator proto;
try {
proto = ComparatorProtos.BinaryPrefixComparator.parseFrom(pbBytes);
} catch (InvalidProtocolBufferException e) {
throw new DeserializationException(e);
}
return new BinaryPrefixComparator(proto.getComparable().getValue().toByteArray());
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:17,代码来源:BinaryPrefixComparator.java
示例9: toByteArray
import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; //导入依赖的package包/类
/**
* @return The comparator serialized using pb
*/
public byte [] toByteArray() {
ComparatorProtos.SubstringComparator.Builder builder =
ComparatorProtos.SubstringComparator.newBuilder();
builder.setSubstr(this.substr);
return builder.build().toByteArray();
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:10,代码来源:SubstringComparator.java
示例10: parseFrom
import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; //导入依赖的package包/类
/**
* @param pbBytes A pb serialized {@link SubstringComparator} instance
* @return An instance of {@link SubstringComparator} made from <code>bytes</code>
* @throws DeserializationException
* @see #toByteArray
*/
public static SubstringComparator parseFrom(final byte [] pbBytes)
throws DeserializationException {
ComparatorProtos.SubstringComparator proto;
try {
proto = ComparatorProtos.SubstringComparator.parseFrom(pbBytes);
} catch (InvalidProtocolBufferException e) {
throw new DeserializationException(e);
}
return new SubstringComparator(proto.getSubstr());
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:17,代码来源:SubstringComparator.java
示例11: toByteArray
import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; //导入依赖的package包/类
@Override
public byte[] toByteArray() {
ComparatorProtos.RegexStringComparator.Builder builder =
ComparatorProtos.RegexStringComparator.newBuilder();
builder.setPattern(pattern.pattern());
builder.setPatternFlags(pattern.flags());
builder.setCharset(charset.name());
builder.setEngine(EngineType.JAVA.name());
return builder.build().toByteArray();
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:RegexStringComparator.java
示例12: parseFrom
import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; //导入依赖的package包/类
/**
* @param pbBytes A pb serialized {@link NullComparator} instance
* @return An instance of {@link NullComparator} made from <code>bytes</code>
* @throws DeserializationException
* @see #toByteArray
*/
public static NullComparator parseFrom(final byte [] pbBytes)
throws DeserializationException {
try {
// Just parse. Don't use what we parse since on end we are returning new NullComparator.
ComparatorProtos.NullComparator.parseFrom(pbBytes);
} catch (InvalidProtocolBufferException e) {
throw new DeserializationException(e);
}
return new NullComparator();
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:17,代码来源:NullComparator.java
示例13: toByteArray
import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; //导入依赖的package包/类
/**
* @return The comparator serialized using pb
*/
public byte [] toByteArray() {
ComparatorProtos.BinaryComparator.Builder builder =
ComparatorProtos.BinaryComparator.newBuilder();
builder.setComparable(super.convert());
return builder.build().toByteArray();
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:10,代码来源:BinaryComparator.java
示例14: parseFrom
import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; //导入依赖的package包/类
/**
* @param pbBytes A pb serialized {@link BinaryComparator} instance
* @return An instance of {@link BinaryComparator} made from <code>bytes</code>
* @throws DeserializationException
* @see #toByteArray
*/
public static BinaryComparator parseFrom(final byte [] pbBytes)
throws DeserializationException {
ComparatorProtos.BinaryComparator proto;
try {
proto = ComparatorProtos.BinaryComparator.parseFrom(pbBytes);
} catch (InvalidProtocolBufferException e) {
throw new DeserializationException(e);
}
return new BinaryComparator(proto.getComparable().getValue().toByteArray());
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:17,代码来源:BinaryComparator.java
注:本文中的org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论