com.bigdata.rdf.spo
Class SPOAccessPath

java.lang.Object
  extended by com.bigdata.relation.accesspath.AbstractAccessPath<ISPO>
      extended by com.bigdata.rdf.spo.SPOAccessPath
All Implemented Interfaces:
IAccessPath<ISPO>, Iterable<ISPO>

public class SPOAccessPath
extends AbstractAccessPath<ISPO>

IAccessPath implementation for an SPORelation.

Version:
$Id: SPOAccessPath.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Nested Class Summary
 
Nested classes/interfaces inherited from class com.bigdata.relation.accesspath.AbstractAccessPath
AbstractAccessPath.ElementFilter<R>
 
Field Summary
 
Fields inherited from class com.bigdata.relation.accesspath.AbstractAccessPath
chunkCapacity, chunkOfChunksCapacity, filter, flags, fullyBufferedReadThreshold, indexManager, keyOrder, log, MAX_FULLY_BUFFERED_READ_LIMIT, ndx, predicate, timestamp
 
Constructor Summary
SPOAccessPath(IIndexManager indexManager, long timestamp, IPredicate<ISPO> predicate, IKeyOrder<ISPO> keyOrder, IIndex ndx, int flags, int chunkOfChunksCapacity, int chunkCapacity, int fullyBufferedReadThreshold)
          Variant does not require the SPORelation to have been materialized.
SPOAccessPath(SPORelation relation, IPredicate<ISPO> predicate, IKeyOrder<ISPO> keyOrder, IIndex ndx, int flags, int chunkOfChunksCapacity, int chunkCapacity, int fullyBufferedReadThreshold)
          Variant when the SPORelation has already been materialized.
 
Method Summary
 SPOAccessPath bindContext(long c)
          Return a new SPOAccessPath where the context position has been bound to the specified constant.
 long get(int index)
          Return the constant bound on the predicate for this access path at the specified index -or- NULL iff the predicate is not bound at that position.
 SPOPredicate getPredicate()
          The constraints on the IAccessPath.
 SPORelation getRelation()
          Resolved lazily if not specified to the ctor.
protected  SPOTupleSerializer getTupleSerializer()
           
 SPOAccessPath init()
          Required post-ctor initialization.
 long removeAll()
          Overridden to delegate to AbstractTripleStore.removeStatements(IChunkedOrderedIterator) in order to (a) write on all access paths; (b) handle statement identifiers, including truth maintenance for statement identifiers; and (c) if justifications are being maintained, then retract justifications having no support once the statements visitable by this access path have been retracted.
 
Methods inherited from class com.bigdata.relation.accesspath.AbstractAccessPath
assertInitialized, asynchronousIterator, getChunkCapacity, getChunkOfChunksCapacity, getFromKey, getIndex, getIndexManager, getKeyOrder, getTimestamp, getToKey, isEmpty, isFullyBoundForKey, iterator, iterator, iterator, rangeCount, rangeIterator, rangeIterator, setFromKey, setToKey, synchronousIterator, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SPOAccessPath

public SPOAccessPath(SPORelation relation,
                     IPredicate<ISPO> predicate,
                     IKeyOrder<ISPO> keyOrder,
                     IIndex ndx,
                     int flags,
                     int chunkOfChunksCapacity,
                     int chunkCapacity,
                     int fullyBufferedReadThreshold)
Variant when the SPORelation has already been materialized.

Note: Filters should be specified when the IAccessPath is constructed so that they will be evaluated on the data service rather than materializing the elements and then filtering them. This can be accomplished by adding the filter as a constraint on the predicate when specifying the access path.

Parameters:
predicate -
keyOrder -
ndx -
flags -

SPOAccessPath

public SPOAccessPath(IIndexManager indexManager,
                     long timestamp,
                     IPredicate<ISPO> predicate,
                     IKeyOrder<ISPO> keyOrder,
                     IIndex ndx,
                     int flags,
                     int chunkOfChunksCapacity,
                     int chunkCapacity,
                     int fullyBufferedReadThreshold)
Variant does not require the SPORelation to have been materialized. This is useful when you want an IAccessPath for a specific index partition.

Parameters:
indexManager -
timestamp -
predicate -
keyOrder -
ndx -
flags -
chunkOfChunksCapacity -
chunkCapacity -
fullyBufferedReadThreshold -
Method Detail

get

public long get(int index)
Return the constant bound on the predicate for this access path at the specified index -or- NULL iff the predicate is not bound at that position.

Parameters:
index - The index.
Returns:
Either the bound value -or- NULL iff the index is unbound for the predicate for this access path.

getTupleSerializer

protected SPOTupleSerializer getTupleSerializer()

init

public SPOAccessPath init()
Description copied from class: AbstractAccessPath
Required post-ctor initialization.

Overrides:
init in class AbstractAccessPath<ISPO>
Returns:
this

getRelation

public SPORelation getRelation()
Resolved lazily if not specified to the ctor.


removeAll

public long removeAll()
Overridden to delegate to AbstractTripleStore.removeStatements(IChunkedOrderedIterator) in order to (a) write on all access paths; (b) handle statement identifiers, including truth maintenance for statement identifiers; and (c) if justifications are being maintained, then retract justifications having no support once the statements visitable by this access path have been retracted.

Specified by:
removeAll in interface IAccessPath<ISPO>
Overrides:
removeAll in class AbstractAccessPath<ISPO>
Returns:
The #of elements that were removed.

getPredicate

public SPOPredicate getPredicate()
Description copied from interface: IAccessPath
The constraints on the IAccessPath.

Specified by:
getPredicate in interface IAccessPath<ISPO>
Overrides:
getPredicate in class AbstractAccessPath<ISPO>

bindContext

public SPOAccessPath bindContext(long c)
Return a new SPOAccessPath where the context position has been bound to the specified constant. The context position MUST be a variable. All instances of that variable will be replaced by the specified constant. This is used to constrain an access path to each graph in the set of default graphs when evaluating a SPARQL query against the "default graph".

Note: The added constraint may mean that a different index provides more efficient traversal. For scale-out, this means that the data may be on different index partition.

Parameters:
c - The context term identifier.
Returns:
The constrained IAccessPath.


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