Search in sources :

Example 1 with HBaseCommonTestingUtil

use of org.apache.hadoop.hbase.HBaseCommonTestingUtil in project hbase by apache.

the class TestProcedureCleanup method setUp.

@BeforeClass
public static void setUp() throws Exception {
    htu = new HBaseCommonTestingUtil();
    htu.getConfiguration().setBoolean(WALProcedureStore.EXEC_WAL_CLEANUP_ON_LOAD_CONF_KEY, true);
    // NOTE: The executor will be created by each test
    testDir = htu.getDataTestDir();
    fs = testDir.getFileSystem(htu.getConfiguration());
    assertTrue(testDir.depth() > 1);
}
Also used : HBaseCommonTestingUtil(org.apache.hadoop.hbase.HBaseCommonTestingUtil) BeforeClass(org.junit.BeforeClass)

Example 2 with HBaseCommonTestingUtil

use of org.apache.hadoop.hbase.HBaseCommonTestingUtil in project hbase by apache.

the class TestProcedureExecution method setUp.

@Before
public void setUp() throws IOException {
    htu = new HBaseCommonTestingUtil();
    testDir = htu.getDataTestDir();
    fs = testDir.getFileSystem(htu.getConfiguration());
    assertTrue(testDir.depth() > 1);
    logDir = new Path(testDir, "proc-logs");
    procStore = ProcedureTestingUtility.createWalStore(htu.getConfiguration(), logDir);
    procExecutor = new ProcedureExecutor<>(htu.getConfiguration(), null, procStore);
    procStore.start(PROCEDURE_EXECUTOR_SLOTS);
    ProcedureTestingUtility.initAndStartWorkers(procExecutor, PROCEDURE_EXECUTOR_SLOTS, true);
}
Also used : Path(org.apache.hadoop.fs.Path) HBaseCommonTestingUtil(org.apache.hadoop.hbase.HBaseCommonTestingUtil) Before(org.junit.Before)

Example 3 with HBaseCommonTestingUtil

use of org.apache.hadoop.hbase.HBaseCommonTestingUtil in project hbase by apache.

the class TestProcedureReplayOrder method setUp.

@Before
public void setUp() throws IOException {
    htu = new HBaseCommonTestingUtil();
    htu.getConfiguration().setInt(WALProcedureStore.SYNC_WAIT_MSEC_CONF_KEY, 25);
    testDir = htu.getDataTestDir();
    fs = testDir.getFileSystem(htu.getConfiguration());
    assertTrue(testDir.depth() > 1);
    logDir = new Path(testDir, "proc-logs");
    procEnv = new TestProcedureEnv();
    procStore = ProcedureTestingUtility.createWalStore(htu.getConfiguration(), logDir);
    procExecutor = new ProcedureExecutor<>(htu.getConfiguration(), procEnv, procStore);
    procStore.start(NUM_THREADS);
    ProcedureTestingUtility.initAndStartWorkers(procExecutor, 1, true);
}
Also used : Path(org.apache.hadoop.fs.Path) HBaseCommonTestingUtil(org.apache.hadoop.hbase.HBaseCommonTestingUtil) Before(org.junit.Before)

Example 4 with HBaseCommonTestingUtil

use of org.apache.hadoop.hbase.HBaseCommonTestingUtil in project hbase by apache.

the class TestWALProcedureStore method setUp.

@Before
public void setUp() throws IOException {
    htu = new HBaseCommonTestingUtil();
    testDir = htu.getDataTestDir();
    htu.getConfiguration().set(HConstants.HBASE_DIR, testDir.toString());
    fs = testDir.getFileSystem(htu.getConfiguration());
    htu.getConfiguration().set(HConstants.HBASE_DIR, testDir.toString());
    assertTrue(testDir.depth() > 1);
    setupConfig(htu.getConfiguration());
    logDir = new Path(testDir, "proc-logs");
    procStore = ProcedureTestingUtility.createWalStore(htu.getConfiguration(), logDir);
    procStore.start(PROCEDURE_STORE_SLOTS);
    procStore.recoverLease();
    procStore.load(new LoadCounter());
}
Also used : Path(org.apache.hadoop.fs.Path) HBaseCommonTestingUtil(org.apache.hadoop.hbase.HBaseCommonTestingUtil) LoadCounter(org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility.LoadCounter) Before(org.junit.Before)

Example 5 with HBaseCommonTestingUtil

use of org.apache.hadoop.hbase.HBaseCommonTestingUtil in project hbase by apache.

the class TestProcedureRecovery method setUp.

@Before
public void setUp() throws IOException {
    htu = new HBaseCommonTestingUtil();
    testDir = htu.getDataTestDir();
    fs = testDir.getFileSystem(htu.getConfiguration());
    assertTrue(testDir.depth() > 1);
    logDir = new Path(testDir, "proc-logs");
    procEnv = new TestProcEnv();
    procStore = ProcedureTestingUtility.createStore(htu.getConfiguration(), logDir);
    procExecutor = new ProcedureExecutor<>(htu.getConfiguration(), procEnv, procStore);
    procExecutor.testing = new ProcedureExecutor.Testing();
    procStore.start(PROCEDURE_EXECUTOR_SLOTS);
    ProcedureTestingUtility.initAndStartWorkers(procExecutor, PROCEDURE_EXECUTOR_SLOTS, true);
    procSleepInterval = 0;
}
Also used : Path(org.apache.hadoop.fs.Path) HBaseCommonTestingUtil(org.apache.hadoop.hbase.HBaseCommonTestingUtil) Before(org.junit.Before)

Aggregations

HBaseCommonTestingUtil (org.apache.hadoop.hbase.HBaseCommonTestingUtil)26 Before (org.junit.Before)20 Path (org.apache.hadoop.fs.Path)15 Configuration (org.apache.hadoop.conf.Configuration)7 BeforeClass (org.junit.BeforeClass)6 File (java.io.File)4 LoadCounter (org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility.LoadCounter)4 NoopProcedureStore (org.apache.hadoop.hbase.procedure2.store.NoopProcedureStore)3 URI (java.net.URI)1 URL (java.net.URL)1 Duration (java.time.Duration)1 Arrays (java.util.Arrays)1 Collections.singletonList (java.util.Collections.singletonList)1 ExecutorService (java.util.concurrent.ExecutorService)1 Executors (java.util.concurrent.Executors)1 ThreadFactory (java.util.concurrent.ThreadFactory)1 TimeUnit (java.util.concurrent.TimeUnit)1 AtomicReference (java.util.concurrent.atomic.AtomicReference)1 Supplier (java.util.function.Supplier)1 FileSystem (org.apache.hadoop.fs.FileSystem)1