public class BufferManager extends Object implements MapDB.Serializers, AutoCloseable
Modifier and Type | Class and Description |
---|---|
static interface |
BufferManager.Buffer
A basic buffer interface.
|
protected class |
BufferManager.CloseableBuffer |
protected class |
BufferManager.CloseableDistinctBuffer<T> |
protected class |
BufferManager.CloseableQueueBuffer<T> |
protected class |
BufferManager.CloseableSortingBuffer<K,V> |
protected class |
BufferManager.CloseableSortingBufferWithDuplicates<K extends Comparable<K>,V> |
protected static class |
BufferManager.DbHolder |
static interface |
BufferManager.DistinctBuffer<T>
A buffer used to determine distinct values.
|
static interface |
BufferManager.DistinctBufferMaker<T>
An object use to create a new
BufferManager.DistinctBuffer . |
protected class |
BufferManager.MakeDistinctBuffer<T> |
protected class |
BufferManager.MakeOrderedBuffer<T> |
protected class |
BufferManager.MakeSortingBuffer<K,V> |
protected class |
BufferManager.MakeSortingWithDuplicatesBuffer<K extends Comparable<K>,V> |
static interface |
BufferManager.Predicate<T> |
static interface |
BufferManager.QueueBuffer<T>
A buffer that maintains the insertion order of a series of values.
|
static interface |
BufferManager.QueueBufferMaker<T>
An object use to create a new
BufferManager.DistinctBuffer . |
static interface |
BufferManager.SortingBuffer<SortType,RecordType>
A buffer used to sort values into ascending or descending order.
|
static interface |
BufferManager.SortingBufferMaker<SortType,RecordType>
An object use to create a new
BufferManager.SortingBuffer . |
Modifier | Constructor and Description |
---|---|
|
BufferManager(ExecutionContext context) |
protected |
BufferManager(ExecutionContext context,
Supplier<org.mapdb.DB> offheapDbSupplier,
Supplier<org.mapdb.DB> onheapDbSupplier) |
Modifier and Type | Method and Description |
---|---|
org.mapdb.BTreeKeySerializer<?> |
bTreeKeySerializerFor(Class<?> type,
Comparator<?> comparator,
boolean pack)
Obtain a serializer for the given key type.
|
org.mapdb.BTreeKeySerializer<?> |
bTreeKeySerializerFor(TypeSystem.TypeFactory<?> type,
boolean pack)
Obtain a serializer for the given key type.
|
void |
close() |
<T> BufferManager.DistinctBufferMaker<T> |
createDistinctBuffer(org.mapdb.Serializer<T> distinctSerializer)
Obtain a maker object that can create a new
BufferManager.DistinctBuffer . |
<T> BufferManager.QueueBufferMaker<T> |
createQueueBuffer(org.mapdb.Serializer<T> serializer)
Obtain a maker object that can create a new
BufferManager.QueueBuffer . |
<K,V> BufferManager.SortingBufferMaker<K,V> |
createSortingBuffer(org.mapdb.BTreeKeySerializer<K> keySerializer,
org.mapdb.Serializer<V> valueSerializer)
Obtain a maker object that can create a new
BufferManager.SortingBuffer that will keep a single values for any given key. |
<K extends Comparable<K>,V> |
createSortingWithDuplicatesBuffer(org.mapdb.Serializer<K> keySerializer,
Comparator<?> keyComparator,
org.mapdb.Serializer<V> valueSerializer)
Obtain a maker object that can create a new
BufferManager.SortingBuffer that can store multiple values for any given key. |
protected org.mapdb.DB |
db(boolean useHeap) |
protected void |
delete(String name,
boolean onHeap) |
org.mapdb.Serializer<?> |
nullSafeSerializerFor(Class<?> type)
Obtain a serializer for the given value type that can handle nulls.
|
org.mapdb.Serializer<?> |
nullSafeSerializerFor(TypeSystem.TypeFactory<?> type)
Obtain serializer for the given value type that can handle null values.
|
org.mapdb.Serializer<?> |
serializerFor(Class<?> type)
Obtain a serializer for the given value type.
|
org.mapdb.Serializer<?> |
serializerFor(TypeSystem.TypeFactory<?> type)
Obtain a serializer for the given value type.
|
public BufferManager(ExecutionContext context)
protected BufferManager(ExecutionContext context, Supplier<org.mapdb.DB> offheapDbSupplier, Supplier<org.mapdb.DB> onheapDbSupplier)
public void close()
close
in interface AutoCloseable
public <T> BufferManager.QueueBufferMaker<T> createQueueBuffer(org.mapdb.Serializer<T> serializer)
BufferManager.QueueBuffer
.serializer
- the serializer for the valuepublic <T> BufferManager.DistinctBufferMaker<T> createDistinctBuffer(org.mapdb.Serializer<T> distinctSerializer)
BufferManager.DistinctBuffer
.distinctSerializer
- the serializer for the distinct valuepublic <K,V> BufferManager.SortingBufferMaker<K,V> createSortingBuffer(org.mapdb.BTreeKeySerializer<K> keySerializer, org.mapdb.Serializer<V> valueSerializer)
BufferManager.SortingBuffer
that will keep a single values for any given key.keySerializer
- the serializer for the keysvalueSerializer
- the serializer for the valuespublic <K extends Comparable<K>,V> BufferManager.SortingBufferMaker<K,V> createSortingWithDuplicatesBuffer(org.mapdb.Serializer<K> keySerializer, Comparator<?> keyComparator, org.mapdb.Serializer<V> valueSerializer)
BufferManager.SortingBuffer
that can store multiple values for any given key.keySerializer
- the serializer for the keyskeyComparator
- the comparator for the keys, or null if natural ordering should be usedvalueSerializer
- the serializer for the valuespublic org.mapdb.Serializer<?> serializerFor(Class<?> type)
MapDB.Serializers
serializerFor
in interface MapDB.Serializers
type
- the type; may not be nullpublic org.mapdb.BTreeKeySerializer<?> bTreeKeySerializerFor(Class<?> type, Comparator<?> comparator, boolean pack)
MapDB.Serializers
bTreeKeySerializerFor
in interface MapDB.Serializers
type
- the type; may not be nullcomparator
- the comparator; may not be nullpack
- true if the serializer can/should pack keys together when possible, or false otherwisepublic org.mapdb.Serializer<?> nullSafeSerializerFor(Class<?> type)
MapDB.Serializers
nullSafeSerializerFor
in interface MapDB.Serializers
type
- the type; may not be nullpublic org.mapdb.Serializer<?> serializerFor(TypeSystem.TypeFactory<?> type)
type
- the type; may not be nullpublic org.mapdb.Serializer<?> nullSafeSerializerFor(TypeSystem.TypeFactory<?> type)
type
must itself still not be null, but the values
to be serialized type
- the type; may not be nullpublic org.mapdb.BTreeKeySerializer<?> bTreeKeySerializerFor(TypeSystem.TypeFactory<?> type, boolean pack)
type
- the type; may not be nullpack
- true if the serializer can/should pack keys together when possible, or false otherwiseprotected final org.mapdb.DB db(boolean useHeap)
protected final void delete(String name, boolean onHeap)
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.