ArbitraryIndexedFileBuilder

class ArbitraryIndexedFileBuilder(file: File) : IndexedFileBuilder

A helper class capable of reading any variety of IndexedFile.

Constructors

Link copied to clipboard
fun ArbitraryIndexedFileBuilder(file: File)

Functions

Link copied to clipboard
open fun defaultVersionCheck(a: Int, b: Int): Boolean

The default function for checking version compatibility.

Link copied to clipboard
fun openOrCreate(    fileReference: File,     forWriting: Boolean,     setupActionIfNew: IndexedFile.() -> Unit = { },     softCacheSize: Int = defaultSoftCacheSize,     strongCacheSize: Int = defaultStrongCacheSize,     pageSize: Int = defaultPageSize,     compressionBlockSize: Int = defaultCompressionThreshold,     version: Int = defaultVersion,     versionCheck: (Int, Int) -> Boolean = ::defaultVersionCheck): IndexedFile

Create new file of this type, with type-specific parameters overridden as specified.

Properties

Link copied to clipboard
open val defaultCompressionThreshold: Int = 32768

The default minimum number of uncompressed bytes at the virtualized end of an indexed file. Once this many uncompressed bytes have accumulated from complete records, they will be compressed together. Since uncompressed data must be written to a master node during each commit, this value should not be too large; but since compression efficiency improves as block size increases, this value should not be too small. A small multiple of the defaultPageSize is optimal.

Link copied to clipboard
open val defaultPageSize: Int = 4096

The default page size of the IndexedFile. This should be a multiple of the disk page size for good performance; for best performance, it should be a common multiple of the disk page size and the memory page size.

Link copied to clipboard
open val defaultSoftCacheSize: Int = 200

The default capacity of the cache of uncompressed records. A number of records equal to the delta between this value and that of defaultStrongCacheSize will be discarded from the cache by the garbage collector when a low-water mark is reached.

Link copied to clipboard
open val defaultStrongCacheSize: Int = 100

The default memory-insensitive capacity of the cache of uncompressed records.

Link copied to clipboard
open val defaultVersion: Int = 3

The default version of the IndexedFile being built. As representational improvements show up over the years, this value should be incremented, while maintaining suitable backward compatible for some time. Currently, only version 3 is supported.

Link copied to clipboard
val headerBytes: ByteArray

The NUL-terminated header bytes that uniquely identify a particular usage of the core IndexedFile technology. The NUL byte is added here, and should not be supplied by the constructor.