public static void initializeAndStartThread(CompactorThread thread, Configuration conf) throws Exception { LOG.info("Starting compactor thread of type " + thread.getClass().getName()); thread.setConf(conf); thread.setThreadId(nextThreadId.incrementAndGet()); thread.init(new AtomicBoolean(), new AtomicBoolean()); thread.start(); } }
public void init(AtomicBoolean stop, AtomicBoolean looped) throws Exception { setPriority(MIN_PRIORITY); setDaemon(true); // this means the process will exit without waiting for this thread this.stop = stop; this.looped = looped; }
private void startThread(char type, boolean stopAfterOne, AtomicBoolean looped) throws Exception { TxnDbUtil.setConfValues(conf); CompactorThread t = null; switch (type) { case 'i': t = new Initiator(); break; case 'w': t = new Worker(); break; case 'c': t = new Cleaner(); break; default: throw new RuntimeException("Huh? Unknown thread type."); } t.setThreadId((int) t.getId()); t.setConf(conf); stop.set(stopAfterOne); t.init(stop, looped); if (stopAfterOne) t.run(); else t.start(); }
public void init(AtomicBoolean stop, AtomicBoolean looped) throws Exception { super.init(stop, looped); this.msc = HiveMetaStoreUtils.getHiveMetastoreClient(conf); }
private static void runCompactorThread(HiveConf hiveConf, CompactorThreadType type) throws Exception { AtomicBoolean stop = new AtomicBoolean(true); CompactorThread t = null; 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); AtomicBoolean looped = new AtomicBoolean(); t.init(stop, looped); t.run(); }
@Override public void init(AtomicBoolean stop, AtomicBoolean looped) throws MetaException { super.init(stop, looped); checkInterval = conf.getTimeVar(HiveConf.ConfVars.HIVE_COMPACTOR_CHECK_INTERVAL, TimeUnit.MILLISECONDS) ; }
@Override public void init(AtomicBoolean stop, AtomicBoolean looped) throws MetaException { this.stop = stop; this.looped = looped; setPriority(MIN_PRIORITY); setDaemon(true); // this means the process will exit without waiting for this thread // Get our own instance of the transaction handler txnHandler = TxnUtils.getTxnStore(conf); // Get our own connection to the database so we can get table and partition information. rs = RawStoreProxy.getProxy(conf, conf, conf.getVar(HiveConf.ConfVars.METASTORE_RAW_STORE_IMPL), threadId); }
@Override public void init(AtomicBoolean stop, AtomicBoolean looped) throws MetaException { super.init(stop, looped); StringBuilder name = new StringBuilder(hostname()); name.append("-"); name.append(getId()); this.name = name.toString(); setName(name.toString()); }
@Override public void init(AtomicBoolean stop, AtomicBoolean looped) throws MetaException { this.stop = stop; this.looped = looped; setPriority(MIN_PRIORITY); setDaemon(true); // this means the process will exit without waiting for this thread // Get our own instance of the transaction handler txnHandler = new CompactionTxnHandler(conf); // Get our own connection to the database so we can get table and partition information. rs = RawStoreProxy.getProxy(conf, conf, conf.getVar(HiveConf.ConfVars.METASTORE_RAW_STORE_IMPL), threadId); }
@Override public void init(AtomicBoolean stop, AtomicBoolean looped) throws Exception { super.init(stop, looped); // Get our own instance of the transaction handler txnHandler = TxnUtils.getTxnStore(conf); // Get our own connection to the database so we can get table and partition information. rs = RawStoreProxy.getProxy(conf, conf, MetastoreConf.getVar(conf, MetastoreConf.ConfVars.RAW_STORE_IMPL), threadId); }
@Override public void init(AtomicBoolean stop, AtomicBoolean looped) throws MetaException { super.init(stop, looped); checkInterval = conf.getTimeVar(HiveConf.ConfVars.HIVE_COMPACTOR_CHECK_INTERVAL, TimeUnit.MILLISECONDS) ; }
@Override public void init(AtomicBoolean stop, AtomicBoolean looped) throws MetaException { super.init(stop, looped); StringBuilder name = new StringBuilder(hostname()); name.append("-"); name.append(getId()); this.name = name.toString(); setName(name.toString()); }