public Object getFieldValue(_Fields field) { switch (field) { case TXN_HIGH_WATER_MARK: return getTxn_high_water_mark(); case OPEN_TXNS: return getOpen_txns(); case MIN_OPEN_TXN: return getMin_open_txn(); case ABORTED_BITS: return getAbortedBits(); } throw new IllegalStateException(); }
public static ValidTxnList createValidTxnListForCleaner(GetOpenTxnsResponse txns, long minOpenTxnGLB) { long highWaterMark = minOpenTxnGLB - 1; long[] abortedTxns = new long[txns.getOpen_txnsSize()]; BitSet abortedBits = BitSet.valueOf(txns.getAbortedBits()); int i = 0; for(long txnId : txns.getOpen_txns()) { if(txnId > highWaterMark) { break; } if(abortedBits.get(i)) { abortedTxns[i] = txnId; } else { assert false : JavaUtils.txnIdToString(txnId) + " is open and <= hwm:" + highWaterMark; } ++i; } abortedTxns = Arrays.copyOf(abortedTxns, i); BitSet bitSet = new BitSet(abortedTxns.length); bitSet.set(0, abortedTxns.length); //add ValidCleanerTxnList? - could be problematic for all the places that read it from // string as they'd have to know which object to instantiate return new ValidReadTxnList(abortedTxns, bitSet, highWaterMark, Long.MAX_VALUE); } /**
sizeToHwm = (sizeToHwm < 0) ? (-sizeToHwm) : sizeToHwm; long[] exceptions = new long[sizeToHwm]; BitSet inAbortedBits = BitSet.valueOf(txns.getAbortedBits()); BitSet outAbortedBits = new BitSet(); long minOpenTxnId = Long.MAX_VALUE;
Assert.assertEquals(openResp.toString(), 1, openResp.getOpen_txnsSize()); Assert.assertTrue(openResp.toString(), BitSet.valueOf(openResp.getAbortedBits()).get(0)); Assert.assertEquals(openResp.toString(), 1, openResp.getOpen_txnsSize()); Assert.assertTrue(openResp.toString(), BitSet.valueOf(openResp.getAbortedBits()).get(0)); Assert.assertEquals(1, TxnDbUtil.countQueryAgent(hiveConf, "select count(*) from TXN_COMPONENTS"));
public Object getFieldValue(_Fields field) { switch (field) { case TXN_HIGH_WATER_MARK: return getTxn_high_water_mark(); case OPEN_TXNS: return getOpen_txns(); case MIN_OPEN_TXN: return getMin_open_txn(); case ABORTED_BITS: return getAbortedBits(); } throw new IllegalStateException(); }
sizeToHwm = (sizeToHwm < 0) ? (-sizeToHwm) : sizeToHwm; long[] exceptions = new long[sizeToHwm]; BitSet inAbortedBits = BitSet.valueOf(txns.getAbortedBits()); BitSet outAbortedBits = new BitSet(); long minOpenTxnId = Long.MAX_VALUE;