Documentation of 'org.mapdb.StoreDirect' Java class
StoreDirect
org.mapdb

Class StoreDirect

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, Engine
    Direct Known Subclasses:
    StoreCached


    public class StoreDirect
    extends Store
    • Constructor Detail

      • StoreDirect

        public StoreDirect(java.lang.String fileName,
                           Volume.VolumeFactory volumeFactory,
                           Store.Cache cache,
                           int lockScale,
                           int lockingStrategy,
                           boolean checksum,
                           boolean compress,
                           byte[] password,
                           boolean readonly,
                           boolean snapshotEnable,
                           boolean fileLockDisable,
                           DataIO.HeartbeatFileLock fileLockHeartbeat,
                           java.util.concurrent.ScheduledExecutorService executor,
                           long startSize,
                           long sizeIncrement,
                           boolean recidReuseDisable)
      • StoreDirect

        public StoreDirect(java.lang.String fileName)
    • Method Detail

      • init

        public void init()
        Overrides:
        init in class Store
      • getCurrSize

        public long getCurrSize()
        Specified by:
        getCurrSize in class Store
      • getFreeSize

        public long getFreeSize()
        Specified by:
        getFreeSize in class Store
      • fileLoad

        public boolean fileLoad()
        Description copied from class: Store

        If underlying storage is memory-mapped-file, this method will try to load and precache all file data into disk cache. Most likely it will call MappedByteBuffer.load(), but could also read content of entire file etc This method will not pin data into memory, they might be removed at any time.

        Specified by:
        fileLoad in class Store
        Returns:
        true if this method did something, false if underlying storage does not support loading, or is already in-memory
      • preallocate

        public long preallocate()
        Description copied from interface: Engine
        Preallocates recid for not yet created record. It does not insert any data into it.
        Returns:
        new recid
      • put

        public <A> long put(A value,
                            Serializer<A> serializer)
        Description copied from interface: Engine
        Insert new record.
        Parameters:
        value - records to be added
        serializer - used to convert record into/from binary form
        Returns:
        recid (record identifier) under which record is stored.
      • close

        public void close()
        Description copied from interface: Engine

        Close store/cache. This method must be called before JVM exits to flush all caches and prevent store corruption. Also it releases resources used by MapDB (disk, memory..).

        Engine can no longer be used after this method was called. If Engine is used after closing, it may throw any exception including NullPointerException

        There is an configuration option DBMaker.Maker.closeOnJvmShutdown() which uses shutdown hook to automatically close Engine when JVM shutdowns.

      • commit

        public void commit()
        Description copied from interface: Engine
        Makes all changes made since the previous commit/rollback permanent. In transactional mode (on by default) it means creating journal file and replaying it to storage. In other modes it may flush disk caches or do nothing at all (check your config options)
      • rollback

        public void rollback()
                      throws java.lang.UnsupportedOperationException
        Description copied from interface: Engine
        Undoes all changes made in the current transaction. If transactions are disabled it throws UnsupportedOperationException.
        Throws:
        java.lang.UnsupportedOperationException - if transactions are disabled
      • canRollback

        public boolean canRollback()
        Returns:
        true if engine supports rollback
      • snapshot

        public Engine snapshot()
                        throws java.lang.UnsupportedOperationException
        Description copied from interface: Engine
        Returns read-only snapshot of data in Engine.
        Throws:
        java.lang.UnsupportedOperationException - if snapshots are not supported/enabled
      • clearCache

        public void clearCache()
        Description copied from interface: Engine
        clears any underlying cache
        Specified by:
        clearCache in interface Engine
        Overrides:
        clearCache in class Store
      • backup

        public void backup(java.io.OutputStream out,
                           boolean incremental)
        Specified by:
        backup in class Store
      • backupRestore

        public void backupRestore(java.io.InputStream[] ins)
        Specified by:
        backupRestore in class Store
      • compact

        public void compact()

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.