[ 
https://issues.apache.org/jira/browse/HIVE-16534?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15989239#comment-15989239
 ] 

Wei Zheng commented on HIVE-16534:
----------------------------------

The sorting of exceptions in ValidReadTxnList is troublesome for the 
accompanying BitSet, as we have to sort the BitSet in the same manner. So I 
removed the sorting logic in the ctor and added "oder by txn_id" to 
TxnHandler.getOpenTxns so we don't need to worry about sorting later on.

It's true that we always have 3 ':'. But if some fields are missing, e.g. 
"1:2::", then String.split() will only return an array of size 2.

I do serialize the BitSet into a byte array before sending it over Thrift 
interface. After receiving it I convert it back to BitSet since the bit 
manipulation is convenient.

I need to binary search in isTxnAborted() to get the index for the txnid, then 
look up in the bitset using that index.

bitSet.set(0, bitSet.length()) does turn all the bits on, right?

> Add capability to tell aborted transactions apart from open transactions in 
> ValidTxnList
> ----------------------------------------------------------------------------------------
>
>                 Key: HIVE-16534
>                 URL: https://issues.apache.org/jira/browse/HIVE-16534
>             Project: Hive
>          Issue Type: Bug
>          Components: Transactions
>            Reporter: Wei Zheng
>            Assignee: Wei Zheng
>         Attachments: HIVE-16534.1.patch, HIVE-16534.2.patch
>
>
> Currently in ValidReadTxnList, open transactions and aborted transactions are 
> stored together in one array. That makes it impossible to extract just 
> aborted transactions or open transactions.
> For ValidCompactorTxnList this is fine, since we only store aborted 
> transactions but no open transactions.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to