From: <tho...@us...> - 2014-01-08 17:58:09
|
Revision: 7751 http://bigdata.svn.sourceforge.net/bigdata/?rev=7751&view=rev Author: thompsonbry Date: 2014-01-08 17:58:02 +0000 (Wed, 08 Jan 2014) Log Message: ----------- Added a hidden option to enable the RTO. Changed the way in which the analytic option recognition works. Verified correctly works in sample queries. See #64 (RTO. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html 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-01-08 17:56:54 UTC (rev 7750) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java 2014-01-08 17:58:02 UTC (rev 7751) @@ -101,6 +101,7 @@ import com.bigdata.rdf.sail.sparql.Bigdata2ASTSPARQLParser; import com.bigdata.rdf.sparql.ast.ASTContainer; import com.bigdata.rdf.sparql.ast.QueryHints; +import com.bigdata.rdf.sparql.ast.QueryOptimizerEnum; import com.bigdata.rdf.sparql.ast.QueryRoot; import com.bigdata.rdf.sparql.ast.QueryType; import com.bigdata.rdf.sparql.ast.Update; @@ -145,6 +146,12 @@ protected static final String ANALYTIC = "analytic"; /** + * URL Query parameter used to request the use of the Runtime Query + * Optimizer. + */ + protected static final String RTO = "RTO"; + + /** * URL Query parameter used to request an XHTML response for SPARQL * QUERY or SPARQL UPDATE. For SPARQL QUERY, this provides an XHTML * table view of the solutions. For SPARQL UPDATE, this provides an @@ -612,9 +619,14 @@ /** * When <code>true</code>, enable the "analytic" query hints. */ - final Boolean analytic; + final boolean analytic; /** + * When <code>true</code>, enable the Runtime Query Optimizer. + */ + final boolean rto; + + /** * When <code>true</code>, provide an view of the XHTML representation * of the solutions or graph result (SPARQL QUERY) * @@ -751,6 +763,9 @@ this.explainDetails = explain && isExplainDetails(req); this.analytic = getEffectiveBooleanValue( req.getParameter(ANALYTIC), QueryHints.DEFAULT_ANALYTIC); + this.rto = getEffectiveBooleanValue(req.getParameter(RTO), + QueryHints.DEFAULT_OPTIMIZER + .equals(QueryOptimizerEnum.Runtime)); this.xhtml = getEffectiveBooleanValue(req.getParameter(XHTML), false); this.monitor = getEffectiveBooleanValue(req.getParameter(MONITOR), @@ -822,6 +837,9 @@ this.explainDetails = explain && isExplainDetails(req); this.analytic = getEffectiveBooleanValue( req.getParameter(ANALYTIC), QueryHints.DEFAULT_ANALYTIC); + this.rto = getEffectiveBooleanValue(req.getParameter(RTO), + QueryHints.DEFAULT_OPTIMIZER + .equals(QueryOptimizerEnum.Runtime)); this.xhtml = getEffectiveBooleanValue(req.getParameter(XHTML), false); this.monitor = getEffectiveBooleanValue(req.getParameter(MONITOR), @@ -898,13 +916,18 @@ // Override query if data set protocol parameters were used. overrideDataset(query); - if (analytic != null) { + if (analytic) { // Turn analytic query on/off as requested. -// astContainer.getOriginalAST().setQueryHint(QueryHints.ANALYTIC, -// analytic.toString()); - astContainer.setQueryHint(QueryHints.ANALYTIC, - analytic.toString()); + astContainer.setQueryHint(QueryHints.ANALYTIC, "true"); + + } + + if (rto) { + + // Turn analytic query on/off as requested. + astContainer.setQueryHint(QueryHints.OPTIMIZER, + QueryOptimizerEnum.Runtime.toString()); } @@ -951,13 +974,18 @@ // Override query if data set protocol parameters were used. overrideDataset(update); - if (analytic != null) { + if (analytic) { // Turn analytic query on/off as requested. -// astContainer.getOriginalAST().setQueryHint(QueryHints.ANALYTIC, -// analytic.toString()); - astContainer.setQueryHint(QueryHints.ANALYTIC, - analytic.toString()); + astContainer.setQueryHint(QueryHints.ANALYTIC, "true"); + + } + + if (rto) { + + // Turn analytic query on/off as requested. + astContainer.setQueryHint(QueryHints.OPTIMIZER, + QueryOptimizerEnum.Runtime.toString()); } Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html 2014-01-08 17:56:54 UTC (rev 7750) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html 2014-01-08 17:58:02 UTC (rev 7751) @@ -59,7 +59,12 @@ <INPUT type="checkbox" name="analytic" value="true" title="Enable the analytic query package." > Analytic - <INPUT type="checkbox" name="xhtml" value="true" +<!-- TODO Uncomment to reveal the RTO option. + <INPUT type="checkbox" name="RTO" value="true" + title="Enable the Runtime Query Optimizer (RTO)." + > RTO +--> + <INPUT type="checkbox" name="xhtml" value="true" title="Request XHTML response (results formatted as table)." checked="checked" > XHTML This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |