Search in sources :

Example 1 with CompactorThread

use of org.apache.hadoop.hive.ql.txn.compactor.CompactorThread in project hive by apache.

the class TxnCommandsBaseForTests method runCompactorThread.

private static void runCompactorThread(HiveConf hiveConf, CompactorThreadType type) throws Exception {
    AtomicBoolean stop = new AtomicBoolean(true);
    CompactorThread t;
    switch(type) {
        case INITIATOR:
            t = new Initiator();
            break;
        case WORKER:
            t = new Worker();
            break;
        case CLEANER:
            t = new Cleaner();
            break;
        default:
            throw new IllegalArgumentException("Unknown type: " + type);
    }
    t.setThreadId((int) t.getId());
    t.setConf(hiveConf);
    t.init(stop);
    t.run();
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Initiator(org.apache.hadoop.hive.ql.txn.compactor.Initiator) CompactorThread(org.apache.hadoop.hive.ql.txn.compactor.CompactorThread) Worker(org.apache.hadoop.hive.ql.txn.compactor.Worker) Cleaner(org.apache.hadoop.hive.ql.txn.compactor.Cleaner)

Aggregations

AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 Cleaner (org.apache.hadoop.hive.ql.txn.compactor.Cleaner)1 CompactorThread (org.apache.hadoop.hive.ql.txn.compactor.CompactorThread)1 Initiator (org.apache.hadoop.hive.ql.txn.compactor.Initiator)1 Worker (org.apache.hadoop.hive.ql.txn.compactor.Worker)1