com.bigdata.relation.rule.eval
Class AbstractSolutionBuffer<R>
java.lang.Object
com.bigdata.relation.accesspath.AbstractArrayBuffer<ISolution<R>[]>
com.bigdata.relation.rule.eval.AbstractSolutionBuffer<R>
- Type Parameters:
R - The generic type of the [R]elation elements.
- All Implemented Interfaces:
- IBuffer<ISolution<R>[]>
- Direct Known Subclasses:
- AbstractSolutionBuffer.DeleteSolutionBuffer, AbstractSolutionBuffer.InsertSolutionBuffer, RDFJoinNexus.InsertSPOAndJustificationBuffer
public abstract class AbstractSolutionBuffer<R>
- extends AbstractArrayBuffer<ISolution<R>[]>
Base class for IBuffer whose target is a mutation (insert, delete, or
update) of some IMutableRelation.
Note that this buffers chunks of ISolutions NOT relation
elements.
- Version:
- $Id: AbstractSolutionBuffer.java 2265 2009-10-26 12:51:06Z thompsonbry $
- Author:
- Bryan Thompson
- See Also:
IMutableRelation
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractSolutionBuffer
protected AbstractSolutionBuffer(int capacity,
IMutableRelation<R> relation)
- Parameters:
capacity -
getRelation
protected IMutableRelation<R> getRelation()
flush
protected final long flush(int n,
ISolution<R>[][] a)
- Combines chunks of solutions together into a single chunk and then
delegates to
flush(IChunkedOrderedIterator).
Note: Combining chunks together is a huge performance win if the source
chunks tend to be small (100). For example, this is true for scale-out
joins such as LUBM U1 EDS. There the performance gain is better than
20:1.
- Specified by:
flush in class AbstractArrayBuffer<ISolution<R>[]>
- Parameters:
n - The #of elements in the array.a - The array of elements.
- Returns:
- The #of elements that were modified in the backing relation when
the buffer was flushed (unlike
AbstractArrayBuffer.flush(), this is not a
cumulative counter, but the #of modified elements in the relation
for this operation only).
flush
protected abstract long flush(IChunkedOrderedIterator<ISolution<R>> itr)
- Concrete implementations must process the
ISolutions, causing
the appropriate mutation on the target IRelation.
Note: The ISolutions generally appear in an arbitrary order.
They can either be resolved to IRelation elements or be sorted
into ordered ISolution chunks using a SolutionComparator.
- Parameters:
itr - The iterator (the order of the elements is unknown).
- Returns:
- The #of elements that were modified in the backing relation when
the buffer was flushed
Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.