From: <tho...@us...> - 2013-09-03 19:28:00
|
Revision: 7383 http://bigdata.svn.sourceforge.net/bigdata/?rev=7383&view=rev Author: thompsonbry Date: 2013-09-03 19:27:52 +0000 (Tue, 03 Sep 2013) Log Message: ----------- Modified the SPARQL UPDATE response to include a mutation count per [1]. However, the response is still not a well-formed or easily parsed XML document. [1] https://sourceforge.net/projects/bigdata/forums/forum/676946/topic/8664308 Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java 2013-09-02 17:04:46 UTC (rev 7382) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java 2013-09-03 19:27:52 UTC (rev 7383) @@ -78,6 +78,7 @@ import com.bigdata.bop.engine.QueryEngine; import com.bigdata.bop.join.PipelineJoin; import com.bigdata.btree.IndexMetadata; +import com.bigdata.counters.CAT; import com.bigdata.io.NullOutputStream; import com.bigdata.journal.IBufferStrategy; import com.bigdata.journal.IIndexManager; @@ -85,6 +86,8 @@ import com.bigdata.journal.Journal; import com.bigdata.journal.RWStrategy; import com.bigdata.journal.TimestampUtility; +import com.bigdata.rdf.changesets.IChangeLog; +import com.bigdata.rdf.changesets.IChangeRecord; import com.bigdata.rdf.sail.BigdataSail; import com.bigdata.rdf.sail.BigdataSailBooleanQuery; import com.bigdata.rdf.sail.BigdataSailGraphQuery; @@ -1329,7 +1332,29 @@ */ protected void doQuery(final BigdataSailRepositoryConnection cxn, final OutputStream os) throws Exception { - + + /* + * Setup a change listener. It will notice the #of mutations. + */ + final CAT mutationCount = new CAT(); + cxn.addChangeLog(new IChangeLog(){ + @Override + public void changeEvent(final IChangeRecord record) { + mutationCount.increment(); + } + @Override + public void transactionBegin() { + } + @Override + public void transactionPrepare() { + } + @Override + public void transactionCommited(long commitTime) { + } + @Override + public void transactionAborted() { + }}); + // Prepare the UPDATE request. final BigdataSailUpdate update = setupUpdate(cxn); @@ -1353,7 +1378,8 @@ // This will write the response entity. listener = new SparqlUpdateResponseWriter(resp, os, charset, - true /* reportLoadProgress */, true/* flushEachEvent */); + true /* reportLoadProgress */, true/* flushEachEvent */, + mutationCount); } else { @@ -1376,7 +1402,8 @@ baos = new ByteArrayOutputStream(); listener = new SparqlUpdateResponseWriter(resp, baos, charset, - false/* reportLoadProgress */, false/* flushEachEvent */); + false/* reportLoadProgress */, false/* flushEachEvent */, + mutationCount); } @@ -1442,6 +1469,8 @@ private final XMLBuilder.Node body; private final boolean reportLoadProgress; private final boolean flushEachEvent; + private final CAT mutationCount; + /** * Used to correlate incremental LOAD progress messages. */ @@ -1464,12 +1493,14 @@ * When <code>true</code>, each the {@link Writer} will be * flushed after each logged event in order to ensure timely * delivery to the client. - * + * @param mutationCount + * A counter that is updated as mutations are applied. * @throws IOException */ public SparqlUpdateResponseWriter(final HttpServletResponse resp, final OutputStream os, final Charset charset, - final boolean reportLoadProgress, final boolean flushEachEvent) + final boolean reportLoadProgress, final boolean flushEachEvent, + final CAT mutationCount) throws IOException { if (resp == null) @@ -1496,6 +1527,8 @@ this.reportLoadProgress = reportLoadProgress; this.flushEachEvent = flushEachEvent; + + this.mutationCount = mutationCount; this.begin = System.nanoTime(); @@ -1691,7 +1724,8 @@ body.node("p") .text("COMMIT: totalElapsed=" + totalElapsedMillis - + "ms, commitTime=" + commitTime)// + + "ms, commitTime=" + commitTime + + ", mutationCount=" + mutationCount.get())// .close(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2013-10-28 19:16:57
|
Revision: 7488 http://bigdata.svn.sourceforge.net/bigdata/?rev=7488&view=rev Author: thompsonbry Date: 2013-10-28 19:16:50 +0000 (Mon, 28 Oct 2013) Log Message: ----------- Handled possible NPE (queryId2 is not defined in the constructor and so it can be null in the finally clause). Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java 2013-10-28 15:23:15 UTC (rev 7487) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java 2013-10-28 19:16:50 UTC (rev 7488) @@ -1093,7 +1093,7 @@ } finally { endNanos = System.nanoTime(); m_queries.remove(queryId); - m_queries2.remove(queryId2); + if (queryId2 != null) m_queries2.remove(queryId2); // if (os != null) { // try { // os.close(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-06-11 15:04:32
|
Revision: 8469 http://sourceforge.net/p/bigdata/code/8469 Author: thompsonbry Date: 2014-06-11 15:04:28 +0000 (Wed, 11 Jun 2014) Log Message: ----------- javadoc on configuration of the query service. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java 2014-06-11 14:48:00 UTC (rev 8468) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java 2014-06-11 15:04:28 UTC (rev 8469) @@ -223,7 +223,10 @@ /** * A thread pool for running accepted queries against the - * {@link QueryEngine}. + * {@link QueryEngine}. The number of queries that will be processed + * concurrently is determined by this thread pool. + * + * @see SparqlEndpointConfig#queryThreadPoolSize */ /*package*/final ExecutorService queryService; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-09-25 21:52:59
|
Revision: 8660 http://sourceforge.net/p/bigdata/code/8660 Author: thompsonbry Date: 2014-09-25 21:52:55 +0000 (Thu, 25 Sep 2014) Log Message: ----------- Fix to scale-out DESCRIBE Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java 2014-09-25 19:00:48 UTC (rev 8659) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java 2014-09-25 21:52:55 UTC (rev 8660) @@ -106,6 +106,7 @@ import com.bigdata.rdf.store.AbstractTripleStore; import com.bigdata.rdf.task.AbstractApiTask; import com.bigdata.relation.RelationSchema; +import com.bigdata.service.IBigdataFederation; import com.bigdata.sparse.ITPS; import com.bigdata.sparse.SparseRowStore; import com.bigdata.util.concurrent.DaemonThreadFactory; @@ -2350,15 +2351,17 @@ } - /*package*/ List<String> getNamespacesTx(final long tx) { + /*package*/ List<String> getNamespacesTx(long tx) { -// if (timestamp == ITx.READ_COMMITTED) { -// -// // Use the last commit point. -// timestamp = getIndexManager().getLastCommitTime(); -// -// } + final IIndexManager indexManager = getIndexManager(); + + if (tx == ITx.READ_COMMITTED && indexManager instanceof IBigdataFederation) { + // Use the last commit point for the federation *only*. + tx = getIndexManager().getLastCommitTime(); + + } + // the triple store namespaces. final List<String> namespaces = new LinkedList<String>(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |