org.mapdb
Class DB.BTreeMapMaker

java.lang.Object
  extended by org.mapdb.DB.BTreeMapMaker
Enclosing class:
DB

public class DB.BTreeMapMaker
extends Object


Field Summary
protected  Comparator comparator
           
protected  boolean counter
           
protected  BTreeKeySerializer keySerializer
           
protected  String name
           
protected  int nodeSize
           
protected  boolean pumpIgnoreDuplicates
           
protected  Fun.Function1 pumpKeyExtractor
           
protected  int pumpPresortBatchSize
           
protected  Iterator pumpSource
           
protected  Fun.Function1 pumpValueExtractor
           
protected  Serializer valueSerializer
           
protected  boolean valuesOutsideNodes
           
 
Constructor Summary
DB.BTreeMapMaker(String name)
           
 
Method Summary
 DB.BTreeMapMaker comparator(Comparator<?> comparator)
          comparator used to sort keys.
 DB.BTreeMapMaker counterEnable()
          by default collection does not have counter, without counter updates are faster, but entire collection needs to be traversed to count items.
 DB.BTreeMapMaker keySerializer(BTreeKeySerializer<?> keySerializer)
          keySerializer used to convert keys into/from binary form.
 DB.BTreeMapMaker keySerializerWrap(Serializer<?> serializer)
          keySerializer used to convert keys into/from binary form.
<K,V> BTreeMap<K,V>
make()
           
<V> BTreeMap<Long,V>
makeLongMap()
          creates map optimized for using zero or positive `Long` keys
<K,V> BTreeMap<K,V>
makeOrGet()
           
<V> BTreeMap<String,V>
makeStringMap()
          creates map optimized for using `String` keys
 DB.BTreeMapMaker nodeSize(int nodeSize)
          nodeSize maximal size of node, larger node causes overflow and creation of new BTree node.
<K> DB.BTreeMapMaker
pumpIgnoreDuplicates()
          If source iteretor contains an duplicate key, exception is thrown.
 DB.BTreeMapMaker pumpPresort(int batchSize)
           
<K,V> DB.BTreeMapMaker
pumpSource(Iterator<Fun.Tuple2<K,V>> entriesSource)
           
<K,V> DB.BTreeMapMaker
pumpSource(Iterator<K> keysSource, Fun.Function1<V,K> valueExtractor)
           
 DB.BTreeMapMaker valueSerializer(Serializer<?> valueSerializer)
          valueSerializer used to convert values into/from binary form.
 DB.BTreeMapMaker valuesOutsideNodesEnable()
          by default values are stored inside BTree Nodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected final String name

nodeSize

protected int nodeSize

valuesOutsideNodes

protected boolean valuesOutsideNodes

counter

protected boolean counter

keySerializer

protected BTreeKeySerializer keySerializer

valueSerializer

protected Serializer valueSerializer

comparator

protected Comparator comparator

pumpSource

protected Iterator pumpSource

pumpKeyExtractor

protected Fun.Function1 pumpKeyExtractor

pumpValueExtractor

protected Fun.Function1 pumpValueExtractor

pumpPresortBatchSize

protected int pumpPresortBatchSize

pumpIgnoreDuplicates

protected boolean pumpIgnoreDuplicates
Constructor Detail

DB.BTreeMapMaker

public DB.BTreeMapMaker(String name)
Method Detail

nodeSize

public DB.BTreeMapMaker nodeSize(int nodeSize)
nodeSize maximal size of node, larger node causes overflow and creation of new BTree node. Use large number for small keys, use small number for large keys.


valuesOutsideNodesEnable

public DB.BTreeMapMaker valuesOutsideNodesEnable()
by default values are stored inside BTree Nodes. Large values should be stored outside of BTreeNodes


counterEnable

public DB.BTreeMapMaker counterEnable()
by default collection does not have counter, without counter updates are faster, but entire collection needs to be traversed to count items.


keySerializer

public DB.BTreeMapMaker keySerializer(BTreeKeySerializer<?> keySerializer)
keySerializer used to convert keys into/from binary form.


keySerializerWrap

public DB.BTreeMapMaker keySerializerWrap(Serializer<?> serializer)
keySerializer used to convert keys into/from binary form. This wraps ordinary serializer, with no delta packing used


valueSerializer

public DB.BTreeMapMaker valueSerializer(Serializer<?> valueSerializer)
valueSerializer used to convert values into/from binary form.


comparator

public DB.BTreeMapMaker comparator(Comparator<?> comparator)
comparator used to sort keys.


pumpSource

public <K,V> DB.BTreeMapMaker pumpSource(Iterator<K> keysSource,
                                         Fun.Function1<V,K> valueExtractor)

pumpSource

public <K,V> DB.BTreeMapMaker pumpSource(Iterator<Fun.Tuple2<K,V>> entriesSource)

pumpPresort

public DB.BTreeMapMaker pumpPresort(int batchSize)

pumpIgnoreDuplicates

public <K> DB.BTreeMapMaker pumpIgnoreDuplicates()
If source iteretor contains an duplicate key, exception is thrown. This options will only use firts key and ignore any consequentive duplicates.


make

public <K,V> BTreeMap<K,V> make()

makeOrGet

public <K,V> BTreeMap<K,V> makeOrGet()

makeStringMap

public <V> BTreeMap<String,V> makeStringMap()
creates map optimized for using `String` keys


makeLongMap

public <V> BTreeMap<Long,V> makeLongMap()
creates map optimized for using zero or positive `Long` keys



Copyright © 2014. All Rights Reserved.