Interface Importer

All Superinterfaces:
AutoCloseable, Closeable

@ThreadSafe public interface Importer extends Closeable
Allows to run an import. For performance reasons, imports are run without transactions.

Since import is multi threaded, implementations must be thread-safe.

  • Method Details

    • clearTree

      void clearTree(TreeName treeName)
      Clears the tree whose name is provided. Ensures that an empty tree with the given name exists. If the tree already exists, all the data it contains will be deleted. If not, an empty tree will be created.
      Parameters:
      treeName - name of the tree to clear
    • put

      void put(TreeName treeName, ByteString key, ByteString value)
      Creates a record with the provided key and value in the tree identified by the provided name. At the end of this method, the record is visible by read(TreeName, ByteString) and openCursor(TreeName) methods of this instance. The record is guaranteed to be persisted only after close().
      Parameters:
      treeName - the tree name
      key - the new record's key
      value - the new record's value
    • read

      ByteString read(TreeName treeName, ByteString key)
      Reads the record's value associated to the provided key, in the tree whose name is provided.
      Parameters:
      treeName - the tree name
      key - the record's key
      Returns:
      the record's value, or null if none exists
    • openCursor

      Opens a cursor on the tree whose name is provided. Cursors are predictable only if there is no pending put(TreeName, ByteString, ByteString) operations. Indeed, once opened, cursors might not reflect changes.
      Parameters:
      treeName - the tree name
      Returns:
      a new cursor
    • close

      void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable