From: <tho...@us...> - 2014-02-22 18:22:41
|
Revision: 7868 http://sourceforge.net/p/bigdata/code/7868 Author: thompsonbry Date: 2014-02-22 18:22:38 +0000 (Sat, 22 Feb 2014) Log Message: ----------- IPredicate.asBound() - javadoc. now allows a null return. BOpContext.bind() - the bind() version associated with the IElement based PipelineJoin code path has been deprecated. PipelineJoin: - the handleJoin() method has been deprecated. It is associated with the IElement process rather than "solutions" based AP reads. - the code in the BindingSetConsumerTask has been modified to accomodate the possible null return from SPOPreciate.asBound() when the SPOPredicate is associated with an RDR access path (the SID variable is defined). Incoming binding sets that cause SPOPredicate.asBound() to fail will cause the join to fail for that source solution. For these cases, the join for that source solution is simply not run (we do not create the associated AccessPathTest). @see #815 (RDR query does too much work) Modified Paths: -------------- branches/RDR/bigdata/src/java/com/bigdata/bop/BOpContext.java branches/RDR/bigdata/src/java/com/bigdata/bop/IPredicate.java branches/RDR/bigdata/src/java/com/bigdata/bop/join/PipelineJoin.java Modified: branches/RDR/bigdata/src/java/com/bigdata/bop/BOpContext.java =================================================================== --- branches/RDR/bigdata/src/java/com/bigdata/bop/BOpContext.java 2014-02-21 20:04:18 UTC (rev 7867) +++ branches/RDR/bigdata/src/java/com/bigdata/bop/BOpContext.java 2014-02-22 18:22:38 UTC (rev 7868) @@ -707,7 +707,7 @@ * * @throws NullPointerException * if an argument is <code>null</code>. - */ + */ @Deprecated// with PipelineJoin.JoinTask.AccessPathTask.handleJoin() final static public boolean bind(final IPredicate<?> pred, final IConstraint[] constraints, final Object e, final IBindingSet bindings) { Modified: branches/RDR/bigdata/src/java/com/bigdata/bop/IPredicate.java =================================================================== --- branches/RDR/bigdata/src/java/com/bigdata/bop/IPredicate.java 2014-02-21 20:04:18 UTC (rev 7867) +++ branches/RDR/bigdata/src/java/com/bigdata/bop/IPredicate.java 2014-02-22 18:22:38 UTC (rev 7868) @@ -622,6 +622,12 @@ * * @param bindingSet * The binding set. + * + * @return The as-bound {@link IPredicate} -or- <code>null</code> if the + * {@link IPredicate} can not be unified with the + * {@link IBindingSet}. + * + * @see #815 (RDR query does too much work) */ public IPredicate<E> asBound(IBindingSet bindingSet); Modified: branches/RDR/bigdata/src/java/com/bigdata/bop/join/PipelineJoin.java =================================================================== --- branches/RDR/bigdata/src/java/com/bigdata/bop/join/PipelineJoin.java 2014-02-21 20:04:18 UTC (rev 7867) +++ branches/RDR/bigdata/src/java/com/bigdata/bop/join/PipelineJoin.java 2014-02-22 18:22:38 UTC (rev 7868) @@ -1012,6 +1012,22 @@ // constrain the predicate to the given bindings. IPredicate<E> asBound = predicate.asBound(bindingSet); + if (asBound == null) { + + /* + * This can happen for a SIDS mode join if some of the + * (s,p,o,[c]) and SID are bound on entry and they can not + * be unified. For example, the s position might be + * inconsistent with the Subject that can be decoded from + * the SID binding. + * + * @see #815 (RDR query does too much work) + */ + + return; + + } + if (partitionId != -1) { /* @@ -1049,10 +1065,11 @@ if (coalesceAccessPaths) { - /* - * Aggregate the source bindingSets that license the same - * asBound predicate. - */ + /* + * Aggregate the source bindingSets that license the same + * asBound predicate. The predicates in the keys of this map + * as "as-bound". + */ final Map<IPredicate<E>, Collection<IBindingSet>> map = combineBindingSets(chunk); /* @@ -1069,7 +1086,7 @@ * Do not coalesce access paths. */ - tasks = new JoinTask.AccessPathTask[chunk.length]; + final List<AccessPathTask> tmp = new LinkedList<AccessPathTask>(); for (int i = 0; i < chunk.length; i++) { @@ -1078,8 +1095,24 @@ // constrain the predicate to the given bindings. IPredicate<E> asBound = predicate.asBound(bindingSet); - if (partitionId != -1) { + if (asBound == null) { + /* + * This can happen for a SIDS mode join if some of the + * (s,p,o,[c]) and SID are bound on entry and they can not + * be unified. For example, the s position might be + * inconsistent with the Subject that can be decoded from + * the SID binding. + * + * @see #815 (RDR query does too much work) + */ + + continue; + + } + + if (partitionId != -1) { + /* * Constrain the predicate to the desired index * partition. @@ -1095,11 +1128,15 @@ } - tasks[i] = new AccessPathTask(asBound, Collections - .singletonList(bindingSet)); + tmp.add(new AccessPathTask(asBound, Collections + .singletonList(bindingSet))); } + // Exact fit array. + tasks = tmp + .toArray(new JoinTask.AccessPathTask[tmp.size()]); + } return tasks; @@ -1143,8 +1180,24 @@ // constrain the predicate to the given bindings. IPredicate<E> asBound = predicate.asBound(bindingSet); - if (partitionId != -1) { + if (asBound == null) { + /* + * This can happen for a SIDS mode join if some of the + * (s,p,o,[c]) and SID are bound on entry and they can not + * be unified. For example, the s position might be + * inconsistent with the Subject that can be decoded from + * the SID binding. + * + * @see #815 (RDR query does too much work) + */ + + continue; + + } + + if (partitionId != -1) { + /* * Constrain the predicate to the desired index * partition. @@ -1597,7 +1650,7 @@ /** * A vectored pipeline join (chunk at a time processing) for * {@link IElement}s. - */ + */@Deprecated // by handleJoin2() protected void handleJoin() { final long cutoffLimit = predicate.getProperty( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |