@Override public void setConf(Configuration configuration) { conf = configuration; txnHandler = TxnUtils.getTxnStore(conf); }
@Override public void setConf(Configuration configuration) { conf = configuration; txnHandler = TxnUtils.getTxnStore(conf); }
@Override public void setConf(Configuration configuration) { this.conf = configuration; txnHandler = TxnUtils.getTxnStore(conf); }
@Override public void setConf(Configuration configuration) { this.conf = configuration; txnHandler = TxnUtils.getTxnStore(conf); }
@Override public void setConf(Configuration configuration) { this.conf = configuration; txnHandler = TxnUtils.getTxnStore(conf); }
private OpenTxnsCounter(HiveConf hiveConf, AtomicInteger isAliveCounter) { txnHandler = TxnUtils.getTxnStore(hiveConf); this.isAliveCounter = isAliveCounter; } @Override
private TimedoutTxnReaper(HiveConf hiveConf, AtomicInteger isAliveCounter) { txnHandler = TxnUtils.getTxnStore(hiveConf); this.isAliveCounter = isAliveCounter; } @Override
private WriteSetReaper(HiveConf hiveConf, AtomicInteger isAliveCounter) { txnHandler = TxnUtils.getTxnStore(hiveConf); this.isAliveCounter = isAliveCounter; } @Override
private ObsoleteEntryReaper(HiveConf hiveConf, AtomicInteger isAliveCounter) { txnHandler = TxnUtils.getTxnStore(hiveConf); this.isAliveCounter = isAliveCounter; }
public static TxnStore getMsThreadTxnHandler(Configuration conf) { TxnStore txn = threadLocalTxn.get(); if (txn == null) { txn = TxnUtils.getTxnStore(conf); threadLocalTxn.set(txn); } return txn; }
@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 { 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); }
@Before public void setUp() throws Exception { TxnDbUtil.prepDb(conf); txnHandler = TxnUtils.getTxnStore(conf); }
@Before public void setUp() throws Exception { TxnDbUtil.prepDb(conf); txnHandler = TxnUtils.getTxnStore(conf); }
@Before public void setup() throws Exception { conf = new HiveConf(); TxnDbUtil.setConfValues(conf); TxnDbUtil.cleanDb(conf); ms = new HiveMetaStoreClient(conf); txnHandler = TxnUtils.getTxnStore(conf); tmpdir = new File(Files.createTempDirectory("compactor_test_table_").toString()); }
private TxnStore getTxnHandler() { boolean hackOn = MetastoreConf.getBoolVar(conf, ConfVars.HIVE_IN_TEST) || MetastoreConf.getBoolVar(conf, ConfVars.HIVE_IN_TEZ_TEST); String origTxnMgr = null; boolean origConcurrency = false; // Since TxnUtils.getTxnStore calls TxnHandler.setConf -> checkQFileTestHack -> TxnDbUtil.setConfValues, // which may change the values of below two entries, we need to avoid polluting the original values if (hackOn) { origTxnMgr = MetastoreConf.getVar(conf, ConfVars.HIVE_TXN_MANAGER); origConcurrency = MetastoreConf.getBoolVar(conf, ConfVars.HIVE_SUPPORT_CONCURRENCY); } txnHandler = TxnUtils.getTxnStore(conf); // Set them back if (hackOn) { MetastoreConf.setVar(conf, ConfVars.HIVE_TXN_MANAGER, origTxnMgr); MetastoreConf.setBoolVar(conf, ConfVars.HIVE_SUPPORT_CONCURRENCY, origConcurrency); } return txnHandler; } }
@Before public void setUp() throws Exception { conf.setVar(HiveConf.ConfVars.METASTORE_CONNECTION_POOLING_TYPE, "None"); TxnDbUtil.setConfValues(conf); try { TxnDbUtil.prepDb(conf); } catch (SQLException e) { // Usually this means we've already created the tables, so clean them and then try again tearDown(); TxnDbUtil.prepDb(conf); } txnHandler = TxnUtils.getTxnStore(conf); }
/** * https://issues.apache.org/jira/browse/HIVE-17391 */ @Test public void testEmptyInTblproperties() throws Exception { runStatementOnDriver("create table t1 " + "(a int, b int) stored as orc TBLPROPERTIES ('serialization.null.format'='', 'transactional'='true')"); runStatementOnDriver("insert into t1 " + "(a,b) values(1,7),(3,7)"); runStatementOnDriver("update t1" + " set b = -2 where b = 2"); runStatementOnDriver("alter table t1 " + " compact 'MAJOR'"); runWorker(hiveConf); TxnStore txnHandler = TxnUtils.getTxnStore(hiveConf); ShowCompactResponse resp = txnHandler.showCompact(new ShowCompactRequest()); Assert.assertEquals("Unexpected number of compactions in history", 1, resp.getCompactsSize()); Assert.assertEquals("Unexpected 0 compaction state", TxnStore.CLEANING_RESPONSE, resp.getCompacts().get(0).getState()); Assert.assertTrue(resp.getCompacts().get(0).getHadoopJobId().startsWith("job_local")); }
@Test public void testCompactWithDelete() throws Exception { int[][] tableData = {{1,2},{3,4}}; runStatementOnDriver("insert into " + Table.ACIDTBL + "(a,b) " + makeValuesClause(tableData)); runStatementOnDriver("alter table "+ Table.ACIDTBL + " compact 'MAJOR'"); runWorker(hiveConf); runStatementOnDriver("delete from " + Table.ACIDTBL + " where b = 4"); runStatementOnDriver("update " + Table.ACIDTBL + " set b = -2 where b = 2"); runStatementOnDriver("alter table "+ Table.ACIDTBL + " compact 'MINOR'"); runWorker(hiveConf); TxnStore txnHandler = TxnUtils.getTxnStore(hiveConf); ShowCompactResponse resp = txnHandler.showCompact(new ShowCompactRequest()); Assert.assertEquals("Unexpected number of compactions in history", 2, resp.getCompactsSize()); Assert.assertEquals("Unexpected 0 compaction state", TxnStore.CLEANING_RESPONSE, resp.getCompacts().get(0).getState()); Assert.assertEquals("Unexpected 1 compaction state", TxnStore.CLEANING_RESPONSE, resp.getCompacts().get(1).getState()); }
@Before public void setUp() throws Exception { SessionState.start(conf); ctx = new Context(conf); driver = new Driver(new QueryState.Builder().withHiveConf(conf).nonIsolated().build(), null); driver2 = new Driver(new QueryState.Builder().withHiveConf(conf).build(), null); TxnDbUtil.cleanDb(conf); TxnDbUtil.prepDb(conf); SessionState ss = SessionState.get(); ss.initTxnMgr(conf); txnMgr = ss.getTxnMgr(); Assert.assertTrue(txnMgr instanceof DbTxnManager); txnHandler = TxnUtils.getTxnStore(conf); } @After