V
- object type of values to be serialized into the collection being builtpublic interface BlueCollectionBuilder<K extends BlueKey,V extends java.io.Serializable>
BlueCollection
classModifier and Type | Method and Description |
---|---|
BlueCollection<V> |
build() |
BlueCollectionBuilder<K,V> |
withOptimizedClasses(java.util.Collection<java.lang.Class<? extends java.io.Serializable>> classesToRegister)
Registers classesToRegister with the serializer to make serialization and deserialization faster and more compact, then returns itself.
|
BlueCollectionBuilder<K,V> |
withSegmentSize(SegmentSize<K> segmentSize)
Requests a specific segment size to use for the collection.
|
BlueCollectionBuilder<K,V> withOptimizedClasses(java.util.Collection<java.lang.Class<? extends java.io.Serializable>> classesToRegister)
classesToRegister
- classes that will be stored as values, in values, or in keys inside this collection.BlueCollectionBuilder<K,V> withSegmentSize(SegmentSize<K> segmentSize) throws BlueDbException
segmentSize
- the requested segment size for the collection. Values of the collection are grouped into segments and
values in a segment can be vacuumed into a single file. Therefore, segment size will affect how fast you can access
a specific value in a segment and how many i-nodes (files and directories) the collection will use on disk. This will be
ignored if the collection already exists. In the future BlueDB might support migrating from one segment size to another.BlueDbException
- if the requested segment size is invalidBlueCollection<V> build() throws BlueDbException
BlueCollection
or else builds a new one if none existsBlueDbException
- if any problems are encountered, such as the collection already existing with a different type