下面列出了怎么用org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec的API类实例代码及写法,或者点击链接到github查看源代码。
@BeforeClass
public static void setupCluster() throws Exception {
//add our codec and enable WAL compression
Configuration conf = UTIL.getConfiguration();
setUpConfigForMiniCluster(conf);
IndexTestingUtils.setupConfig(conf);
// disable version checking, so we can test against whatever version of HBase happens to be
// installed (right now, its generally going to be SNAPSHOT versions).
conf.setBoolean(Indexer.CHECK_VERSION_CONF_KEY, false);
conf.set(WALCellCodec.WAL_CELL_CODEC_CLASS_KEY,
IndexedWALEditCodec.class.getName());
conf.setBoolean(HConstants.ENABLE_WAL_COMPRESSION, true);
//start the mini-cluster
UTIL.startMiniCluster();
}
/**
* Compressed WALs are supported when we have the WALEditCodec installed
* @throws Exception
*/
@Test
public void testCompressedWALWithCodec() throws Exception {
Configuration conf = new Configuration(false);
conf.setBoolean(HConstants.ENABLE_WAL_COMPRESSION, true);
// works with WALEditcodec
conf.set(WALCellCodec.WAL_CELL_CODEC_CLASS_KEY, IndexedWALEditCodec.class.getName());
IndexManagementUtil.ensureMutableIndexingCorrectlyConfigured(conf);
}
/**
* Compressed WALs are supported when we have the WALEditCodec installed
* @throws Exception
*/
@Test
public void testCompressedWALWithCodec() throws Exception {
Configuration conf = new Configuration(false);
conf.setBoolean(HConstants.ENABLE_WAL_COMPRESSION, true);
// works with WALEditcodec
conf.set(WALCellCodec.WAL_CELL_CODEC_CLASS_KEY, IndexedWALEditCodec.class.getName());
IndexManagementUtil.ensureMutableIndexingCorrectlyConfigured(conf);
}
@BeforeClass
public static void setupCluster() throws Exception {
//add our codec and enable WAL compression
Configuration conf = UTIL.getConfiguration();
IndexTestingUtils.setupConfig(conf);
// disable version checking, so we can test against whatever version of HBase happens to be
// installed (right now, its generally going to be SNAPSHOT versions).
conf.setBoolean(Indexer.CHECK_VERSION_CONF_KEY, false);
conf.set(WALEditCodec.WAL_EDIT_CODEC_CLASS_KEY,
IndexedWALEditCodec.class.getName());
conf.setBoolean(HConstants.ENABLE_WAL_COMPRESSION, true);
//start the mini-cluster
UTIL.startMiniCluster();
}
/**
* Compressed WALs are supported when we have the WALEditCodec installed
* @throws Exception
*/
@Test
public void testCompressedWALWithCodec() throws Exception {
Configuration conf = new Configuration(false);
conf.setBoolean(HConstants.ENABLE_WAL_COMPRESSION, true);
// works with WALEditcodec
conf.set(WALEditCodec.WAL_EDIT_CODEC_CLASS_KEY, IndexedWALEditCodec.class.getName());
IndexManagementUtil.ensureMutableIndexingCorrectlyConfigured(conf);
}
public static void setupConfig(Configuration conf) {
conf.setInt(MASTER_INFO_PORT_KEY, -1);
conf.setInt(RS_INFO_PORT_KEY, -1);
// setup our codec, so we get proper replay/write
conf.set(WALCellCodec.WAL_CELL_CODEC_CLASS_KEY, IndexedWALEditCodec.class.getName());
}
public static void setupConfig(Configuration conf) {
conf.setInt(MASTER_INFO_PORT_KEY, -1);
conf.setInt(RS_INFO_PORT_KEY, -1);
// setup our codec, so we get proper replay/write
conf.set(WALCellCodec.WAL_CELL_CODEC_CLASS_KEY, IndexedWALEditCodec.class.getName());
}
public static void setupConfig(Configuration conf) {
conf.setInt(MASTER_INFO_PORT_KEY, -1);
conf.setInt(RS_INFO_PORT_KEY, -1);
// setup our codec, so we get proper replay/write
conf.set(WALEditCodec.WAL_EDIT_CODEC_CLASS_KEY, IndexedWALEditCodec.class.getName());
}