You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@fluo.apache.org by GitBox <gi...@apache.org> on 2017/10/30 21:21:21 UTC

[GitHub] keith-turner commented on issue #527: Add set if non-existant operation

keith-turner commented on issue #527: Add set if non-existant operation
URL: https://github.com/apache/fluo/issues/527#issuecomment-340588227
 
 
   This is a very rough outline of what I think needs to be done for this feature.
   
    * Add `setIfAbsent(Bytes row, Column col, Value val)` method to TransactionBase interface.
    * Implement `setIfAbsent(Bytes row, Column col, Value val)` in TransactionImpl.  This method should call `set(Bytes row, Column col, Value val)` and remember the row+col in special map that tracks row+cols that expected to be absent.  
    * In the [prewrite phase](https://github.com/apache/fluo/blob/rel/fluo-1.1.0-incubating/modules/core/src/main/java/org/apache/fluo/core/impl/TransactionImpl.java#L340) of `commit()` when a transaction sets its locks, I think a condition can be added to the conditional mutation used for locks.  This condition could configure the snapshot iterator and expect the result to be empty.
   
   Some background on conditional mutations :  http://rleary.com/blog/accumulo-conditional-mutations/
   
   Need to determine the correct behavior for the case when a transactions calls `set()` and then `setIfAbsent()` (or visa-versa) for the same row+col.  Currently if `set()` is called twice for the same row+col an exception is thrown.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services