com.bigdata.relation.accesspath
Class AbstractElementBuffer<R>
java.lang.Object
com.bigdata.relation.accesspath.AbstractArrayBuffer<R>
com.bigdata.relation.accesspath.AbstractElementBuffer<R>
- Type Parameters:
R - The generic type of the [R]elation elements.
- All Implemented Interfaces:
- IBuffer<R>
- Direct Known Subclasses:
- AbstractElementBuffer.DeleteBuffer, AbstractElementBuffer.InsertBuffer
public abstract class AbstractElementBuffer<R>
- extends AbstractArrayBuffer<R>
Base class for IBuffer of IRelation elements whose target is
a mutation (insert, delete, or update) of some IMutableRelation.
- Version:
- $Id: AbstractElementBuffer.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 |
AbstractElementBuffer
protected AbstractElementBuffer(int capacity,
IMutableRelation<R> relation,
IKeyOrder<R> keyOrder,
IElementFilter<R> filter)
- Parameters:
capacity - The buffer capacity.relation - The target relation.keyOrder - The natural order in which the elements will appear in the
buffer -or- null if you do not have a
strong guarantee for that order.filter - An optional filter for keeping elements out of the buffer.
getRelation
protected IMutableRelation<R> getRelation()
getKeyOrder
protected IKeyOrder<R> getKeyOrder()
- The natural order in which the elements will appear in the buffer -or-
null if you do not have a strong guarentee for
that order (from the ctor).
flush
protected final long flush(int n,
R[] a)
- Delegates to
flush(IChunkedOrderedIterator)
- Specified by:
flush in class AbstractArrayBuffer<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<R> itr)
- Concrete implementations must process the elements, causing the
appropriate mutation on the target
IRelation.
Note: The elements generally appear in an arbitrary order and need to be
sorted into ordered chunks using IKeyOrder.getComparator() for
the desired natural order(s).
- Parameters:
itr -
- Returns:
- The #of elements that were modified in the backing relation when
the buffer was flushed
Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.