Interface SQLitePersistence<O,​A extends Comparable<A>>

    • Method Detail

      • getConnection

        Connection getConnection​(Index<?> index,
                                 QueryOptions queryOptions)
        Returns a Connection to the SQLite database used for persistence.
        Parameters:
        index - The Index requesting the connection.
        queryOptions - The query options for the request
        Returns:
        The Connection
      • getBytesUsed

        long getBytesUsed()
        Returns:
        The number of bytes used to persist the collection and/or indexes.
      • compact

        void compact()
        Compacts the underlying persistence, which returns unused memory or disk space to the operating system.
      • expand

        void expand​(long numBytes)
        Expands the underlying persistence by the given number of bytes in a single operation. This will usually result in the persistence being expanded into an additional contiguous chunk of memory or region on disk.

        After this method returns, the operating system will report that the memory or disk space used for persistence has increased by this amount, but internally the space will simply be reserved for future use. The reserved space will be used to store objects added to the collection subsequently, without needing to request more memory from the OS ad-hoc.

        This can reduce fragmentation of the persistence file on some OS filesystems, especially if used prior to bulk imports when the persistence is on a non-SSD disk.