本文整理了Java中org.apache.hadoop.hbase.regionserver.wal.WALCellCodec.create()
方法的一些代码示例,展示了WALCellCodec.create()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WALCellCodec.create()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.regionserver.wal.WALCellCodec
类名称:WALCellCodec
方法名:create
[英]Create and setup a WALCellCodec from the cellCodecClsName and CompressionContext, if cellCodecClsName is specified. Otherwise Cell Codec classname is read from Configuration. Fully prepares the codec for use.
[中]如果指定了cellCodecClsName,则从cellCodecClsName和CompressionContext创建并设置WALCellCodec。否则,将从配置中读取单元编解码器类名。为使用编解码器做好充分准备。
代码示例来源:origin: apache/hbase
protected WALCellCodec getCodec(Configuration conf, String cellCodecClsName,
CompressionContext compressionContext) throws IOException {
return WALCellCodec.create(conf, cellCodecClsName, compressionContext);
}
代码示例来源:origin: apache/hbase
private WALCellCodec getCodec(Configuration conf, CompressionContext compressionContext)
throws IOException {
return WALCellCodec.create(conf, null, compressionContext);
}
代码示例来源:origin: apache/hbase
/**
* Test that a custom {@link WALCellCodec} will fail if provided an invalid
* code class.
*/
@Test(expected = RuntimeException.class)
public void testCreatePreparesCodecInvalidClass() throws Exception {
Configuration conf = new Configuration(false);
conf.setStrings(WALCellCodec.WAL_CELL_CODEC_CLASS_KEY, "org.apache.hbase.wal.NoSuchClass");
WALCellCodec.create(conf, null, null);
}
}
代码示例来源:origin: apache/hbase
/**
* Test that a custom {@link WALCellCodec} will be completely setup when it is instantiated via
* {@link WALCellCodec}
* @throws Exception on failure
*/
@Test
public void testCreatePreparesCodec() throws Exception {
Configuration conf = new Configuration(false);
conf.setClass(WALCellCodec.WAL_CELL_CODEC_CLASS_KEY, CustomWALCellCodec.class,
WALCellCodec.class);
CustomWALCellCodec codec = (CustomWALCellCodec) WALCellCodec.create(conf, null, null);
assertEquals("Custom codec didn't get initialized with the right configuration!", conf,
codec.conf);
assertEquals("Custom codec didn't get initialized with the right compression context!", null,
codec.context);
}
代码示例来源:origin: apache/phoenix
Path testFile) throws IOException {
WALCellCodec codec = WALCellCodec.create(UTIL.getConfiguration(), compressionContext);
代码示例来源:origin: harbby/presto-connectors
protected WALCellCodec getCodec(Configuration conf, CompressionContext compressionContext)
throws IOException {
return WALCellCodec.create(conf, null, compressionContext);
}
代码示例来源:origin: harbby/presto-connectors
protected WALCellCodec getCodec(Configuration conf, String cellCodecClsName,
CompressionContext compressionContext) throws IOException {
return WALCellCodec.create(conf, cellCodecClsName, compressionContext);
}
代码示例来源:origin: org.apache.hbase/hbase-server
/**
* Test that a custom {@link WALCellCodec} will fail if provided an invalid
* code class.
*/
@Test(expected = RuntimeException.class)
public void testCreatePreparesCodecInvalidClass() throws Exception {
Configuration conf = new Configuration(false);
conf.setStrings(WALCellCodec.WAL_CELL_CODEC_CLASS_KEY, "org.apache.hbase.wal.NoSuchClass");
WALCellCodec.create(conf, null, null);
}
}
代码示例来源:origin: org.apache.hbase/hbase-server
/**
* Test that a custom {@link WALCellCodec} will be completely setup when it is instantiated via
* {@link WALCellCodec}
* @throws Exception on failure
*/
@Test
public void testCreatePreparesCodec() throws Exception {
Configuration conf = new Configuration(false);
conf.setClass(WALCellCodec.WAL_CELL_CODEC_CLASS_KEY, CustomWALCellCodec.class,
WALCellCodec.class);
CustomWALCellCodec codec = (CustomWALCellCodec) WALCellCodec.create(conf, null, null);
assertEquals("Custom codec didn't get initialized with the right configuration!", conf,
codec.conf);
assertEquals("Custom codec didn't get initialized with the right compression context!", null,
codec.context);
}
内容来源于网络,如有侵权,请联系作者删除!