All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.mapdb.volume.ReadOnlyVolumeFactory.kt Maven / Gradle / Ivy

Go to download

MapDB provides concurrent Maps, Sets and Queues backed by disk storage or off-heap memory. It is a fast, scalable and easy to use embedded Java database.

There is a newer version: 3.1.0
Show newest version
package org.mapdb.volume

/**
 * Wraps volume factory and returns volume as readonly
 */
class ReadOnlyVolumeFactory(protected val volfab:VolumeFactory): VolumeFactory() {

    override fun exists(file: String?): Boolean {
        return volfab.exists(file)
    }

    override fun makeVolume(file: String?, readOnly: Boolean, fileLockWait:Long, sliceShift: Int, initSize: Long, fixedSize: Boolean): Volume? {
        val volume = volfab.makeVolume(file, readOnly, fileLockWait, sliceShift, initSize, fixedSize)
        return ReadOnlyVolume(volume)
    }

    override fun handlesReadonly(): Boolean {
        return true
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy