|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.helidb.util.bplus.FileBackedNodeRepositoryBuilder<K,V>
K
- The type of keys in the repository.V
- The type of values in the repository.public class FileBackedNodeRepositoryBuilder<K,V>
Builder for FileBackedNodeRepository
objects. The client using this
object must set a key and a value Serializer
. Otherwise, it contains
default values for the rest of the properties.
FileBackedNodeRepository
Field Summary | |
---|---|
static int |
DEFAULT_BUFFER_SIZE
The default size of internal buffers used by FileBackedNodeRepository.writeContentsTo(java.io.OutputStream) is
65536 bytes. |
static int |
DEFAULT_INTERNAL_POINTER_SIZE
The default size of internal pointers in the node repository is four bytes. |
static boolean |
DEFAULT_LEAF_NODE_HAS_POINTERS_TO_ADJACENT_NODES
By default, leaf nodes have pointers to their adjacent leaf nodes. |
static NodeSizeStrategy |
DEFAULT_NODE_SIZE_STRATEGY
The default NodeSizeStrategy is a
FixedSizeNodeSizeStrategy with a node size of 4096 bytes. |
Constructor Summary | |
---|---|
FileBackedNodeRepositoryBuilder()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final NodeSizeStrategy DEFAULT_NODE_SIZE_STRATEGY
NodeSizeStrategy
is a
FixedSizeNodeSizeStrategy
with a node size of 4096 bytes.
public static final int DEFAULT_INTERNAL_POINTER_SIZE
2^(4*8) = 4294967296
bytes.
public static final int DEFAULT_BUFFER_SIZE
FileBackedNodeRepository.writeContentsTo(java.io.OutputStream)
is
65536 bytes.
public static final boolean DEFAULT_LEAF_NODE_HAS_POINTERS_TO_ADJACENT_NODES
Iterable
, but uses more disk space.
Constructor Detail |
---|
public FileBackedNodeRepositoryBuilder()
Method Detail |
---|
public FileBackedNodeRepositoryBuilder<K,V> setNodeSizeStrategy(NodeSizeStrategy nss)
NodeSizeStrategy
.
nss
- A NodeSizeStrategy
this
public FileBackedNodeRepositoryBuilder<K,V> setLeafNodeHasPointersToAdjacentNodes(boolean b)
b
- Do leaf nodes have pointers to adjacent leaf nodes?
this
.public FileBackedNodeRepositoryBuilder<K,V> setKeySerializer(Serializer<K> s) throws IllegalArgumentException
Serializer
. It must support null
values and
produce byte arrays of a constant size.
s
- The key serializer.
this
.
IllegalArgumentException
- If the serializer does not support
null
values or if it does not produce byte arrays of a constant
size.public FileBackedNodeRepositoryBuilder<K,V> setValueSerializer(Serializer<V> s) throws IllegalArgumentException
Serializer
. It must produce byte arrays of a constant
size.
s
- The value serializer.
this
.
IllegalArgumentException
- If the serializer does not produce byte
arrays of a constant size.public FileBackedNodeRepositoryBuilder<K,V> setInternalPointerSize(int i) throws IllegalArgumentException
FileBackedNodeRepository
.
i
- The size of internal pointers.
this
.
IllegalArgumentException
- If the pointer size is not in the range
1 <= i <= 8
.public FileBackedNodeRepositoryBuilder<K,V> setLogAdapterHolder(LogAdapterHolder lah)
lah
- A log adapter holder.
this
.public FileBackedNodeRepositoryBuilder<K,V> setBufferSize(int size) throws IllegalArgumentException
FileBackedNodeRepository.writeContentsTo(java.io.OutputStream)
.
size
- The buffer size.
this
.
IllegalArgumentException
- If the buffer size is less than 1.public FileBackedNodeRepositoryBuilder<K,V> setKeyComparator(Comparator<? super K> cmp)
Comparator
used for comparing keys. This can be set to
null
to use the keys' natural order if they are
Comparable
.
cmp
- The key comparator.
this
.public FileBackedNodeRepositoryBuilder<K,V> setStartPosOfData(long pos) throws IllegalArgumentException
IllegalArgumentException
public NodeRepository<K> create(ReadWritableFile f, boolean readOnly)
NodeRepositoryBuilder
create
in interface NodeRepositoryBuilder<K>
f
- The file containing the node repository data.readOnly
- Should the repository be read only?
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |