com.bigdata.relation.rule.eval.pipeline
Class JoinTask.AccessPathTask

java.lang.Object
  extended by com.bigdata.relation.rule.eval.pipeline.JoinTask.AccessPathTask
All Implemented Interfaces:
Comparable<JoinTask.AccessPathTask>, Callable<Void>
Enclosing class:
JoinTask

protected class JoinTask.AccessPathTask
extends Object
implements Callable<Void>, Comparable<JoinTask.AccessPathTask>

Accepts an asBound IPredicate and a (non-empty) collection of IBindingSets each of which licenses the same asBound predicate for the current join dimension. The task obtains the corresponding IAccessPath and delegates each chunk visited on that IAccessPath to a JoinTask.ChunkTask. Note that optionals are also handled by this task.

Version:
$Id: JoinTask.java 3454 2010-08-20 19:00:43Z thompsonbry $
Author:
Bryan Thompson

Constructor Summary
JoinTask.AccessPathTask(IPredicate<?> predicate, Collection<IBindingSet> bindingSets)
          Evaluate an IBindingSet for the join dimension.
 
Method Summary
 Void call()
          Evaluate the accessPath against the bindingSets.
 int compareTo(JoinTask.AccessPathTask o)
          Imposes an order based on the fromKey for the IAccessPath associated with the task.
 boolean equals(JoinTask.AccessPathTask o)
          Return true iff the tasks are equivalent (same as bound predicate).
protected  byte[] getFromKey()
          Return the fromKey for the IAccessPath generated from the IBindingSet for this task.
protected  void handleJoin()
          A vectored pipeline join (chunk at a time processing).
protected  void handleStarJoin()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JoinTask.AccessPathTask

public JoinTask.AccessPathTask(IPredicate<?> predicate,
                               Collection<IBindingSet> bindingSets)
Evaluate an IBindingSet for the join dimension. When the task runs, it will pair each element visited on the IAccessPath with the asBound IPredicate. For each element visited, if the binding is acceptable for the constraints on the asBound IPredicate, then the task will emit one IBindingSet for each source IBindingSet.

Parameters:
predicate - The asBound IPredicate.
bindingSets - A collection of IBindingSets from the source join dimension that all result in the same asBound IPredicate.
Method Detail

getFromKey

protected byte[] getFromKey()
Return the fromKey for the IAccessPath generated from the IBindingSet for this task.

TODO:
layered access paths do not expose a fromKey. This information is always available from the SPOKeyOrder and that method will be raised into the IKeyOrder. Unfortunately, for RDF we also need to know if triples or quads are being used, which is a property on the container or the relation.

equals

public boolean equals(JoinTask.AccessPathTask o)
Return true iff the tasks are equivalent (same as bound predicate). This test may be used to eliminate duplicates that arise when different source JoinTasks generate the same IBindingSet.

Parameters:
o - Another task.
Returns:
if the as bound predicate is equals().

toString

public String toString()
Overrides:
toString in class Object

call

public Void call()
          throws Exception
Evaluate the accessPath against the bindingSets. If nothing is accepted and IPredicate.isOptional() then the bindingSets is output anyway (this implements the semantics of OPTIONAL).

Specified by:
call in interface Callable<Void>
Returns:
null.
Throws:
BufferClosedException - if there is an attempt to output a chunk of IBindingSets or ISolutions and the output buffer is an IBlockingBuffer (true for all join dimensions exception the lastJoin and also true for query on the lastJoin) and that IBlockingBuffer has been closed.
Exception

handleJoin

protected void handleJoin()
A vectored pipeline join (chunk at a time processing).


handleStarJoin

protected void handleStarJoin()

compareTo

public int compareTo(JoinTask.AccessPathTask o)
Imposes an order based on the fromKey for the IAccessPath associated with the task.

Specified by:
compareTo in interface Comparable<JoinTask.AccessPathTask>
Parameters:
o -
Returns:


Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.