From: <tho...@us...> - 2011-06-18 21:18:02
|
Revision: 4737 http://bigdata.svn.sourceforge.net/bigdata/?rev=4737&view=rev Author: thompsonbry Date: 2011-06-18 21:17:55 +0000 (Sat, 18 Jun 2011) Log Message: ----------- Changes per MikeP's request to the NanoSparqlServer page to include the original query, the sesame operator tree, and the full bop plan for each running query. Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/QueryLog.java branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/QueryServlet.java branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/StatusServlet.java Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/QueryLog.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/QueryLog.java 2011-06-18 11:59:26 UTC (rev 4736) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/QueryLog.java 2011-06-18 21:17:55 UTC (rev 4737) @@ -647,16 +647,20 @@ */ final String bopStr = BOpUtility.toString(q.getQuery()); w.write(TD); - w.write("<a href=\"#\" title=\""); - w.write(attrib(bopStr));// the entire query as a tooltip. - w.write("\"\n>"); + if (maxBopLength != 0) { + w.write("<a href=\"#\" title=\""); + w.write(attrib(bopStr));// the entire query as a tooltip. + w.write("\"\n>"); + } // A slice of the query inline on the page or everything if // maxBopLength<=0. w.write(cdata(bopStr.substring(0/* begin */, maxBopLength <= 0 ? bopStr.length() : Math.min( maxBopLength, bopStr.length())))); - w.write("..."); - w.write("</a>"); + if (maxBopLength != 0) { + w.write("..."); + w.write("</a>"); + } w.write(TDx); w.write(TD); w.write("total"); // summary line. @@ -668,14 +672,19 @@ // Otherwise show just this bop. final String bopStr = bopIndex.get(bopId).toString(); w.write(TD); - w.write("<a href=\"#\" title=\""); - w.write(attrib(bopStr));// the entire query as a tooltip. - w.write("\"\n>"); + if(maxBopLength!=0) { + w.write("<a href=\"#\" title=\""); + w.write(attrib(bopStr));// the entire query as a tooltip. + w.write("\"\n>"); + } // A slice of the query inline on the page. - w.write(cdata(bopStr.substring(0/* begin */, Math.min(64, bopStr - .length())))); - w.write("..."); - w.write("</a>"); + w.write(cdata(bopStr.substring(0/* begin */, + maxBopLength <= 0 ? bopStr.length() : Math.min( + maxBopLength, bopStr.length())))); + if (maxBopLength != 0) { + w.write("..."); + w.write("</a>"); + } w.write(TDx); w.write(TD); w.write(Integer.toString(evalOrder)); // eval order for this bop. Modified: branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java 2011-06-18 11:59:26 UTC (rev 4736) +++ branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java 2011-06-18 21:17:55 UTC (rev 4737) @@ -473,7 +473,7 @@ // Stuff it in the map of running queries. m_queries.put(queryId, new RunningQuery(queryId.longValue(), - queryId2, queryStr, begin)); + queryId2, queryStr, begin, this)); } @@ -835,22 +835,30 @@ */ final UUID queryId2; - /** The query. */ - final String query; + /** + * The task executing the query. + */ + final AbstractQueryTask queryTask; +// /** The query. */ +// final String query; + /** The timestamp when the query was accepted (ns). */ final long begin; public RunningQuery(final long queryId, final UUID queryId2, - final String query, final long begin) { + final String query, final long begin, + final AbstractQueryTask queryTask) { this.queryId = queryId; this.queryId2 = queryId2; - this.query = query; +// this.query = query; this.begin = begin; + + this.queryTask = queryTask; } Modified: branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/QueryServlet.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/QueryServlet.java 2011-06-18 11:59:26 UTC (rev 4736) +++ branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/QueryServlet.java 2011-06-18 21:17:55 UTC (rev 4737) @@ -355,7 +355,7 @@ * into the HTML document we are building for the client. */ QueryLog.getTableXHTML(queryStr, q, w, - true/* showQueryDetails */, 64/* maxBopLength */); + true/* showQueryDetails */, 0/* maxBopLength */); // // Add into the HTML document. // statsNode.text(w.toString()); Modified: branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/StatusServlet.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/StatusServlet.java 2011-06-18 11:59:26 UTC (rev 4736) +++ branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/StatusServlet.java 2011-06-18 21:17:55 UTC (rev 4737) @@ -18,6 +18,7 @@ import com.bigdata.bop.engine.QueryEngine; import com.bigdata.bop.engine.QueryLog; import com.bigdata.bop.fed.QueryEngineFactory; +import com.bigdata.rdf.sail.webapp.BigdataRDFContext.AbstractQueryTask; import com.bigdata.rdf.sail.webapp.BigdataRDFContext.RunningQuery; import com.bigdata.rdf.store.AbstractTripleStore; import com.bigdata.util.HTMLUtility; @@ -82,7 +83,7 @@ * entire thing is accessible via the title attribute (a flyover). Use * ZERO (0) to see everything. */ - int maxBopLength = 64; + int maxBopLength = 0; if (req.getParameter("maxBopLength") != null) { maxBopLength = Integer.valueOf(req.getParameter("maxBopLength")); if (maxBopLength < 0) @@ -163,13 +164,13 @@ * IRunningQuery.getQueryId() to NanoSparqlServer's * RunningQuery.queryId. */ - final Map<UUID,RunningQuery> crosswalkMap = new LinkedHashMap<UUID, RunningQuery>(); + final Map<UUID/* IRunningQuery.queryId */, RunningQuery> crosswalkMap = new LinkedHashMap<UUID, RunningQuery>(); /* * Map providing the accepted RunningQuery objects in descending order * by their elapsed run time. */ - final TreeMap<Long, RunningQuery> acceptedQueryAge = newQueryMap(); + final TreeMap<Long/*elapsed*/, RunningQuery> acceptedQueryAge = newQueryMap(); { @@ -259,12 +260,33 @@ final RunningQuery acceptedQuery = crosswalkMap.get(query .getQueryId()); - final String queryStr = acceptedQuery == null ? "N/A" - : acceptedQuery.query; + final String queryStr; + if (acceptedQuery != null) { + + final AbstractQueryTask queryTask = acceptedQuery.queryTask; + + queryStr = acceptedQuery.queryTask.queryStr; + + current.node("h2", "SPARQL").node("p", + HTMLUtility.escapeForXHTML(queryTask.queryStr)); + + current.node("h2", "Parsed Query").node( + "pre", + HTMLUtility.escapeForXHTML(queryTask.sailQuery + .toString())); + + } else { + + queryStr = "N/A"; + + } + + current.node("h2", "Query Evaluation Statistics").node("p"); + // Format as a table, writing onto the response. - QueryLog.getTableXHTML(queryStr, query, w, !showQueryDetails, - maxBopLength); + QueryLog.getTableXHTML(queryStr, query, w, + !showQueryDetails, maxBopLength); // // Extract as String // final String s = w.getBuffer().toString(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |