You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2015/06/03 16:14:20 UTC

[1/3] jena git commit: Reduce sytem database footprint.

Repository: jena
Updated Branches:
  refs/heads/master 0d925f3cd -> c736a1799


Reduce sytem database footprint.

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

Branch: refs/heads/master
Commit: b12a55fe8c9f5e185e9489e474874f1317af62ff
Parents: 0d925f3
Author: Andy Seaborne <an...@apache.org>
Authored: Wed Jun 3 15:13:21 2015 +0100
Committer: Andy Seaborne <an...@apache.org>
Committed: Wed Jun 3 15:13:21 2015 +0100

----------------------------------------------------------------------
 .../java/org/apache/jena/fuseki/server/SystemState.java  | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/b12a55fe/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/server/SystemState.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/server/SystemState.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/server/SystemState.java
index 4d3a2f0..9959d26 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/server/SystemState.java
+++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/server/SystemState.java
@@ -61,10 +61,11 @@ public class SystemState {
      */
     private static final StoreParams systemDatabaseParams = StoreParams.builder()
         .fileMode(FileMode.direct)
-        .blockReadCacheSize(20)
+        .blockSize(1024)
+        .blockReadCacheSize(50)
         .blockWriteCacheSize(20)
-        .node2NodeIdCacheSize(5000)
-        .nodeId2NodeCacheSize(5000)
+        .node2NodeIdCacheSize(500)
+        .nodeId2NodeCacheSize(500)
         .nodeMissCacheSize(100)
         .build() ;
     
@@ -90,14 +91,14 @@ public class SystemState {
     }
     
     public static String PREFIXES = StrUtils.strjoinNL
-        ("BASE <http://example/base#>",
+        ("BASE            <http://example/base#>",
          "PREFIX ja:      <http://jena.hpl.hp.com/2005/11/Assembler#>",
          "PREFIX fu:      <http://jena.apache.org/fuseki#>",
          "PREFIX fuseki:  <http://jena.apache.org/fuseki#>",
          "PREFIX rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#>",
          "PREFIX rdfs:    <http://www.w3.org/2000/01/rdf-schema#>",
          "PREFIX tdb:     <http://jena.hpl.hp.com/2008/tdb#>",
-         "PREFIX sdb:     <http://jena.hpl.hp.com/20087/sdb#>",
+         "PREFIX sdb:     <http://jena.hpl.hp.com/2007/sdb#>",
          "PREFIX list:    <http://jena.apache.org/ARQ/list#>",
          "PREFIX xsd:     <http://www.w3.org/2001/XMLSchema#>",
          "PREFIX apf:     <http://jena.apache.org/ARQ/property#>",


[3/3] jena git commit: Cleaning up.

Posted by an...@apache.org.
Cleaning up.

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

Branch: refs/heads/master
Commit: c736a179968b1a14a32e7ed7c2a1707a90416f6c
Parents: b4d8b8b
Author: Andy Seaborne <an...@apache.org>
Authored: Wed Jun 3 15:14:11 2015 +0100
Committer: Andy Seaborne <an...@apache.org>
Committed: Wed Jun 3 15:14:11 2015 +0100

----------------------------------------------------------------------
 .../apache/jena/fuseki/servlets/ActionREST.java |   2 -
 .../fuseki/servlets/ConcurrencyPolicyMRSW.java  | 113 -------------------
 .../apache/jena/fuseki/servlets/HttpAction.java |   2 +
 .../fuseki/servlets/SPARQL_UberServlet.java     |  35 +++---
 .../jena/fuseki/servlets/SPARQL_Update.java     |   1 -
 .../jena/fuseki/servlets/SPARQL_Upload.java     |   1 -
 6 files changed, 23 insertions(+), 131 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/c736a179/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionREST.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionREST.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionREST.java
index 3178a05..13ed6ea 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionREST.java
+++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionREST.java
@@ -70,8 +70,6 @@ public abstract class ActionREST extends ActionSPARQL
 
     // Counter wrappers
     
-    // XXX Out of date - we now add HTTP counters to all endpoints. 
-    
     private final void doGet$(HttpAction action) {
         incCounter(action.getEndpoint(), CounterName.HTTPget) ;
         try {

http://git-wip-us.apache.org/repos/asf/jena/blob/c736a179/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ConcurrencyPolicyMRSW.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ConcurrencyPolicyMRSW.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ConcurrencyPolicyMRSW.java
deleted file mode 100644
index 1f86539..0000000
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ConcurrencyPolicyMRSW.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.fuseki.servlets;
-
-import java.util.ConcurrentModificationException ;
-import java.util.concurrent.atomic.AtomicLong ;
-
-import org.apache.jena.fuseki.Fuseki ;
-import org.slf4j.Logger ;
-
-public final class ConcurrencyPolicyMRSW
-{
-    static private Logger log = Fuseki.actionLog ; //org.slf4j.LoggerFactory.getLogger(ConcurrencyPolicyMRSW.class) ;
-    static private final boolean logging = false ; //log.isDebugEnabled() ;
-    
-    // This is a simplified version of ConcurrencyPolicyMRSW from TDB. 
-    private final AtomicLong readCounter = new AtomicLong(0) ;
-    private final AtomicLong writeCounter = new AtomicLong(0) ;
-    static private final AtomicLong policyCounter = new AtomicLong(0) ;
-
-    public ConcurrencyPolicyMRSW()
-    { policyCounter.incrementAndGet() ; }
-
-    // Loggin -inside the operation.
-    
-    //@Override
-    public void startRead()
-    {
-        readCounter.getAndIncrement() ;
-        log() ;
-        checkConcurrency() ;
-    }
-
-    //@Override
-    public void finishRead()
-    {
-        log() ;
-        readCounter.decrementAndGet() ;
-        checkConcurrency() ;
-    }
-
-    //@Override
-    public void startUpdate()
-    {
-        writeCounter.getAndIncrement() ;
-        log() ;
-        checkConcurrency() ;
-    }
-
-    //@Override
-    public void finishUpdate()
-    {
-        log() ;
-        writeCounter.decrementAndGet() ;
-        checkConcurrency() ;
-    }
-
-    private synchronized void checkConcurrency()
-    {
-        long R = readCounter.get() ;
-        long W = writeCounter.get() ;
-        long id = policyCounter.get();
-        if ( R > 0 && W > 0 )
-            policyError(id, R, W) ;
-        if ( W > 1 )
-            policyError(id, R, W) ;
-    }
-
-    private void log()
-    {
-        if ( ! logging ) 
-            return ;
-        long R , W , id ;
-        synchronized(this)
-        {
-            R = readCounter.get() ;
-            W = writeCounter.get() ;
-            id = policyCounter.get();
-        }
-        log.info(format(id, R, W)) ;
-    }
-    
-    private static void policyError(long id, long R, long W)
-    {
-        policyError(format(id, R, W)) ;
-    }
-
-    private static void policyError(String message)
-    {
-        throw new ConcurrentModificationException(message) ;
-    }
-    
-    private static String format(long id, long R, long W)
-    {
-        return String.format("(lock=%d) Reader = %d, Writer = %d", id, R, W) ;
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/c736a179/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/HttpAction.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/HttpAction.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/HttpAction.java
index c60ae3d..32a9024 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/HttpAction.java
+++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/HttpAction.java
@@ -394,6 +394,8 @@ public class HttpAction
         this.finishTime = System.nanoTime() ;
     }
 
+    public String getMethod()                           { return request.getMethod() ; }
+
     public HttpServletRequest getRequest()              { return request ; }
 
     public HttpServletResponseTracker getResponse()     { return response ; }

http://git-wip-us.apache.org/repos/asf/jena/blob/c736a179/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_UberServlet.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_UberServlet.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_UberServlet.java
index 35c27c0..d7e44e4 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_UberServlet.java
+++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_UberServlet.java
@@ -274,6 +274,26 @@ public abstract class SPARQL_UberServlet extends ActionSPARQL
         doGraphStoreProtocol(action) ;
     }
     
+    /** See if the operation is enabled for this setup.
+     * Return true if dispatched 
+     */
+    private boolean serviceDispatch(HttpAction action, OperationName opName, ActionSPARQL servlet) {
+        Endpoint operation = action.getEndpoint() ;
+        if ( operation == null )
+            return false ;
+        if ( ! operation.isType(opName) ) 
+            return false ;
+        // Handle OPTIONS specially.
+//        if ( action.getRequest().getMethod().equals(HttpNames.METHOD_OPTIONS) ) {
+//            // See also ServletBase.CORS_ENABLED
+//            //action.log.info(format("[%d] %s", action.id, action.getMethod())) ;
+//            setCommonHeadersForOptions(action.getResponse()) ;
+//            ServletOps.success(action);
+//            return true ;
+//        }
+        executeRequest(action, servlet) ;
+        return true ;
+    }
     private String printName(String x) {
         if ( x.startsWith("/") )
             return x.substring(1) ;
@@ -308,7 +328,7 @@ public abstract class SPARQL_UberServlet extends ActionSPARQL
 
     private void executeRequest(HttpAction action, ActionSPARQL servlet) {
         servlet.executeLifecycle(action) ;
-//      // Forwarded dispatch.
+        // A call to "doCommon" or a forwarded dispatch looses "action".
 //      try
 //      {
 //          String target = getEPName(desc.name, endpointList) ;
@@ -332,19 +352,6 @@ public abstract class SPARQL_UberServlet extends ActionSPARQL
         return mt ;
     }
 
-    /** return true if dispatched 
-     * @param opName 
-     */
-    private boolean serviceDispatch(HttpAction action, OperationName opName, ActionSPARQL servlet) {
-        Endpoint operation = action.getEndpoint() ;
-        if ( operation == null )
-            return false ;
-        if ( ! operation.isType(opName) ) 
-            return false ;
-        servlet.executeLifecycle(action) ;
-        return true ;
-    }
-
     /** Find part after the dataset name: service name or the graph (direct naming) */ 
     protected String findTrailing(String uri, String dsname) {
         if ( dsname.length() >= uri.length() )

http://git-wip-us.apache.org/repos/asf/jena/blob/c736a179/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Update.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Update.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Update.java
index 1750a1d..297cd17 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Update.java
+++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Update.java
@@ -122,7 +122,6 @@ public class SPARQL_Update extends SPARQL_Protocol
         ContentType ct = FusekiLib.getContentType(action) ;
         if ( ct == null )
             ct = ctSPARQLUpdate ;
-        // ----
 
         if ( matchContentType(ctSPARQLUpdate, ct) ) {
             String charset = request.getCharacterEncoding() ;

http://git-wip-us.apache.org/repos/asf/jena/blob/c736a179/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Upload.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Upload.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Upload.java
index 5314eed..fe3e0db 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Upload.java
+++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Upload.java
@@ -63,7 +63,6 @@ public class SPARQL_Upload extends ActionSPARQL
 
     @Override
     protected void doOptions(HttpServletRequest request, HttpServletResponse response) {
-        setCommonHeaders(response) ;
         setCommonHeadersForOptions(response) ;
         response.setHeader(HttpNames.hAllow, "OPTIONS,POST") ;
         response.setHeader(HttpNames.hContentLengh, "0") ;


[2/3] jena git commit: Direct naming GSP does not have an operation.

Posted by an...@apache.org.
Direct naming GSP does not have an operation.

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

Branch: refs/heads/master
Commit: b4d8b8b61b679a3890c2f41558e2b0431e7560cc
Parents: b12a55f
Author: Andy Seaborne <an...@apache.org>
Authored: Wed Jun 3 15:14:01 2015 +0100
Committer: Andy Seaborne <an...@apache.org>
Committed: Wed Jun 3 15:14:01 2015 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/jena/fuseki/servlets/ActionSPARQL.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/b4d8b8b6/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionSPARQL.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionSPARQL.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionSPARQL.java
index 961d772..6238df0 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionSPARQL.java
+++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionSPARQL.java
@@ -110,7 +110,10 @@ public abstract class ActionSPARQL extends ActionBase
         startRequest(action) ;
         // And also HTTP counter
         CounterSet csService = action.getDataService().getCounters() ;
-        CounterSet csOperation = action.getEndpoint().getCounters() ;
+        CounterSet csOperation = null ;
+        if ( action.getEndpoint() != null )
+            // Direct naming GSP does not have an "endpoint".
+            csOperation = action.getEndpoint().getCounters() ;
         
         incCounter(csService, Requests) ;
         incCounter(csOperation, Requests) ;