You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The percolator paper mentioned that read locks were not implemented because they were usually uneeded and expensive. I agree with this, in most situations you do want to read data without a read lock. However I do find that sometimes I would like a read lock. For example consider a use case with graph type data. An edge is added to Fluo and joined with information from the two nodes it connects. I want multiple edge operations to be able to proceed concurrently, as long as the node information does not change. Conceptually, I would like an edge operation to get a read lock on the two nodes its interacting with. If multiple edge operations concurrently get a read lock on the same node, none of them will collide. However a node operation that got a write lock on the node would cause collisions.
From an API perspective, one possible way to implement this is adding the following :
publicinterfaceTransactionBase {
//return snapshot where reads acquire a read lockSnapshotBasewithReadLock();
}
This would enable writing code like the following :
try(Transactiontx = fluoClient.newTransaction()) {
//read w/o read lockBytesval1 = tx.get(row1, col1);
//read data with read lockBytesval2 = tx.withReadLock().get(row2, col2);
.
.
.
tx.commit(); //will collide if row2+col2 was written OR may cause a concurrent write to row2+col2 to fail
}
The text was updated successfully, but these errors were encountered:
The percolator paper mentioned that read locks were not implemented because they were usually uneeded and expensive. I agree with this, in most situations you do want to read data without a read lock. However I do find that sometimes I would like a read lock. For example consider a use case with graph type data. An edge is added to Fluo and joined with information from the two nodes it connects. I want multiple edge operations to be able to proceed concurrently, as long as the node information does not change. Conceptually, I would like an edge operation to get a read lock on the two nodes its interacting with. If multiple edge operations concurrently get a read lock on the same node, none of them will collide. However a node operation that got a write lock on the node would cause collisions.
From an API perspective, one possible way to implement this is adding the following :
This would enable writing code like the following :
The text was updated successfully, but these errors were encountered: