[GitHub] incubator-omid pull request #13: [OMID-74] Efficient column family deletion ...

2017-08-02 Thread ohadshacham
Github user ohadshacham commented on a diff in the pull request:

https://github.com/apache/incubator-omid/pull/13#discussion_r130809257
  
--- Diff: 
hbase-client/src/main/java/org/apache/omid/transaction/TTable.java ---
@@ -396,20 +443,48 @@ public ResultScanner getScanner(Transaction tx, Scan 
scan) throws IOException {
 return commitCache;
 }
 
-private boolean isCellInSnapshot(Cell kv, HBaseTransaction 
transaction, Map commitCache)
-throws IOException {
+private void buildFamilyDeletionCache(List rawCells, Map familyDeletionCache) {
 
-long startTimestamp = transaction.getStartTimestamp();
+for (Cell cell : rawCells) {
+if (CellUtil.matchingQualifier(cell, 
CellUtils.FAMILY_DELETE_QUALIFIER) &&
+CellUtil.matchingValue(cell, 
HConstants.EMPTY_BYTE_ARRAY)) {
+
+String row = Bytes.toString(cell.getRow());
+List cells = familyDeletionCache.get(row);
--- End diff --

This is Map's return value.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-omid pull request #13: [OMID-74] Efficient column family deletion ...

2017-08-02 Thread ohadshacham
Github user ohadshacham commented on a diff in the pull request:

https://github.com/apache/incubator-omid/pull/13#discussion_r130805885
  
--- Diff: 
hbase-client/src/main/java/org/apache/omid/transaction/TTable.java ---
@@ -228,21 +261,12 @@ public void delete(Transaction tx, Delete delete) 
throws IOException {
 }
 }
 }
-if (issueGet) {
-// It's better to perform a transactional get to avoid 
deleting more
-// than necessary
-Result result = this.get(transaction, deleteG);
-if (!result.isEmpty()) {
-for (Entry>> entryF : result.getMap()
-.entrySet()) {
-byte[] family = entryF.getKey();
-for (Entry> entryQ 
: entryF.getValue().entrySet()) {
-byte[] qualifier = entryQ.getKey();
-deleteP.add(family, qualifier, 
CellUtils.DELETE_TOMBSTONE);
-transaction.addWriteSetElement(new 
HBaseCellId(table, delete.getRow(), family, qualifier,
-   
transaction.getStartTimestamp()));
-}
-}
+
+if (deleteFamily) {
--- End diff --

1. This is a deletion path without read requirement. It is doable only in 
row level conflict detection mode where we only need to mark the row as a 
player for conflict analysis. 
2. TTable works only for HBase. You can see that each one of the method 
starts with a check that the transaction is hbase transaction. IMHO TTable 
should inherit from HTableInterface and override its functions, but this is for 
 a different patch :).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (OMID-74) Efficient column family deletion in Row level conflict analysis

2017-08-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/OMID-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16110493#comment-16110493
 ] 

ASF GitHub Bot commented on OMID-74:


Github user ohadshacham commented on a diff in the pull request:

https://github.com/apache/incubator-omid/pull/13#discussion_r130809257
  
--- Diff: 
hbase-client/src/main/java/org/apache/omid/transaction/TTable.java ---
@@ -396,20 +443,48 @@ public ResultScanner getScanner(Transaction tx, Scan 
scan) throws IOException {
 return commitCache;
 }
 
-private boolean isCellInSnapshot(Cell kv, HBaseTransaction 
transaction, Map commitCache)
-throws IOException {
+private void buildFamilyDeletionCache(List rawCells, Map familyDeletionCache) {
 
-long startTimestamp = transaction.getStartTimestamp();
+for (Cell cell : rawCells) {
+if (CellUtil.matchingQualifier(cell, 
CellUtils.FAMILY_DELETE_QUALIFIER) &&
+CellUtil.matchingValue(cell, 
HConstants.EMPTY_BYTE_ARRAY)) {
+
+String row = Bytes.toString(cell.getRow());
+List cells = familyDeletionCache.get(row);
--- End diff --

This is Map's return value.


> Efficient column family deletion in Row level conflict analysis
> ---
>
> Key: OMID-74
> URL: https://issues.apache.org/jira/browse/OMID-74
> Project: Apache Omid
>  Issue Type: New Feature
>Reporter: Ohad Shacham
>
> The idea is to use a qualifier to denote that all the columns of a specific 
> family were deleted. 
> Current implementation reads from HBase the entire family and then writes a 
> tombstone to each one of its cells. The new implementation does not need to 
> perform the read and only writes the qualifier to denote that the family was 
> deleted. This is true only for Row level conflict detection since in Cell 
> level we need to read the cells and add these to the write set.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (OMID-74) Efficient column family deletion in Row level conflict analysis

2017-08-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/OMID-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16110475#comment-16110475
 ] 

ASF GitHub Bot commented on OMID-74:


Github user ohadshacham commented on a diff in the pull request:

https://github.com/apache/incubator-omid/pull/13#discussion_r130805885
  
--- Diff: 
hbase-client/src/main/java/org/apache/omid/transaction/TTable.java ---
@@ -228,21 +261,12 @@ public void delete(Transaction tx, Delete delete) 
throws IOException {
 }
 }
 }
-if (issueGet) {
-// It's better to perform a transactional get to avoid 
deleting more
-// than necessary
-Result result = this.get(transaction, deleteG);
-if (!result.isEmpty()) {
-for (Entry>> entryF : result.getMap()
-.entrySet()) {
-byte[] family = entryF.getKey();
-for (Entry> entryQ 
: entryF.getValue().entrySet()) {
-byte[] qualifier = entryQ.getKey();
-deleteP.add(family, qualifier, 
CellUtils.DELETE_TOMBSTONE);
-transaction.addWriteSetElement(new 
HBaseCellId(table, delete.getRow(), family, qualifier,
-   
transaction.getStartTimestamp()));
-}
-}
+
+if (deleteFamily) {
--- End diff --

1. This is a deletion path without read requirement. It is doable only in 
row level conflict detection mode where we only need to mark the row as a 
player for conflict analysis. 
2. TTable works only for HBase. You can see that each one of the method 
starts with a check that the transaction is hbase transaction. IMHO TTable 
should inherit from HTableInterface and override its functions, but this is for 
 a different patch :).


> Efficient column family deletion in Row level conflict analysis
> ---
>
> Key: OMID-74
> URL: https://issues.apache.org/jira/browse/OMID-74
> Project: Apache Omid
>  Issue Type: New Feature
>Reporter: Ohad Shacham
>
> The idea is to use a qualifier to denote that all the columns of a specific 
> family were deleted. 
> Current implementation reads from HBase the entire family and then writes a 
> tombstone to each one of its cells. The new implementation does not need to 
> perform the read and only writes the qualifier to denote that the family was 
> deleted. This is true only for Row level conflict detection since in Cell 
> level we need to read the cells and add these to the write set.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)