You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@jena.apache.org by GitBox <gi...@apache.org> on 2020/03/12 15:31:17 UTC

[GitHub] [jena] ajs6f commented on a change in pull request #707: JENA-1857: DatasetGraphInMemory.size.

ajs6f commented on a change in pull request #707: JENA-1857: DatasetGraphInMemory.size.
URL: https://github.com/apache/jena/pull/707#discussion_r391703097
 
 

 ##########
 File path: jena-arq/src/main/java/org/apache/jena/sparql/core/mem/DatasetGraphInMemory.java
 ##########
 @@ -400,7 +400,9 @@ public DatasetPrefixStorage prefixes() {
 
     @Override
     public long size() {
-        return quadsIndex().listGraphNodes().count() ;
+        return isInTransaction() 
+                ? quadsIndex().listGraphNodes().count()
+                : calculateRead(this, ()->quadsIndex().listGraphNodes().count());
 
 Review comment:
   ```suggestion
                   : calculateRead(this, quadsIndex().listGraphNodes()::count);
   ```
   
   I just have a thing for point-free! :man_shrugging: 

----------------------------------------------------------------
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

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org