Class Store


  • public final class Store
    extends java.lang.Object
    A store with open tables.
    • Constructor Detail

      • Store

        public Store​(Database db,
                     byte[] key)
        Creates the store.
        Parameters:
        db - the database
        key - for file encryption
    • Method Detail

      • getInvalidExpressionTypeException

        public static DbException getInvalidExpressionTypeException​(java.lang.String param,
                                                                    Typed e)
        Gets a SQL exception meaning the type of expression is invalid or unknown.
        Parameters:
        param - the name of the parameter
        e - the expression
        Returns:
        the exception
      • getMvStore

        public MVStore getMvStore()
      • getTable

        public MVTable getTable​(java.lang.String tableName)
        Get MVTable by table name.
        Parameters:
        tableName - table name
        Returns:
        MVTable
      • createTable

        public MVTable createTable​(CreateTableData data)
        Create a table.
        Parameters:
        data - CreateTableData
        Returns:
        table created
      • removeTable

        public void removeTable​(MVTable table)
        Remove a table.
        Parameters:
        table - the table
      • flush

        public void flush()
        Store all pending changes.
      • closeImmediately

        public void closeImmediately()
        Close the store, without persisting changes.
      • removeTemporaryMaps

        public void removeTemporaryMaps​(java.util.BitSet objectIds)
        Remove all temporary maps.
        Parameters:
        objectIds - the ids of the objects to keep
      • nextTemporaryMapName

        public java.lang.String nextTemporaryMapName()
        Get the name of the next available temporary map.
        Returns:
        the map name
      • prepareCommit

        public void prepareCommit​(SessionLocal session,
                                  java.lang.String transactionName)
        Prepare a transaction.
        Parameters:
        session - the session
        transactionName - the transaction name (may be null)
      • getInDoubtTransactions

        public java.util.ArrayList<InDoubtTransaction> getInDoubtTransactions()
      • setCacheSize

        public void setCacheSize​(int kb)
        Set the maximum memory to be used by the cache.
        Parameters:
        kb - the maximum size in KB
      • sync

        public void sync()
        Force the changes to disk.
      • compactFile

        public void compactFile​(int maxCompactTime)
        Compact the database file, that is, compact blocks that have a low fill rate, and move chunks next to each other. This will typically shrink the database file. Changes are flushed to the file, and old chunks are overwritten.
        Parameters:
        maxCompactTime - the maximum time in milliseconds to compact
      • close

        public void close​(int allowedCompactionTime)
        Close the store. Pending changes are persisted.
        Parameters:
        allowedCompactionTime - time (in milliseconds) allotted for store housekeeping activity, 0 means none, -1 means unlimited time (i.e.full compaction)
      • statisticsStart

        public void statisticsStart()
        Start collecting statistics.
      • statisticsEnd

        public java.util.Map<java.lang.String,​java.lang.Integer> statisticsEnd()
        Stop collecting statistics.
        Returns:
        the statistics