本文整理汇总了Java中org.apache.hadoop.hbase.avro.generated.ACompressionAlgorithm类的典型用法代码示例。如果您正苦于以下问题:Java ACompressionAlgorithm类的具体用法?Java ACompressionAlgorithm怎么用?Java ACompressionAlgorithm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ACompressionAlgorithm类属于org.apache.hadoop.hbase.avro.generated包,在下文中一共展示了ACompressionAlgorithm类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: hcdToAFD
import org.apache.hadoop.hbase.avro.generated.ACompressionAlgorithm; //导入依赖的package包/类
static public AFamilyDescriptor hcdToAFD(HColumnDescriptor hcd) throws IOException {
AFamilyDescriptor afamily = new AFamilyDescriptor();
afamily.name = ByteBuffer.wrap(hcd.getName());
String compressionAlgorithm = hcd.getCompressionType().getName();
if (compressionAlgorithm == "LZO") {
afamily.compression = ACompressionAlgorithm.LZO;
} else if (compressionAlgorithm == "GZ") {
afamily.compression = ACompressionAlgorithm.GZ;
} else {
afamily.compression = ACompressionAlgorithm.NONE;
}
afamily.maxVersions = hcd.getMaxVersions();
afamily.blocksize = hcd.getBlocksize();
afamily.inMemory = hcd.isInMemory();
afamily.timeToLive = hcd.getTimeToLive();
afamily.blockCacheEnabled = hcd.isBlockCacheEnabled();
return afamily;
}
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:19,代码来源:AvroUtil.java
示例2: afdToHCD
import org.apache.hadoop.hbase.avro.generated.ACompressionAlgorithm; //导入依赖的package包/类
static public HColumnDescriptor afdToHCD(AFamilyDescriptor afd) throws IOException {
HColumnDescriptor hcd = new HColumnDescriptor(Bytes.toBytes(afd.name));
ACompressionAlgorithm compressionAlgorithm = afd.compression;
if (compressionAlgorithm == ACompressionAlgorithm.LZO) {
hcd.setCompressionType(Compression.Algorithm.LZO);
} else if (compressionAlgorithm == ACompressionAlgorithm.GZ) {
hcd.setCompressionType(Compression.Algorithm.GZ);
} else {
hcd.setCompressionType(Compression.Algorithm.NONE);
}
if (afd.maxVersions != null) {
hcd.setMaxVersions(afd.maxVersions);
}
if (afd.blocksize != null) {
hcd.setBlocksize(afd.blocksize);
}
if (afd.inMemory != null) {
hcd.setInMemory(afd.inMemory);
}
if (afd.timeToLive != null) {
hcd.setTimeToLive(afd.timeToLive);
}
if (afd.blockCacheEnabled != null) {
hcd.setBlockCacheEnabled(afd.blockCacheEnabled);
}
return hcd;
}
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:34,代码来源:AvroUtil.java
注:本文中的org.apache.hadoop.hbase.avro.generated.ACompressionAlgorithm类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论