/** * Add a Filter to be instantiated on import * @param conf Configuration to update (will be passed to the job) * @param clazz {@link Filter} subclass to instantiate on the server. * @param filterArgs List of arguments to pass to the filter on instantiation */ public static void addFilterAndArguments(Configuration conf, Class<? extends Filter> clazz, List<String> filterArgs) throws IOException { conf.set(Import.FILTER_CLASS_CONF_KEY, clazz.getName()); conf.setStrings(Import.FILTER_ARGS_CONF_KEY, filterArgs.toArray(new String[filterArgs.size()])); }
/** constructor */ public TestCompactionWithCoprocessor() throws Exception { super(); conf.setStrings(CoprocessorHost.USER_REGION_COPROCESSOR_CONF_KEY, NoOpScanPolicyObserver.class.getName()); } }
@BeforeClass public static void setupBeforeClass() throws Exception { TEST_UTIL = new HBaseTestingUtility(); CONF = TEST_UTIL.getConfiguration(); CONF.setStrings(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, DummyCoprocessorService.class.getName()); CONF.setStrings(CoprocessorHost.REGIONSERVER_COPROCESSOR_CONF_KEY, DummyCoprocessorService.class.getName()); CONF.setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, DummyCoprocessorService.class.getName()); TEST_UTIL.startMiniCluster(); }
@BeforeClass public static void setUpBeforeClass() throws Exception { Configuration conf = TEST_UTIL.getConfiguration(); // Don't report so often so easier to see other rpcs conf.setInt("hbase.regionserver.msginterval", 3 * 10000); conf.setInt(HConstants.HBASE_RPC_TIMEOUT_KEY, rpcTimeout); conf.setStrings(HConstants.REGION_SERVER_IMPL, RegionServerWithScanTimeout.class.getName()); conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, CLIENT_RETRIES_NUMBER); conf.setInt(HConstants.HBASE_CLIENT_PAUSE, 1000); TEST_UTIL.startMiniCluster(1); }
/** * 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); } }
@BeforeClass public static void setUpBeforeClass() throws Exception { // Stack up three coprocessors just so I can check bypass skips subsequent calls. Configuration conf = HBaseConfiguration.create(); conf.setStrings(CoprocessorHost.USER_REGION_COPROCESSOR_CONF_KEY, new String [] {TestCoprocessor.class.getName(), TestCoprocessor2.class.getName(), TestCoprocessor3.class.getName()}); util = new HBaseTestingUtility(conf); util.startMiniCluster(); }
@BeforeClass public static void setupBeforeClass() throws Exception { Configuration conf = util.getConfiguration(); conf.setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, RowProcessorEndpoint.class.getName()); conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 2); conf.setLong("hbase.hregion.row.processor.timeout", 1000L); conf.setLong(RpcScheduler.IPC_SERVER_MAX_CALLQUEUE_LENGTH, 2048); util.startMiniCluster(); }
@BeforeClass public static void beforeClass() throws Exception { Configuration conf = TEST_UTIL.getConfiguration(); conf.setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, MultiRowMutationEndpoint.class.getName()); conf.setBoolean("hbase.table.sanity.checks", true); // enable for below tests // We need more than one region server in this test TEST_UTIL.startMiniCluster(SLAVES); }
@BeforeClass public static void setupBeforeClass() throws Exception { Configuration conf = TEST_UTIL.getConfiguration(); conf.setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, FlushingRegionObserver.class.getName()); conf.setBoolean(CoprocessorHost.ABORT_ON_ERROR_KEY, true); conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 2); // Let's fail fast. TEST_UTIL.startMiniCluster(1); TEST_UTIL.createTable(TableName.valueOf(tableName), family); }
@BeforeClass public static void setUpBeforeClass() throws Exception { Configuration conf = TEST_UTIL.getConfiguration(); conf.setInt("hfile.format.version", 3); conf.setStrings(CoprocessorHost.USER_REGION_COPROCESSOR_CONF_KEY, TestCoprocessorForTags.class.getName()); TEST_UTIL.startMiniCluster(2); }
@BeforeClass public static void setUpBeforeClass() throws Exception { Configuration conf = TEST_UTIL.getConfiguration(); conf.setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, MultiRowMutationEndpoint.class.getName(), NoOpScanPolicyObserver.class.getName()); TestFromClientSideScanExcpetion.setUpBeforeClass(); } }
@BeforeClass public static void beforeClass() throws Throwable { UTIL.getConfiguration().setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, org.apache.hadoop.hbase.coprocessor.Export.class.getName()); org.apache.hadoop.hbase.mapreduce.TestImportExport.beforeClass(); }
@Before public void before() throws Exception { UTIL.getConfiguration() .setStrings(HConstants.REGION_SERVER_IMPL, TestMockRegionServer.class.getName()); UTIL.startMiniCluster(1); }
@BeforeClass public static void setUpBeforeClass() throws Exception { Configuration conf = TEST_UTIL.getConfiguration(); conf.setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, ScanObserver.class.getName()); TEST_UTIL.startMiniCluster(); }
@BeforeClass public static void setUpBeforeClass() throws Exception { TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_RPC_TIMEOUT_KEY, 60000); TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_OPERATION_TIMEOUT, 120000); TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 2); TEST_UTIL.getConfiguration().setStrings(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, ProtobufCoprocessorService.class.getName()); TEST_UTIL.getConfiguration().setStrings(CoprocessorHost.REGIONSERVER_COPROCESSOR_CONF_KEY, DummyRegionServerEndpoint.class.getName()); TEST_UTIL.startMiniCluster(2); ASYNC_CONN = ConnectionFactory.createAsyncConnection(TEST_UTIL.getConfiguration()).get(); }
@BeforeClass public static void setupBeforeClass() throws Exception { // set configure to indicate which cp should be loaded Configuration conf = util.getConfiguration(); conf.setBoolean("hbase.master.distributed.log.replay", true); conf.setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, SimpleRegionObserver.class.getName()); util.startMiniCluster(); cluster = util.getMiniHBaseCluster(); }
@BeforeClass public static void setUp() throws Exception { UTIL.getConfiguration().setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, DelayOpenCP.class.getName()); //set handler number to 1. UTIL.getConfiguration().setInt(HConstants.REGION_SERVER_HANDLER_COUNT, 1); UTIL.startMiniCluster(2); UTIL.createTable(TableName.valueOf(TABLENAME), "fa"); }
private void setUp(boolean useBucketCache) throws IOException { test_util = HBaseTestingUtility.createLocalHTU(); conf = test_util.getConfiguration(); if (useBucketCache) { conf.setInt("hbase.bucketcache.size", 400); conf.setStrings(HConstants.BUCKET_CACHE_IOENGINE_KEY, "offheap"); conf.setInt("hbase.bucketcache.writer.threads", 10); conf.setFloat("hfile.block.cache.size", 0.2f); conf.setFloat("hbase.regionserver.global.memstore.size", 0.1f); } tableName = TableName.valueOf(name.getMethodName()); }
@BeforeClass public static void setupBeforeClass() throws Exception { TEST_UTIL = new HBaseTestingUtility(); CONF = TEST_UTIL.getConfiguration(); CONF.setStrings(CoprocessorHost.REGIONSERVER_COPROCESSOR_CONF_KEY, DummyRegionServerEndpoint.class.getName()); TEST_UTIL.startMiniCluster(); }
@BeforeClass public static void setUp() throws Exception { UTIL.getConfiguration().setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, DelayCloseCP.class.getName()); UTIL.startMiniCluster(3); UTIL.getAdmin().balancerSwitch(false, true); UTIL.createTable(TABLE_NAME, CF); UTIL.waitTableAvailable(TABLE_NAME); }