jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject [23/44] jena git commit: Better concurrency behavior
Date Sat, 06 Jan 2018 15:17:47 GMT
Better concurrency behavior


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/2274264a
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/2274264a
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/2274264a

Branch: refs/heads/master
Commit: 2274264a21a8ce08438285c5cdd5378172fa7de7
Parents: 0fcd9b4
Author: ajs6f <ajs6f@apache.org>
Authored: Sun Dec 31 20:49:03 2017 -0500
Committer: ajs6f <ajs6f@apache.org>
Committed: Fri Jan 5 09:32:55 2018 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/jena/query/util/DatasetCollector.java  | 5 ++---
 .../org/apache/jena/sparql/util/IntersectionDatasetGraph.java   | 5 +----
 .../src/main/java/org/apache/jena/util/ModelCollector.java      | 2 +-
 3 files changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/2274264a/jena-arq/src/main/java/org/apache/jena/query/util/DatasetCollector.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/query/util/DatasetCollector.java b/jena-arq/src/main/java/org/apache/jena/query/util/DatasetCollector.java
index 37fe72b..2eb444f 100644
--- a/jena-arq/src/main/java/org/apache/jena/query/util/DatasetCollector.java
+++ b/jena-arq/src/main/java/org/apache/jena/query/util/DatasetCollector.java
@@ -18,8 +18,7 @@
 
 package org.apache.jena.query.util;
 
-import static org.apache.jena.system.Txn.executeRead;
-import static org.apache.jena.system.Txn.executeWrite;
+import static org.apache.jena.system.Txn.*;
 
 import java.util.function.*;
 
@@ -53,7 +52,7 @@ public abstract class DatasetCollector implements UnorderedIdentityFinishCollect
 
         @Override
         public BinaryOperator<Dataset> combiner() {
-            return collector.combiner();
+            return (d1, d2) ->  calculateRead(d2, () -> calculateWrite(d1, () ->
collector.combiner().apply(d1, d2)));
         }
 
         @Override

http://git-wip-us.apache.org/repos/asf/jena/blob/2274264a/jena-arq/src/main/java/org/apache/jena/sparql/util/IntersectionDatasetGraph.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/util/IntersectionDatasetGraph.java
b/jena-arq/src/main/java/org/apache/jena/sparql/util/IntersectionDatasetGraph.java
index ae9ac1d..ade1de2 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/util/IntersectionDatasetGraph.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/util/IntersectionDatasetGraph.java
@@ -56,10 +56,7 @@ public class IntersectionDatasetGraph extends ViewDatasetGraph {
 
     @Override
     public Iterator<Node> listGraphNodes() {
-        return iter(getLeft().listGraphNodes())
-                .filter(graphName -> !getGraph(graphName).isEmpty())
-                .filter(getRight()::containsGraph)
-                .filter(graphName -> !getRight().getGraph(graphName).isEmpty());
+        return iter(getLeft().listGraphNodes()).filter(getRight()::containsGraph);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/jena/blob/2274264a/jena-core/src/main/java/org/apache/jena/util/ModelCollector.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/util/ModelCollector.java b/jena-core/src/main/java/org/apache/jena/util/ModelCollector.java
index adeed0c..24bc309 100644
--- a/jena-core/src/main/java/org/apache/jena/util/ModelCollector.java
+++ b/jena-core/src/main/java/org/apache/jena/util/ModelCollector.java
@@ -53,7 +53,7 @@ public abstract class ModelCollector implements UnorderedIdentityFinishCollector
 
         @Override
         public BinaryOperator<Model> combiner() {
-            return collector.combiner();
+            return (m1, m2) -> m2.calculateInTxn(() -> m1.calculateInTxn(() -> collector.combiner().apply(m1,
m2)));
         }
     }
 


Mime
View raw message