[ https://issues.apache.org/jira/browse/OMID-84?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16355268#comment-16355268 ]
ASF GitHub Bot commented on OMID-84: ------------------------------------ Github user ohadshacham commented on a diff in the pull request: https://github.com/apache/incubator-omid/pull/19#discussion_r166572983 --- Diff: hbase-client/src/main/java/org/apache/omid/transaction/HBaseTransaction.java --- @@ -31,25 +31,31 @@ public class HBaseTransaction extends AbstractTransaction<HBaseCellId> { private static final Logger LOG = LoggerFactory.getLogger(HBaseTransaction.class); - public HBaseTransaction(long transactionId, long epoch, Set<HBaseCellId> writeSet, AbstractTransactionManager tm) { - super(transactionId, epoch, writeSet, tm); + public HBaseTransaction(long transactionId, long epoch, Set<HBaseCellId> writeSet, Set<HBaseCellId> conflictFreeWriteSet, AbstractTransactionManager tm) { + super(transactionId, epoch, writeSet, conflictFreeWriteSet, tm); } - public HBaseTransaction(long transactionId, long readTimestamp, VisibilityLevel visibilityLevel, long epoch, Set<HBaseCellId> writeSet, AbstractTransactionManager tm) { - super(transactionId, readTimestamp, visibilityLevel, epoch, writeSet, tm); + public HBaseTransaction(long transactionId, long readTimestamp, VisibilityLevel visibilityLevel, long epoch, Set<HBaseCellId> writeSet, Set<HBaseCellId> conflictFreeWriteSet, AbstractTransactionManager tm) { + super(transactionId, readTimestamp, visibilityLevel, epoch, writeSet, conflictFreeWriteSet, tm); } + private void cleanCell(HBaseCellId cell) { + Delete delete = new Delete(cell.getRow()); + delete.deleteColumn(cell.getFamily(), cell.getQualifier(), cell.getTimestamp()); + try { + cell.getTable().delete(delete); + } catch (IOException e) { + LOG.warn("Failed cleanup cell {} for Tx {}. This issue has been ignored", cell, getTransactionId(), e); + } + } @Override public void cleanup() { - Set<HBaseCellId> writeSet = getWriteSet(); - for (final HBaseCellId cell : writeSet) { - Delete delete = new Delete(cell.getRow()); - delete.deleteColumn(cell.getFamily(), cell.getQualifier(), cell.getTimestamp()); - try { - cell.getTable().delete(delete); - } catch (IOException e) { - LOG.warn("Failed cleanup cell {} for Tx {}. This issue has been ignored", cell, getTransactionId(), e); - } + for (final HBaseCellId cell : getWriteSet()) { + cleanCell(cell); + } + + for (final HBaseCellId cell : getConflictFreeWriteSet()) { --- End diff -- Yes, deleting is actually adding a tombstone and after a rollback these tombstones should be discarded. Naturally, these mutation are candidates for conflict analysis unless someone asks differently. > Conflict free writes > -------------------- > > Key: OMID-84 > URL: https://issues.apache.org/jira/browse/OMID-84 > Project: Apache Omid > Issue Type: Sub-task > Reporter: Ohad Shacham > Assignee: Ohad Shacham > Priority: Major > > Today, all the writes done by a transaction are taking part in conflict > analysis. The purpose of this feature is to let the user decide for each > write, whether it should take part in the conflict analysis. > The motivation infers from Apache Phoenix that utilizes this feature when > writing to the secondary index and also when writing to the data table for > immutable tables (each key is added once and is not modified). -- This message was sent by Atlassian JIRA (v7.6.3#76005)