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 2019/10/29 19:57:31 UTC
[GitHub] [fluo] keith-turner commented on a change in pull request #1080:
Parallelize TransactionImpl.readUnread()
keith-turner commented on a change in pull request #1080: Parallelize TransactionImpl.readUnread()
URL: https://github.com/apache/fluo/pull/1080#discussion_r340287147
##########
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:
Now nothing ever passes anything for locksSeen to the existing getImpl method, so that parameter could be removed. Also could remove it from SnapshotScanner
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services