[GitHub] incubator-omid pull request #20: [OMID-85] Writing directly to HBase using s...

2018-02-06 Thread ebortnikov
Github user ebortnikov commented on a diff in the pull request:

https://github.com/apache/incubator-omid/pull/20#discussion_r166407100
  
--- Diff: 
hbase-client/src/main/java/org/apache/omid/transaction/TTable.java ---
@@ -293,15 +293,11 @@ public void delete(Transaction tx, Delete delete) 
throws IOException {
 
 }
 
-/**
- * Transactional version of {@link HTableInterface#put(Put put)}
- *
- * @param put an instance of Put
- * @param tx  an instance of transaction to be used
- * @throws IOException if a remote or network exception occurs.
- */
-public void put(Transaction tx, Put put) throws IOException {
+interface UpdateMetaData {
--- End diff --

What is the scope of this interface? Why is it package-level? 


---


[GitHub] incubator-omid pull request #20: [OMID-85] Writing directly to HBase using s...

2018-02-06 Thread ebortnikov
Github user ebortnikov commented on a diff in the pull request:

https://github.com/apache/incubator-omid/pull/20#discussion_r166408476
  
--- Diff: 
hbase-client/src/main/java/org/apache/omid/transaction/TTable.java ---
@@ -321,16 +317,51 @@ public void put(Transaction tx, Put put) throws 
IOException {
 Bytes.putLong(kv.getValueArray(), kv.getTimestampOffset(), 
writeTimestamp);
 tsput.add(kv);
 
-transaction.addWriteSetElement(
+updateMetaData.update(transaction, kv, tsput);
+}
+}
+
+table.put(tsput);
+}
+
+/**
+ * putWithAutocommit implementation. Similar to a transactional put 
that includes the commit time stamp.
+ *
+ * @param put an instance of Put
+ * @param tx  an instance of transaction to be used
+ * @throws IOException if a remote or network exception occurs.
+ */
+public void putWithAutocommit(Transaction tx, Put put) throws 
IOException {
--- End diff --

Not sure it's a good idea to have a separate method for this. Is it painful 
to add a parameter? Alternatively, maybe you could pass an attribute to 
propagate (mechanism defined in OMID-83)? 


---


[GitHub] incubator-omid pull request #19: [OMID-84] Today, all the writes done by a t...

2018-02-06 Thread ebortnikov
Github user ebortnikov commented on a diff in the pull request:

https://github.com/apache/incubator-omid/pull/19#discussion_r166405079
  
--- Diff: 
hbase-client/src/main/java/org/apache/omid/transaction/HBaseTransaction.java ---
@@ -31,25 +31,31 @@
 public class HBaseTransaction extends AbstractTransaction {
 private static final Logger LOG = 
LoggerFactory.getLogger(HBaseTransaction.class);
 
-public HBaseTransaction(long transactionId, long epoch, 
Set writeSet, AbstractTransactionManager tm) {
-super(transactionId, epoch, writeSet, tm);
+public HBaseTransaction(long transactionId, long epoch, 
Set writeSet, Set conflictFreeWriteSet, 
AbstractTransactionManager tm) {
+super(transactionId, epoch, writeSet, conflictFreeWriteSet, tm);
 }
 
-public HBaseTransaction(long transactionId, long readTimestamp, 
VisibilityLevel visibilityLevel, long epoch, Set writeSet, 
AbstractTransactionManager tm) {
-super(transactionId, readTimestamp, visibilityLevel, epoch, 
writeSet, tm);
+public HBaseTransaction(long transactionId, long readTimestamp, 
VisibilityLevel visibilityLevel, long epoch, Set writeSet, 
Set conflictFreeWriteSet, AbstractTransactionManager tm) {
+super(transactionId, readTimestamp, visibilityLevel, epoch, 
writeSet, conflictFreeWriteSet, tm);
 }
 
+private void cleanCell(HBaseCellId cell) {
--- End diff --

cleanCell --> deleteCell? 


---


[GitHub] incubator-omid pull request #17: [OMID-83] Attributes added to Put, Get, and...

2018-02-06 Thread ebortnikov
Github user ebortnikov commented on a diff in the pull request:

https://github.com/apache/incubator-omid/pull/17#discussion_r166402848
  
--- Diff: 
hbase-client/src/main/java/org/apache/omid/transaction/TTable.java ---
@@ -186,6 +187,14 @@ public Result get(Transaction tx, final Get get) 
throws IOException {
 return snapshotFilter.get(this, tsget, transaction);
 }
 
+private void updateAttributes(OperationWithAttributes from, 
OperationWithAttributes to) {
--- End diff --

makes sense to call propagateAttributes()? 


---