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

Class StoreAppend

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, Engine


    public class StoreAppend
    extends Store
    append only store
    • Constructor Detail

      • StoreAppend

        public StoreAppend(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
      • canSnapshot

        public boolean canSnapshot()
        Specified by:
        canSnapshot in interface Engine
        Overrides:
        canSnapshot in class Store
        Returns:
        true if engine can create read-only snapshots
      • 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
      • compact

        public void compact()
      • backup

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

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

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.