org.mapdb / StoreDirect


class StoreDirect : StoreDirectAbstract, StoreBinary

Store which uses binary storage (file, memory buffer...) and updates records on place. It has memory allocator, so it reuses space freed by deletes and updates.


<init> StoreDirect(file: String?, volumeFactory: VolumeFactory, isReadOnly: Boolean, fileLockWait: Long, isThreadSafe: Boolean, concShift: Int, allocateIncrement: Long, allocateStartSize: Long, fileDeleteAfterClose: Boolean, fileDeleteAfterOpen: Boolean, checksum: Boolean, checksumHeader: Boolean, checksumHeaderBypass: Boolean)

Store which uses binary storage (file, memory buffer...) and updates records on place. It has memory allocator, so it reuses space freed by deletes and updates.


freeSize val freeSize: AtomicLong
headVol val headVol: Volume
isReadOnly val isReadOnly: Boolean
volume val volume: Volume

Inherited Properties

checksum val checksum: Boolean
checksumHeader val checksumHeader: Boolean
checksumHeaderBypass val checksumHeaderBypass: Boolean
closed val closed: AtomicBoolean
concShift val concShift: Int
dataTail var dataTail: Long

end of last record

file val file: String?
fileDeleteAfterClose val fileDeleteAfterClose: Boolean
indexPages val indexPages: <ERROR CLASS>
isClosed open val isClosed: Boolean
isThreadSafe open val isThreadSafe: Boolean

returns true if this is configured to be thread safe

locks val locks: Array<ReadWriteLock?>
maxRecid var maxRecid: Long

maximal allocated recid

segmentCount val segmentCount: Int
segmentMask val segmentMask: Long
structuralLock val structuralLock: Lock?
volumeExistsAtStart val volumeExistsAtStart: Boolean
volumeFactory val volumeFactory: VolumeFactory


allocateNewIndexPage fun allocateNewIndexPage(): Long
allocateNewPage fun allocateNewPage(): Long
calculateFreeSize fun calculateFreeSize(): Long
close fun close(): Unit
commit fun commit(): Unit
compact fun compact(): Unit
compareAndSwap fun <R> compareAndSwap(recid: Long, expectedOldRecord: R?, newRecord: R?, serializer: Serializer<R>): Boolean
delete fun <R> delete(recid: Long, serializer: Serializer<R>): Unit
fileLoad fun fileLoad(): Boolean
freeSizeIncrement fun freeSizeIncrement(increment: Long): Unit
get fun <R> get(recid: Long, serializer: Serializer<R>): R?
getAllFiles fun getAllFiles(): Iterable<String>
getAllRecids fun getAllRecids(): LongIterator
getBinaryLong fun getBinaryLong(recid: Long, f: StoreBinaryGetLong): Long
getFreeSize fun getFreeSize(): Long
getIndexVal fun getIndexVal(recid: Long): Long
getTotalSize fun getTotalSize(): Long
linkedRecordDelete fun linkedRecordDelete(indexValue: Long): Unit
linkedRecordGet fun linkedRecordGet(indexValue: Long): ByteArray
linkedRecordPut fun linkedRecordPut(output: ByteArray, size: Int): Long
longStackFindEnd fun longStackFindEnd(pageOffset: Long, pos: Long): Long
longStackForEach fun longStackForEach(masterLinkOffset: Long, body: (Long) -> Unit): Unit
longStackNewChunk fun longStackNewChunk(masterLinkOffset: Long, prevPageOffset: Long, value: Long, valueSize: Long, recursive: Boolean): Unit
longStackPut fun longStackPut(masterLinkOffset: Long, value: Long, recursive: Boolean): Unit
longStackTake fun longStackTake(masterLinkOffset: Long, recursive: Boolean): Long
preallocate fun preallocate(): Long
put fun <R> put(record: R?, serializer: Serializer<R>): Long
setIndexVal fun setIndexVal(recid: Long, value: Long): Unit
update fun <R> update(recid: Long, record: R?, serializer: Serializer<R>): Unit
verify fun verify(): Unit

Inherited Functions

allocateData fun allocateData(size: Int, recursive: Boolean): Long
allocateRecid fun allocateRecid(): Long
assertNotClosed fun assertNotClosed(): Unit
calculateChecksum fun calculateChecksum(): Long
calculateHeaderChecksum fun calculateHeaderChecksum(): Int
deserialize fun <R> deserialize(serializer: Serializer<R>, di: DataInput2, size: Long): R?
fileHeaderCheck fun fileHeaderCheck(): Unit
fileHeaderCompose fun fileHeaderCompose(): Long
indexValCompose fun indexValCompose(size: Long, offset: Long, linked: Int, unused: Int, archive: Int): Long
indexValFlagArchive fun indexValFlagArchive(indexValue: Long): Boolean
indexValFlagLinked fun indexValFlagLinked(indexValue: Long): Boolean
indexValFlagUnused fun indexValFlagUnused(indexValue: Long): Boolean
loadIndexPages fun loadIndexPages(indexPages: <ERROR CLASS>): Unit
longStackMasterLinkOffset fun longStackMasterLinkOffset(size: Long): Long
recidToOffset fun recidToOffset(recid2: Long): Long
recidToSegment fun recidToSegment(recid: Long): Int
releaseData fun releaseData(size: Long, offset: Long, recursive: Boolean): Unit
releaseRecid fun releaseRecid(recid: Long): Unit
serialize fun <R> serialize(record: R?, serializer: Serializer<R>): DataOutput2?
storeHeaderCompose fun storeHeaderCompose(): Int

Companion Object Functions

make fun make(file: String? = null, volumeFactory: VolumeFactory = if(file==null) CC.DEFAULT_MEMORY_VOLUME_FACTORY else CC.DEFAULT_FILE_VOLUME_FACTORY, fileLockWait: Long = 0L, isReadOnly: Boolean = false, isThreadSafe: Boolean = true, concShift: Int = CC.STORE_DIRECT_CONC_SHIFT, allocateIncrement: Long = CC.PAGE_SIZE, allocateStartSize: Long = 0L, fileDeleteAfterClose: Boolean = false, fileDeleteAfterOpen: Boolean = false, checksum: Boolean = false, checksumHeader: Boolean = true, checksumHeaderBypass: Boolean = false): StoreDirect