From: <dme...@us...> - 2014-05-07 13:57:23
|
Revision: 8215 http://sourceforge.net/p/bigdata/code/8215 Author: dmekonnen Date: 2014-05-07 13:57:17 +0000 (Wed, 07 May 2014) Log Message: ----------- resync with BIGDATA_RELEASE_1_3_0 branch Modified Paths: -------------- branches/DEPLOYMENT_BRANCH_1_3_1/.classpath branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/bop/BOp.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/bop/CoreBaseBOp.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/bop/IValueExpression.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/bop/controller/ServiceCallJoin.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/resources/deployment/vagrant/systap-aws-bigdata-ha/recipes/default.rb branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-ganglia/build.properties branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-A.config branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-B.config branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-C.config branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3LoadBalancerTestCase.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-A.config branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-B.config branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-C.config branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-D.config branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-E.config branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournalTest.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3LoadBalancer_GangliaLBS.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3LoadBalancer_NOP.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3LoadBalancer_RoundRobin.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/log4j-template-A.properties branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/zkClient.config branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/FilterNode.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/FunctionNode.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/IQueryNode.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/IValueExpressionNode.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/QueryBase.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/StatementPatternNode.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/SubqueryFunctionNodeBase.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/TermNode.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/ValueExpressionNode.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/optimizers/ASTUnionFiltersOptimizer.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/optimizers/AbstractJoinGroupOptimizer.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/TestAST.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/optimizers/AbstractOptimizerTestCase.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/optimizers/TestALPPinTrac773.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/optimizers/TestASTUnionFiltersOptimizer.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/optimizers/TestAll.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataServlet.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HALoadBalancerServlet.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HAStatusServletUtil.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/AbstractLBSPolicy.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/ServiceScore.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/policy/NOPLBSPolicy.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/policy/RoundRobinLBSPolicy.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/policy/ganglia/GangliaLBSPolicy.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/policy/ganglia/HostTable.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-war/src/WEB-INF/web.xml branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-war/src/html/css/style.css branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-war/src/html/index.html branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-war/src/html/js/workbench.js branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-war/src/jetty.xml branches/DEPLOYMENT_BRANCH_1_3_1/build.properties branches/DEPLOYMENT_BRANCH_1_3_1/build.xml branches/DEPLOYMENT_BRANCH_1_3_1/pom.xml branches/DEPLOYMENT_BRANCH_1_3_1/src/resources/HAJournal/HAJournal.config branches/DEPLOYMENT_BRANCH_1_3_1/src/resources/bin/startHAServices Added Paths: ----------- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/lib/jetty/jetty-jmx-9.1.4.v20140401.jar branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/lib/jetty/jetty-jndi-9.1.4.v20140401.jar branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/optimizers/TestASTExistsAndJoinOrderByTypeOptimizers.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/optimizers/TestASTPropertyPathOptimizer.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/DefaultHARequestURIRewriter.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/IHALoadBalancerPolicy.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/IHAPolicyLifeCycle.java branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/IHARequestURIRewriter.java Modified: branches/DEPLOYMENT_BRANCH_1_3_1/.classpath =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/.classpath 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/.classpath 2014-05-07 13:57:17 UTC (rev 8215) @@ -58,6 +58,8 @@ <classpathentry exported="true" kind="lib" path="bigdata/lib/unimi/fastutil-5.1.5.jar"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/lucene/lucene-analyzers-3.0.0.jar"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/lucene/lucene-core-3.0.0.jar"/> + <classpathentry kind="lib" path="bigdata/lib/jetty/jetty-jmx-9.1.4.v20140401.jar"/> + <classpathentry kind="lib" path="bigdata/lib/jetty/jetty-jndi-9.1.4.v20140401.jar"/> <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/high-scale-lib-v1.1.2.jar"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/junit-ext-1.1-b3-dev.jar"/> Added: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/lib/jetty/jetty-jmx-9.1.4.v20140401.jar =================================================================== (Binary files differ) Index: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/lib/jetty/jetty-jmx-9.1.4.v20140401.jar =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/lib/jetty/jetty-jmx-9.1.4.v20140401.jar 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/lib/jetty/jetty-jmx-9.1.4.v20140401.jar 2014-05-07 13:57:17 UTC (rev 8215) Property changes on: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/lib/jetty/jetty-jmx-9.1.4.v20140401.jar ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/lib/jetty/jetty-jndi-9.1.4.v20140401.jar =================================================================== (Binary files differ) Index: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/lib/jetty/jetty-jndi-9.1.4.v20140401.jar =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/lib/jetty/jetty-jndi-9.1.4.v20140401.jar 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/lib/jetty/jetty-jndi-9.1.4.v20140401.jar 2014-05-07 13:57:17 UTC (rev 8215) Property changes on: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/lib/jetty/jetty-jndi-9.1.4.v20140401.jar ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/bop/BOp.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/bop/BOp.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/bop/BOp.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -211,6 +211,24 @@ */ boolean isController(); + /** + * The contract of this method at this level is under-specified. + * Sub-classes may choose between: + * + * - return a string representation of the object, similar to the use of {@link #toString()} + * + * Or: + * + * - return a pretty-print representation of the object with indent + * + * Note that the former contract may or may not include recursive descent through a tree-like + * object, whereas the latter almost certainly does. + * + * @param indent + * @return + */ + String toString(final int indent); + /** * Interface declaring well known annotations. * <p> Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/bop/CoreBaseBOp.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/bop/CoreBaseBOp.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/bop/CoreBaseBOp.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -156,9 +156,44 @@ return sb.toString(); } + + /** + * Append a name to a string buffer, possibly shortening the name. + * The current algorithm for name shortening is to take the end of the name + * after the pen-ultimate '.'. + * @param sb + * @param longishName + */ + protected void shortenName(final StringBuilder sb, final String longishName) { + int lastDot = longishName.lastIndexOf('.'); + if (lastDot != -1) { + int lastButOneDot = longishName.lastIndexOf('.', lastDot - 1); + sb.append(longishName.substring(lastButOneDot + 1)); + return; + } + sb.append(longishName); + } + /** + * Add a string representation of annotations into a string builder. + * By default this is a non-recursive operation, however + * subclasses may override {@link #annotationValueToString(StringBuilder, BOp, int)} + * in order to make this recursive. + * @param sb + */ protected void annotationsToString(final StringBuilder sb) { - final Map<String,Object> annotations = annotations(); + annotationsToString(sb, 0); + } + + /** + * Add a string representation of annotations into a string builder. + * By default this is a non-recursive operation, however + * subclasses may override {@link #annotationValueToString(StringBuilder, BOp, int)} + * in order to make this recursive. + * @param sb + */ + protected void annotationsToString(final StringBuilder sb, final int indent) { + final Map<String,Object> annotations = annotations(); if (!annotations.isEmpty()) { sb.append("["); boolean first = true; @@ -169,20 +204,35 @@ sb.append(", "); final String key = e.getKey(); final Object val = e.getValue(); + shortenName(sb, key); + sb.append("="); if (val != null && val.getClass().isArray()) { - sb.append(key + "=" + Arrays.toString((Object[]) val)); + sb.append(Arrays.toString((Object[]) val)); } else if (key.equals(IPredicate.Annotations.FLAGS)) { - sb.append(key + "=" + Tuple.flagString((Integer) val)); + sb.append(Tuple.flagString((Integer) val)); } else if( val instanceof BOp) { - sb.append(key + "=" + ((BOp) val).toShortString()); + annotationValueToString(sb, (BOp)val, indent); } else { - sb.append(key + "=" + val); + sb.append(val); } first = false; } sb.append("]"); } - } + } + + /** + * Add a string representation of a BOp annotation value into a string builder. + * By default this is a non-recursive operation, however + * subclasses may override and give a recursive definition, which should respect + * the given indent. + * @param sb The destination buffer + * @param val The BOp to serialize + * @param indent An indent to use if a recursive approach is chosen. + */ + protected void annotationValueToString(final StringBuilder sb, final BOp val, final int indent) { + sb.append(val.toString()); + } @Override final public Object getRequiredProperty(final String name) { @@ -363,7 +413,7 @@ if(v1 == v2) continue; - if (v1 != null && v2 == null) + if (v1 == null || v2 == null) return false; if (v1.getClass().isArray()) { @@ -441,6 +491,26 @@ } + /** + * The contract of this method at this level is under-specified. + * Sub-classes may choose between: + * + * - return a string representation of the object, similar to the use of {@link #toString()} + * + * Or: + * + * - return a pretty-print representation of the object with indent + * + * Note that the former contract may or may not include recursive descent through a tree-like + * object, whereas the latter almost certainly does. + * + * @param indent + * @return + */ + public String toString(int indent) { + return toString(); + } + private static final transient String ws = " "; } Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/bop/IValueExpression.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/bop/IValueExpression.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/bop/IValueExpression.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -26,5 +26,11 @@ * <code>null</code>. */ E get(IBindingSet bindingSet); + /** + * A string representation of a recursive structure with pretty-print indent. + * @param indent + * @return + */ + String toString(int indent); } Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/bop/controller/ServiceCallJoin.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/bop/controller/ServiceCallJoin.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/java/com/bigdata/bop/controller/ServiceCallJoin.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -58,7 +58,6 @@ import com.bigdata.rdf.model.BigdataURI; import com.bigdata.rdf.sparql.ast.service.BigdataServiceCall; import com.bigdata.rdf.sparql.ast.service.ExternalServiceCall; -import com.bigdata.rdf.sparql.ast.service.IDoNotJoinService; import com.bigdata.rdf.sparql.ast.service.RemoteServiceCall; import com.bigdata.rdf.sparql.ast.service.ServiceCall; import com.bigdata.rdf.sparql.ast.service.ServiceCallUtility; @@ -586,52 +585,6 @@ : new UnsyncLocalOutputBuffer<IBindingSet>( op.getChunkCapacity(), sink2); - if (serviceCall instanceof IDoNotJoinService) { - - // The iterator draining the subquery - ICloseableIterator<IBindingSet[]> serviceSolutionItr = null; - try { - - /* - * Invoke the service. - * - * Note: Returns [null] IFF SILENT and SERVICE ERROR. - */ - - serviceSolutionItr = doServiceCall(serviceCall, chunk); - - if (serviceSolutionItr != null) { - - while (serviceSolutionItr.hasNext()) { - - final IBindingSet[] bsets = - serviceSolutionItr.next(); - - for (IBindingSet bs : bsets) { - - unsyncBuffer.add(bs); - - } - - } - - } - - } finally { - - // ensure the service call iterator is closed. - if (serviceSolutionItr != null) - serviceSolutionItr.close(); - - } - - unsyncBuffer.flush(); - - // done. - return null; - - } - final JVMHashJoinUtility state = new JVMHashJoinUtility(op, silent ? JoinTypeEnum.Optional : JoinTypeEnum.Normal ); Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/resources/deployment/vagrant/systap-aws-bigdata-ha/recipes/default.rb =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/resources/deployment/vagrant/systap-aws-bigdata-ha/recipes/default.rb 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata/src/resources/deployment/vagrant/systap-aws-bigdata-ha/recipes/default.rb 2014-05-07 13:57:17 UTC (rev 8215) @@ -33,7 +33,7 @@ user 'ubuntu' group 'ubuntu' cwd "/home/ubuntu" - command "svn checkout https://svn.code.sf.net/p/bigdata/code/branches/BIGDATA_RELEASE_1_3_0 #{node['systap-bigdataHA'][:source]}" + command "svn checkout #{node['systap-bigdataHA'][:svn]} #{node['systap-bigdataHA'][:source]}" end execute "ant deploy-artifact" do @@ -90,7 +90,7 @@ # # Install the log4jHA.properties file: # -template "#{node['systap-bigdataHA'][:fed_dir]}/var/jetty/WEB-INF/jetty.xml" do +template "#{node['systap-bigdataHA'][:fed_dir]}/var/jetty/jetty.xml" do source "jetty.xml.erb" owner 'bigdata' group 'bigdata' Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-ganglia/build.properties =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-ganglia/build.properties 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-ganglia/build.properties 2014-05-07 13:57:17 UTC (rev 8215) @@ -38,7 +38,7 @@ release.dir=ant-release # The build version. -build.ver=1.0.1 +build.ver=1.0.2 # Set true to do a snapshot build. This changes the value of ${version} to # include the date. Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-A.config =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-A.config 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-A.config 2014-05-07 13:57:17 UTC (rev 8215) @@ -60,6 +60,9 @@ private static fedname = "benchmark"; + // The RMI port for the HAGlue interface (may be ZERO for a random port). + private static rmiPort = 9080; + // write replication pipeline port (listener). private static haPort = 9090; @@ -250,6 +253,9 @@ replicationFactor = bigdata.replicationFactor; + exporter = new BasicJeriExporter(TcpServerEndpoint.getInstance(bigdata.rmiPort), + new BasicILFactory()); + } /* Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-B.config =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-B.config 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-B.config 2014-05-07 13:57:17 UTC (rev 8215) @@ -60,9 +60,9 @@ private static fedname = "benchmark"; - // NanoSparqlServer (http) port. - private static nssPort = ConfigMath.add(8090,1); - + // The RMI port for the HAGlue interface (may be ZERO for a random port). + private static rmiPort = ConfigMath.add(9080,1); + // write replication pipeline port (listener). private static haPort = ConfigMath.add(9090,1); @@ -252,6 +252,9 @@ replicationFactor = bigdata.replicationFactor; + exporter = new BasicJeriExporter(TcpServerEndpoint.getInstance(bigdata.rmiPort), + new BasicILFactory()); + } /* Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-C.config =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-C.config 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-C.config 2014-05-07 13:57:17 UTC (rev 8215) @@ -60,6 +60,9 @@ private static fedname = "benchmark"; + // The RMI port for the HAGlue interface (may be ZERO for a random port). + private static rmiPort = ConfigMath.add(9080,1); + // write replication pipeline port (listener). private static haPort = ConfigMath.add(9090,2); @@ -249,6 +252,9 @@ replicationFactor = bigdata.replicationFactor; + exporter = new BasicJeriExporter(TcpServerEndpoint.getInstance(bigdata.rmiPort), + new BasicILFactory()); + } /* Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -104,8 +104,8 @@ import com.bigdata.rdf.sail.CreateKBTask; import com.bigdata.rdf.sail.webapp.ConfigParams; import com.bigdata.rdf.sail.webapp.HALoadBalancerServlet; -import com.bigdata.rdf.sail.webapp.IHALoadBalancerPolicy; import com.bigdata.rdf.sail.webapp.NanoSparqlServer; +import com.bigdata.rdf.sail.webapp.lbs.IHALoadBalancerPolicy; import com.bigdata.rwstore.RWStore; import com.bigdata.service.AbstractHATransactionService; import com.bigdata.service.jini.FakeLifeCycle; @@ -756,7 +756,20 @@ final Quorum<HAGlue, QuorumService<HAGlue>> quorum = (Quorum) new ZKQuorumImpl<HAGlue, HAQuorumService<HAGlue, HAJournal>>( replicationFactor); - // The HAJournal. + /** + * The HAJournal. + * + * FIXME This step can block for a long time if we have a lot of + * HALogs to scan. While it blocks, the REST API (including the LBS) + * is down. This means that client requests to the service end point + * can not be proxied to a service that is online. The problem is + * the interaction with the BigdataRDFServletContextListener which + * needs to (a) set the IIndexManager on the ServletContext; and (b) + * initiate the default KB create (if it is the quorum leader). + * + * @see <a href="http://trac.bigdata.com/ticket/775" > HAJournal + * start() (optimization) </a> + */ this.journal = newHAJournal(this, config, quorum); } @@ -4536,6 +4549,13 @@ // Start the server. jettyServer.start(); + if (Boolean.getBoolean("jetty.dump.start")) { + + // Support the jetty dump-after-start semantics. + log.warn(jettyServer.dump()); + + } + /* * Report *an* effective URL of this service. * @@ -4636,7 +4656,7 @@ if (log.isInfoEnabled()) log.info("Will set LBS: wac=" + wac + ", policy: " + policy); - HALoadBalancerServlet.setPolicy(wac.getServletContext(), policy); + HALoadBalancerServlet.setLBSPolicy(wac.getServletContext(), policy); } Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -2137,6 +2137,13 @@ private final String serviceName; private final UUID serviceId; private final int jettyPort; + /** + * The value of this environment variable is passed down. You can set + * this environment variable to force jetty to dump its internal start + * after start. + */ + private final boolean jettyDumpStart = Boolean + .getBoolean("jetty.dump.start"); // private final File serviceDir; private final String[] args; @@ -2230,6 +2237,12 @@ private final String JETTY_RESOURCE_BASE = "jetty.resourceBase"; /** + * Used to override the <code>jetty.dump.start</code> environment + * property. + */ + private final String TEST_JETTY_DUMP_START = "jetty.dump.start"; + + /** * The absolute effective path of the service directory. This is * overridden on the {@link #TEST_SERVICE_DIR} environment variable * and in the deployed HAJournal.config file in order to have the @@ -2277,6 +2290,9 @@ // Override the location of the webapp as deployed. cmds.add("-D" + JETTY_RESOURCE_BASE + "=\".\""); + // Override the jetty.dump.start. + cmds.add("-D" + TEST_JETTY_DUMP_START + "=" + jettyDumpStart); + super.addCommandArgs(cmds); for (String arg : args) { Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3LoadBalancerTestCase.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3LoadBalancerTestCase.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3LoadBalancerTestCase.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -37,9 +37,9 @@ import com.bigdata.journal.jini.ha.HAJournalServer.HAQuorumService; import com.bigdata.journal.jini.ha.HAJournalTest.HAGlueTest; import com.bigdata.rdf.sail.webapp.HALoadBalancerServlet; -import com.bigdata.rdf.sail.webapp.IHALoadBalancerPolicy; import com.bigdata.rdf.sail.webapp.client.RemoteRepository; import com.bigdata.rdf.sail.webapp.client.RemoteRepository.RemoveOp; +import com.bigdata.rdf.sail.webapp.lbs.IHALoadBalancerPolicy; /** * Test suite for the HA load balancer. Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-A.config =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-A.config 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-A.config 2014-05-07 13:57:17 UTC (rev 8215) @@ -60,6 +60,9 @@ private static fedname = "benchmark"; + // The RMI port for the HAGlue interface (may be ZERO for a random port). + private static rmiPort = 9080; + // write replication pipeline port (listener). private static haPort = 9090; @@ -257,6 +260,9 @@ replicationFactor = bigdata.replicationFactor; + exporter = new BasicJeriExporter(TcpServerEndpoint.getInstance(bigdata.rmiPort), + new BasicILFactory()); + // Use the overridden version of the HAJournal by default so we get the // HAGlueTest API for every test. HAJournalClass = "com.bigdata.journal.jini.ha.HAJournalTest"; Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-B.config =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-B.config 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-B.config 2014-05-07 13:57:17 UTC (rev 8215) @@ -60,6 +60,9 @@ private static fedname = "benchmark"; + // The RMI port for the HAGlue interface (may be ZERO for a random port). + private static rmiPort = ConfigMath.add(9080,1); + // write replication pipeline port (listener). private static haPort = ConfigMath.add(9090,1); @@ -256,6 +259,9 @@ replicationFactor = bigdata.replicationFactor; + exporter = new BasicJeriExporter(TcpServerEndpoint.getInstance(bigdata.rmiPort), + new BasicILFactory()); + // Use the overridden version of the HAJournal by default so we get the // HAGlueTest API for every test. HAJournalClass = "com.bigdata.journal.jini.ha.HAJournalTest"; Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-C.config =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-C.config 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-C.config 2014-05-07 13:57:17 UTC (rev 8215) @@ -60,6 +60,9 @@ private static fedname = "benchmark"; + // The RMI port for the HAGlue interface (may be ZERO for a random port). + private static rmiPort = ConfigMath.add(9080,2); + // write replication pipeline port (listener). private static haPort = ConfigMath.add(9090,2); @@ -256,6 +259,9 @@ replicationFactor = bigdata.replicationFactor; + exporter = new BasicJeriExporter(TcpServerEndpoint.getInstance(bigdata.rmiPort), + new BasicILFactory()); + // Use the overridden version of the HAJournal by default so we get the // HAGlueTest API for every test. HAJournalClass = "com.bigdata.journal.jini.ha.HAJournalTest"; Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-D.config =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-D.config 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-D.config 2014-05-07 13:57:17 UTC (rev 8215) @@ -60,9 +60,9 @@ private static fedname = "benchmark"; - // NanoSparqlServer (http) port. - private static nssPort = ConfigMath.add(8090,3); - + // The RMI port for the HAGlue interface (may be ZERO for a random port). + private static rmiPort = ConfigMath.add(9080,3); + // write replication pipeline port (listener). private static haPort = ConfigMath.add(9090,3); @@ -259,6 +259,9 @@ replicationFactor = bigdata.replicationFactor; + exporter = new BasicJeriExporter(TcpServerEndpoint.getInstance(bigdata.rmiPort), + new BasicILFactory()); + // Use the overridden version of the HAJournal by default so we get the // HAGlueTest API for every test. HAJournalClass = "com.bigdata.journal.jini.ha.HAJournalTest"; Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-E.config =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-E.config 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-E.config 2014-05-07 13:57:17 UTC (rev 8215) @@ -60,9 +60,9 @@ private static fedname = "benchmark"; - // NanoSparqlServer (http) port. - private static nssPort = ConfigMath.add(8090,4); - + // The RMI port for the HAGlue interface (may be ZERO for a random port). + private static rmiPort = ConfigMath.add(9080,4); + // write replication pipeline port (listener). private static haPort = ConfigMath.add(9090,4); @@ -259,6 +259,9 @@ replicationFactor = bigdata.replicationFactor; + exporter = new BasicJeriExporter(TcpServerEndpoint.getInstance(bigdata.rmiPort), + new BasicILFactory()); + // Use the overridden version of the HAJournal by default so we get the // HAGlueTest API for every test. HAJournalClass = "com.bigdata.journal.jini.ha.HAJournalTest"; Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournalTest.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournalTest.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournalTest.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -102,7 +102,7 @@ import com.bigdata.rdf.sail.BigdataSailRepository; import com.bigdata.rdf.sail.BigdataSailRepositoryConnection; import com.bigdata.rdf.sail.webapp.HALoadBalancerServlet; -import com.bigdata.rdf.sail.webapp.IHALoadBalancerPolicy; +import com.bigdata.rdf.sail.webapp.lbs.IHALoadBalancerPolicy; import com.bigdata.rdf.store.AbstractTripleStore; import com.bigdata.service.jini.RemoteDestroyAdmin; Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3LoadBalancer_GangliaLBS.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3LoadBalancer_GangliaLBS.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3LoadBalancer_GangliaLBS.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -23,7 +23,7 @@ */ package com.bigdata.journal.jini.ha; -import com.bigdata.rdf.sail.webapp.IHALoadBalancerPolicy; +import com.bigdata.rdf.sail.webapp.lbs.IHALoadBalancerPolicy; import com.bigdata.rdf.sail.webapp.lbs.policy.ganglia.GangliaLBSPolicy; /** Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3LoadBalancer_NOP.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3LoadBalancer_NOP.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3LoadBalancer_NOP.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -23,7 +23,7 @@ */ package com.bigdata.journal.jini.ha; -import com.bigdata.rdf.sail.webapp.IHALoadBalancerPolicy; +import com.bigdata.rdf.sail.webapp.lbs.IHALoadBalancerPolicy; import com.bigdata.rdf.sail.webapp.lbs.policy.NOPLBSPolicy; /** Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3LoadBalancer_RoundRobin.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3LoadBalancer_RoundRobin.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3LoadBalancer_RoundRobin.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -23,7 +23,7 @@ */ package com.bigdata.journal.jini.ha; -import com.bigdata.rdf.sail.webapp.IHALoadBalancerPolicy; +import com.bigdata.rdf.sail.webapp.lbs.IHALoadBalancerPolicy; import com.bigdata.rdf.sail.webapp.lbs.policy.RoundRobinLBSPolicy; Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/log4j-template-A.properties =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/log4j-template-A.properties 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/log4j-template-A.properties 2014-05-07 13:57:17 UTC (rev 8215) @@ -16,10 +16,21 @@ #log4j.logger.com.bigdata.zookeeper.ZooHelper=ALL log4j.logger.com.bigdata.rdf.internal.LexiconConfiguration=FATAL +# webapp logging. +log4j.logger.com.bigdata.rdf.sail.webapp=ALL +#log4j.logger.com.bigdata.rdf.sail.webapp.RESTServlet=INFO +#log4j.logger.com.bigdata.rdf.sail.webapp.HALoadBalancerServlet=ALL +#log4j.logger.com.bigdata.ganglia.GangliaService=INFO + +# jetty debug logging. +log4j.logger.org.eclipse.jetty=INFO +#log4j.logger.org.eclipse.jetty.client=DEBUG +#log4j.logger.org.eclipse.jetty.proxy=DEBUG + log4j.appender.haLog=org.apache.log4j.FileAppender log4j.appender.haLog.Threshold=ALL # Note: path is relative to the directory in which the service starts. -log4j.appender.haLog.File=halog-B.txt +log4j.appender.haLog.File=halog-A.txt log4j.appender.haLog.Append=true log4j.appender.haLog.layout=org.apache.log4j.PatternLayout log4j.appender.haLog.layout.ConversionPattern=%-5p: %d{HH:mm:ss,SSS} %r %X{hostname} %X{serviceUUID} %X{taskname} %X{timestamp} %X{resources} %t %l: %m%n \ No newline at end of file Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/zkClient.config =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/zkClient.config 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-jini/src/test/com/bigdata/journal/jini/ha/zkClient.config 2014-05-07 13:57:17 UTC (rev 8215) @@ -1,22 +1,6 @@ -/* Zookeeper client only configuration. +/* + * Zookeeper client configuration. */ -import java.io.File; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.util.UUID; - -import com.bigdata.util.NV; -import com.bigdata.util.config.NicUtil; -import com.bigdata.journal.Options; -import com.bigdata.journal.BufferMode; -import com.bigdata.journal.jini.ha.HAJournal; -import com.bigdata.jini.lookup.entry.*; -import com.bigdata.service.IBigdataClient; -import com.bigdata.service.AbstractTransactionService; -import com.bigdata.service.jini.*; -import com.bigdata.service.jini.lookup.DataServiceFilter; -import com.bigdata.service.jini.master.ServicesTemplate; -import com.bigdata.jini.start.config.*; import com.bigdata.jini.util.ConfigMath; import org.apache.zookeeper.ZooDefs; @@ -30,16 +14,6 @@ private static fedname = "benchmark"; - /* The logical service identifier shared by all members of the quorum. - * - * Note: The test fixture ignores this value. For the avoidance of - * doubt, the value is commented out. - */ - //private static logicalServiceId = "CI-HAJournal-1"; - - // zookeeper - static private sessionTimeout = (int)ConfigMath.s2ms(20); - } /* @@ -53,36 +27,16 @@ /* A comma separated list of host:port pairs, where the port is * the CLIENT port for the zookeeper server instance. */ - // standalone. servers = "localhost:2081"; - // ensemble -// servers = bigdata.zoo1+":2181" -// + ","+bigdata.zoo2+":2181" -// + ","+bigdata.zoo3+":2181" -// ; /* Session timeout (optional). */ - sessionTimeout = bigdata.sessionTimeout; + sessionTimeout = (int)ConfigMath.s2ms(20); - /* - * ACL for the zookeeper nodes created by the bigdata federation. - * - * Note: zookeeper ACLs are not transmitted over secure channels - * and are placed into plain text Configuration files by the - * ServicesManagerServer. - */ + // Zookeeper ACLs. acl = new ACL[] { new ACL(ZooDefs.Perms.ALL, new Id("world", "anyone")) }; - /* - * Note: Normally on the HAJournalServer component. Hacked in the test - * suite setup to look at the ZooKeeper component instead. - */ - - logicalServiceId = bigdata.logicalServiceId; - - replicationFactor = bigdata.replicationFactor; } Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/FilterNode.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/FilterNode.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/FilterNode.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -87,7 +87,7 @@ sb.append("\n"); sb.append(indent(indent)); - sb.append("FILTER( ").append(getValueExpressionNode()).append(" )"); + sb.append("FILTER( ").append(getValueExpressionNode().toString(indent+1)).append(" )"); // if (getQueryHints() != null) { // sb.append("\n"); Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/FunctionNode.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/FunctionNode.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/FunctionNode.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -2,6 +2,7 @@ import java.io.Serializable; import java.util.Collections; +import java.util.Iterator; import java.util.Map; import org.openrdf.model.URI; @@ -9,6 +10,7 @@ import com.bigdata.bop.BOp; import com.bigdata.bop.IValueExpression; import com.bigdata.bop.NV; +import com.bigdata.bop.BOp.Annotations; /** * AST node for anything which is neither a constant nor a variable, including @@ -171,7 +173,7 @@ */ /** - * Return <code>t1 AND t2</code> (aka EQ). + * Return <code>t1 AND t2</code>. */ static public FunctionNode AND(final ValueExpressionNode t1, final ValueExpressionNode t2) { @@ -182,7 +184,7 @@ } /** - * Return <code>t1 OR t2</code> (aka EQ). + * Return <code>t1 OR t2</code>. */ static public FunctionNode OR(final ValueExpressionNode t1, final ValueExpressionNode t2) { @@ -295,4 +297,35 @@ } + + /** + * Provides a pretty print representation with recursive descent. + */ + @Override + public String toString(int i) { + + final StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + final Integer bopId = (Integer) getProperty(Annotations.BOP_ID); + if (bopId != null) { + sb.append("[" + bopId + "]"); + } + sb.append("("); + int nwritten = 0; + final Iterator<BOp> itr = argIterator(); + while(itr.hasNext()) { + final BOp t = itr.next(); + if (nwritten > 0) + sb.append(','); + if (t == null) { + sb.append("<null>"); + } else { + sb.append(((IValueExpressionNode)t).toString(i+1)); + } + nwritten++; + } + sb.append(")"); + annotationsToString(sb, i); + return sb.toString(); + } } Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/IQueryNode.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/IQueryNode.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/IQueryNode.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -37,8 +37,11 @@ } + /** - * Pretty print with an indent. + * A string representation of a recursive structure with pretty-print indent. + * @param indent + * @return */ String toString(final int indent); Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/IValueExpressionNode.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/IValueExpressionNode.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/IValueExpressionNode.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -34,4 +34,11 @@ */ void invalidate(); + /** + * A string representation of a recursive structure with pretty-print indent. + * @param indent + * @return + */ + String toString(final int indent); + } Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/QueryBase.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/QueryBase.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/QueryBase.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -178,8 +178,13 @@ public void setConstruct(final ConstructNode construct) { setProperty(Annotations.CONSTRUCT, construct); - setQueryType(QueryType.CONSTRUCT); + if (construct != null) { + + setQueryType(QueryType.CONSTRUCT); + + } + } public void setProjection(final ProjectionNode projection) { Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/StatementPatternNode.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/StatementPatternNode.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/StatementPatternNode.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -574,7 +574,7 @@ if (getQueryHints() != null && !getQueryHints().isEmpty()) { sb.append("\n"); sb.append(indent(indent + 1)); - sb.append(Annotations.QUERY_HINTS); + shortenName(sb, Annotations.QUERY_HINTS); sb.append("="); sb.append(getQueryHints().toString()); } @@ -586,7 +586,7 @@ if (rangeCount != null) { sb.append("\n"); sb.append(indent(indent + 1)); - sb.append(AST2BOpBase.Annotations.ESTIMATED_CARDINALITY); + shortenName(sb, AST2BOpBase.Annotations.ESTIMATED_CARDINALITY); sb.append("="); sb.append(rangeCount.toString()); } @@ -594,7 +594,7 @@ if (keyOrder != null) { sb.append("\n"); sb.append(indent(indent + 1)); - sb.append(AST2BOpBase.Annotations.ORIGINAL_INDEX); + shortenName(sb, AST2BOpBase.Annotations.ORIGINAL_INDEX); sb.append("="); sb.append(keyOrder.toString()); } Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/SubqueryFunctionNodeBase.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/SubqueryFunctionNodeBase.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/SubqueryFunctionNodeBase.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -32,6 +32,7 @@ import org.openrdf.model.URI; import com.bigdata.bop.BOp; +import com.bigdata.bop.IValueExpression; /** * A special function node for modeling value expression nodes which are @@ -119,4 +120,9 @@ } + @Override + protected void annotationValueToString(final StringBuilder sb, final BOp val, int i) { + sb.append(val.toString(i)); + } + } Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/TermNode.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/TermNode.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/TermNode.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -88,5 +88,10 @@ return null; } + + @Override + public String toString(int i) { + return toShortString(); + } } Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/ValueExpressionNode.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/ValueExpressionNode.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/ValueExpressionNode.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -12,7 +12,7 @@ * @author <a href="mailto:tho...@us...">Bryan Thompson</a> * @version $Id$ */ -public class ValueExpressionNode extends ASTBase implements +public abstract class ValueExpressionNode extends ASTBase implements IValueExpressionNode { /** Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/optimizers/ASTUnionFiltersOptimizer.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/optimizers/ASTUnionFiltersOptimizer.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/optimizers/ASTUnionFiltersOptimizer.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -134,6 +134,8 @@ canOptimize = false; + break; + } else { union = (UnionNode) child; @@ -157,6 +159,8 @@ // something else in the group other than a union and filters canOptimize = false; + break; + } } Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/optimizers/AbstractJoinGroupOptimizer.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/optimizers/AbstractJoinGroupOptimizer.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/optimizers/AbstractJoinGroupOptimizer.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -27,6 +27,8 @@ package com.bigdata.rdf.sparql.ast.optimizers; +import java.util.Iterator; + import com.bigdata.bop.BOp; import com.bigdata.bop.IBindingSet; import com.bigdata.bop.bindingSet.ListBindingSet; @@ -188,20 +190,7 @@ final IValueExpressionNode ve = filter.getValueExpressionNode(); - if (ve instanceof SubqueryFunctionNodeBase) { - - final SubqueryFunctionNodeBase subqueryFunction = (SubqueryFunctionNodeBase) ve; - - final GraphPatternGroup<IGroupMemberNode> graphPattern = subqueryFunction - .getGraphPattern(); - - if (graphPattern != null) { - - optimize(ctx, sa, bSets, graphPattern); - - } - - } + optimize(ctx, sa, bSets, ve); } else if (child instanceof ArbitraryLengthPathNode) { @@ -274,6 +263,35 @@ } } + + private void optimize(final AST2BOpContext ctx, final StaticAnalysis sa, + final IBindingSet[] bSets, final IValueExpressionNode ve) { + if (ve instanceof SubqueryFunctionNodeBase) { + + final SubqueryFunctionNodeBase subqueryFunction = (SubqueryFunctionNodeBase) ve; + + final GraphPatternGroup<IGroupMemberNode> graphPattern = subqueryFunction + .getGraphPattern(); + + if (graphPattern != null) { + + optimize(ctx, sa, bSets, graphPattern); + + } + + } else { + Iterator<BOp> it = ((BOp)ve).argIterator(); + while (it.hasNext()) { + + BOp b = it.next(); + if (b instanceof IValueExpressionNode) { + + optimize(ctx, sa, bSets, (IValueExpressionNode)b); + + } + } + } + } /** * Subclasses can do the work of optimizing a join group here. Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/TestAST.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/TestAST.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/TestAST.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -39,6 +39,7 @@ import com.bigdata.bop.Var; import com.bigdata.bop.ap.Predicate; import com.bigdata.journal.ITx; +import com.bigdata.rdf.internal.IV; import com.bigdata.rdf.internal.VTE; import com.bigdata.rdf.internal.constraints.CompareBOp; import com.bigdata.rdf.internal.constraints.IVValueExpression; @@ -262,7 +263,7 @@ groupBy.addExpr(new AssignmentNode(new VarNode("s"), new VarNode("s"))); final HavingNode havingBy = new HavingNode(); - havingBy.addExpr(new ValueExpressionNode(new CompareBOp(Var.var("x"), + havingBy.addExpr(new LegacyTestValueExpressionNode(new CompareBOp(Var.var("x"), Var.var("y"), CompareOp.GT))); final OrderByNode orderBy = new OrderByNode(); @@ -331,7 +332,7 @@ } public FilterNode filter(final int id) { - return new FilterNode(new ValueExpressionNode(new Filter(id))); + return new FilterNode(new LegacyTestValueExpressionNode(new Filter(id))); } public Predicate pred(final int id) { @@ -345,8 +346,23 @@ return new Filter(id); } - - private static final class Filter extends XSDBooleanIVValueExpression { + /** + * @deprecated This was just for compatibility with SOp2ASTUtility. It is + * only used by the test suite now. + */ + @Deprecated + private static final class LegacyTestValueExpressionNode extends ValueExpressionNode { + private LegacyTestValueExpressionNode(IValueExpression<? extends IV> ve) { + super(ve); + } + + @Override + public String toString(int i) { + return toShortString(); + } + } + + private static final class Filter extends XSDBooleanIVValueExpression { /** * Modified: branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/optimizers/AbstractOptimizerTestCase.java =================================================================== --- branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/optimizers/AbstractOptimizerTestCase.java 2014-05-07 13:29:39 UTC (rev 8214) +++ branches/DEPLOYMENT_BRANCH_1_3_1/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/optimizers/AbstractOptimizerTestCase.java 2014-05-07 13:57:17 UTC (rev 8215) @@ -23,25 +23,29 @@ */ package com.bigdata.rdf.sparql.ast.optimizers; -import java.util.HashMap; -import java.util.Map; import org.openrdf.model.impl.URIImpl; import org.openrdf.query.algebra.StatementPattern.Scope; import com.bigdata.bop.IBindingSet; +import com.bigdata.bop.IValueExpression; +import com.bigdata.bop.IVariable; import com.bigdata.bop.ModifiableBOpBase; +import com.bigdata.journal.ITx; import com.bigdata.rdf.internal.IV; import com.bigdata.rdf.internal.constraints.IsBoundBOp; +import com.bigdata.rdf.internal.constraints.OrBOp; import com.bigdata.rdf.sparql.ast.ASTBase; import com.bigdata.rdf.sparql.ast.ASTContainer; import com.bigdata.rdf.sparql.ast.AbstractASTEvaluationTestCase; import com.bigdata.rdf.sparql.ast.ArbitraryLengthPathNode; import com.bigdata.rdf.sparql.ast.AssignmentNode; import com.bigdata.rdf.sparql.ast.ConstantNode; +import com.bigdata.rdf.sparql.ast.ExistsNode; import com.bigdata.rdf.sparql.ast.FilterNode; import com.bigdata.rdf.sparql.ast.FunctionNode; import com.bigdata.rdf.sparql.ast.FunctionRegistry; +import com.bigdata.rdf.sparql.ast.GlobalAnnotations; import com.bigdata.rdf.sparql.ast.GraphPatternGroup; import com.bigdata.rdf.sparql.ast.GroupMemberNodeBase; import com.bigdata.rdf.sparql.ast.IGroupMemberNode; @@ -50,6 +54,7 @@ import com.bigdata.rdf.sparql.ast.JoinGroupNode; import com.bigdata.rdf.sparql.ast.NamedSubqueryInclude; import com.bigdata.rdf.sparql.ast.NamedSubqueryRoot; +import com.bigdata.rdf.sparql.ast.NotExistsNode; import com.bigdata.rdf.sparql.ast.PathNode; import com.bigdata.rdf.sparql.ast.ValueExpressionNode; import com.bigdata.rd... [truncated message content] |