Interface Database

  • All Known Implementing Classes:
    DatabaseImpl, DatabaseInMemory

    public interface Database
    Database store unlimit number of index, manage engines and so on...
    • Method Detail

      • sync

        void sync()
        Sync complete database to file(s)
      • close

        void close()
        Close database (with sync and correct close resources)
      • detachStorage

        void detachStorage()
        Close file descriptors, used by databse
      • attachStorage

        void attachStorage()
        Reopen file descriptors, used by database
      • dropIndex

        void dropIndex​(String name)
        Unregister index from descriptions chain
        Parameters:
        name -
      • addIndex

        void addIndex​(KeyValueStorage kvs,
                      String name)
        Register kvs index (builded on these database) in descriptions chain
        Parameters:
        kvs - index to register
      • getIndex

        KeyValueStorage getIndex​(String name)
        Get registered index by name
        Parameters:
        name - index name
        Returns:
        index or null (if it doesn't registered)
      • getCache

        ITreeCache getCache()
        Get database internal cache
        Returns:
        database cache
      • getEngine

        Engine getEngine()
        Get database internal engine
        Returns:
        database engine
      • getNextSegmentId

        int getNextSegmentId()
        Get first free (in these database) segment id. Method mark segment as used
        Returns:
        free segment id
      • getIndexCount

        int getIndexCount()
        Get total number of registered index
        Returns:
      • drop

        void drop()
        Drop database (drop caches, detach and delete files)
      • getOpenState

        int getOpenState()
        Get database open status
        Returns:
        database OPEN_STATE