jkosh44 commented on a change in pull request #1080: Parallelize 
TransactionImpl.readUnread()
URL: https://github.com/apache/fluo/pull/1080#discussion_r340386156
 
 

 ##########
 File path: 
modules/core/src/main/java/org/apache/fluo/core/impl/TransactionImpl.java
 ##########
 @@ -554,32 +558,32 @@ public boolean preCommit(CommitData cd, RowColumn 
primary) {
    *
    * @param cd Commit data
    */
-  private void readUnread(CommitData cd, Consumer<Entry<Key, Value>> 
locksSeen) {
-    // TODO make async
+  private void readUnread(CommitData cd) {
     // TODO need to keep track of ranges read (not ranges passed in, but 
actual data read... user
     // may not iterate over entire range
-    Map<Bytes, Set<Column>> columnsToRead = new HashMap<>();
+    Collection<RowColumn> rowColumnsToRead = new ArrayList<>();
 
     for (Entry<Bytes, Set<Column>> entry : cd.getRejected().entrySet()) {
       Set<Column> rowColsRead = columnsRead.get(entry.getKey());
       if (rowColsRead == null) {
-        columnsToRead.put(entry.getKey(), entry.getValue());
+        for (Column column : entry.getValue()) {
+          rowColumnsToRead.add(new RowColumn(entry.getKey(), column));
+        }
       } else {
         HashSet<Column> colsToRead = new HashSet<>(entry.getValue());
         colsToRead.removeAll(rowColsRead);
         if (!colsToRead.isEmpty()) {
-          columnsToRead.put(entry.getKey(), colsToRead);
+          for (Column column : colsToRead) {
+            rowColumnsToRead.add(new RowColumn(entry.getKey(), column));
+          }
         }
       }
     }
 
-    for (Entry<Bytes, Set<Column>> entry : columnsToRead.entrySet()) {
-      getImpl(entry.getKey(), entry.getValue(), locksSeen);
 
 Review comment:
   Updated

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


With regards,
Apache Git Services

Reply via email to