Class IndexBuilder


  • public class IndexBuilder
    extends Object
    Class to create/load indexes
    • Constructor Detail

      • IndexBuilder

        public IndexBuilder()
    • Method Detail

      • getBuilder

        public static IndexBuilder getBuilder()
        Return index bulder with default parameters
        Returns:
        index builder
      • setValInLeaf

        public IndexBuilder setValInLeaf​(boolean valInLeaf)
        Set value in leaf flag
        Parameters:
        valInLeaf - value in leaf flag
        Returns:
        current object to chaining
      • setSplitSeparator

        public IndexBuilder setSplitSeparator​(int splitSeparator)
        Set split separator
        Parameters:
        splitSeparator - split separator
        Returns:
        current object to chaining
      • setMergeSeparator

        public IndexBuilder setMergeSeparator​(int mergeSeparator)
        Set merge separator
        Parameters:
        mergeSeparator - merge separator
        Returns:
        current object to chaining
      • setT

        public IndexBuilder setT​(int t)
        Set T - with of BTree nodes
        Parameters:
        t - with of BTree nodes
        Returns:
        current object to chaining
      • setPreallocateFreeSpace

        public IndexBuilder setPreallocateFreeSpace​(int preallocateFreeSpace)
        Set preallocated space size (in bytes)
        Parameters:
        preallocateFreeSpace - preallocated space size
        Returns:
        current object to chaining
      • setThreadSafe

        public IndexBuilder setThreadSafe​(boolean threadSafe)
        Set thread safe in index level
        Parameters:
        threadSafe - thread safe flag
        Returns:
        current object to chaining
      • setValType

        public IndexBuilder setValType​(byte valType)
        Set value type
        Parameters:
        valType - value type
        Returns:
        current object to chaining
      • buildIndex

        public KeyValueStorage<?,​byte[]> buildIndex​(Database db,
                                                          String name)
        Build index with current index builder state parameters on specified database with specified name If index with same name already in specified database - it will be overrided.
        Parameters:
        db - database where index should be created
        name - index name
        Returns:
        new index
      • wrapTransactional

        public static final TransactionalKVS<?,​byte[]> wrapTransactional​(KeyValueStorage<?,​byte[]> kvs,
                                                                               Database database,
                                                                               String name)
        Wrap existed index to add transactional features
        Parameters:
        kvs - index to wrap
        database - database where kvs index placed
        name - name of kvs index
        Returns:
        transactional wrapper of kvs index