R
- The generic type of the [R]elation elements.public abstract class AbstractElementBuffer<R> extends AbstractArrayBuffer<R>
IBuffer
of IRelation
elements whose target is
a mutation (insert, delete, or update) of some IMutableRelation
.IMutableRelation
Modifier and Type | Class and Description |
---|---|
static class |
AbstractElementBuffer.DeleteBuffer<R>
Buffer writes on
IMutableRelation.delete(IChunkedOrderedIterator)
when it is flushed . |
static class |
AbstractElementBuffer.InsertBuffer<R>
Buffer writes on
IMutableRelation.insert(IChunkedOrderedIterator)
when it is flushed . |
Modifier | Constructor and Description |
---|---|
protected |
AbstractElementBuffer(int capacity,
IMutableRelation<R> relation,
IKeyOrder<R> keyOrder,
IElementFilter<R> filter) |
Modifier and Type | Method and Description |
---|---|
protected abstract long |
flush(IChunkedOrderedIterator<R> itr)
Concrete implementations must process the elements, causing the
appropriate mutation on the target
IRelation . |
protected long |
flush(int n,
R[] a)
Delegates to
flush(IChunkedOrderedIterator) |
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). |
protected IMutableRelation<R> |
getRelation() |
protected AbstractElementBuffer(int capacity, IMutableRelation<R> relation, IKeyOrder<R> keyOrder, IElementFilter<R> filter)
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.protected IMutableRelation<R> getRelation()
protected IKeyOrder<R> getKeyOrder()
null
if you do not have a strong guarentee for
that order (from the ctor).protected final long flush(int n, R[] a)
flush(IChunkedOrderedIterator)
flush
in class AbstractArrayBuffer<R>
n
- The #of elements in the array.a
- The array of elements.AbstractArrayBuffer.flush()
, this is not a
cumulative counter, but the #of modified elements in the relation
for this operation only).protected abstract long flush(IChunkedOrderedIterator<R> itr)
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).
itr
- Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.