org.apache.directory.mavibot.btree

## Class BTreeFactory<K,V>

- java.lang.Object
- - org.apache.directory.mavibot.btree.BTreeFactory<K,V>

- Type Parameters:
    `K` - The B-tree key type
    `V` - The B-tree value type

      public class BTreeFactory<K,V>
      extends Object

  This class construct a B-tree from a serialized version of a B-tree. We need it to avoid exposing all the methods of the B-tree class.
  All its methods are static.
  Author:
    Apache Directory Project

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BTreeFactory()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <K,V> BTree<K,V>` | `createInMemoryBTree()` Creates a new in-memory B-tree, with no initialization.
    `static <K,V> BTree<K,V>` | `createInMemoryBTree(InMemoryBTreeConfiguration<K,V> configuration)` Creates a new in-memory B-tree using the BTreeConfiguration to initialize the B-tree
    `static <K,V> BTree<K,V>` | `createInMemoryBTree(String name, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer)` Creates a new in-memory B-tree using the parameters to initialize the B-tree
    `static <K,V> BTree<K,V>` | `createInMemoryBTree(String name, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer, boolean allowDuplicates)` Creates a new in-memory B-tree using the parameters to initialize the B-tree
    `static <K,V> BTree<K,V>` | `createInMemoryBTree(String name, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer, int pageSize)` Creates a new in-memory B-tree using the parameters to initialize the B-tree
    `static <K,V> BTree<K,V>` | `createInMemoryBTree(String name, String filePath, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer)` Creates a new in-memory B-tree using the parameters to initialize the B-tree
    `static <K,V> BTree<K,V>` | `createInMemoryBTree(String name, String filePath, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer, int pageSize)` Creates a new in-memory B-tree using the parameters to initialize the B-tree
    `static <K,V> BTree<K,V>` | `createInMemoryBTree(String name, String filePath, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer, int pageSize, boolean allowDuplicates)` Creates a new in-memory B-tree using the parameters to initialize the B-tree
    `static <K,V> BTree<K,V>` | `createPersistedBTree()` Creates a new persisted B-tree, with no initialization.
    `static <K,V> BTree<K,V>` | `createPersistedBTree(BTreeTypeEnum type)` Creates a new persisted B-tree, with no initialization.
    `static <K,V> BTree<K,V>` | `createPersistedBTree(PersistedBTreeConfiguration<K,V> configuration)` Creates a new persisted B-tree using the BTreeConfiguration to initialize the B-tree
    `static <K,V> BTree<K,V>` | `createPersistedBTree(String name, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer)` Creates a new persisted B-tree using the parameters to initialize the B-tree
    `static <K,V> BTree<K,V>` | `createPersistedBTree(String name, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer, boolean allowDuplicates)` Creates a new persisted B-tree using the parameters to initialize the B-tree
    `static <K,V> BTree<K,V>` | `createPersistedBTree(String name, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer, boolean allowDuplicates, int cacheSize)` Creates a new persisted B-tree using the parameters to initialize the B-tree
    `static <K,V> BTree<K,V>` | `createPersistedBTree(String name, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer, int pageSize)` Creates a new persisted B-tree using the parameters to initialize the B-tree
    `static <K,V> BTree<K,V>` | `createPersistedBTree(String name, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer, int pageSize, boolean allowDuplicates)` Creates a new persisted B-tree using the parameters to initialize the B-tree
    `static <K,V> BTree<K,V>` | `createPersistedBTree(String name, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer, int pageSize, boolean allowDuplicates, int cacheSize)` Creates a new persisted B-tree using the parameters to initialize the B-tree
    `static <K,V> void` | `setBtreeHeaderOffset(PersistedBTree<K,V> btree, long btreeHeaderOffset)` Sets the btreeHeader offset for a Persisted BTree

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BTreeFactory

          public BTreeFactory()

  - ### Method Detail

    - #### createPersistedBTree

          public static <K,V> BTree<K,V> createPersistedBTree()

      Creates a new persisted B-tree, with no initialization.
      Returns:
        a new B-tree instance

    - #### createPersistedBTree

          public static <K,V> BTree<K,V> createPersistedBTree(BTreeTypeEnum type)

      Creates a new persisted B-tree, with no initialization.
      Returns:
        a new B-tree instance

    - #### setBtreeHeaderOffset

          public static <K,V> void setBtreeHeaderOffset(PersistedBTree<K,V> btree,
                                        long btreeHeaderOffset)

      Sets the btreeHeader offset for a Persisted BTree
      Parameters:
        `btree` - The btree to update
        `btreeHeaderOffset` - The offset

    - #### createPersistedBTree

          public static <K,V> BTree<K,V> createPersistedBTree(PersistedBTreeConfiguration<K,V> configuration)

      Creates a new persisted B-tree using the BTreeConfiguration to initialize the B-tree
      Parameters:
        `configuration` - The configuration to use
      Returns:
        a new B-tree instance

    - #### createPersistedBTree

          public static <K,V> BTree<K,V> createPersistedBTree(String name,
                                              ElementSerializer<K> keySerializer,
                                              ElementSerializer<V> valueSerializer)

      Creates a new persisted B-tree using the parameters to initialize the B-tree
      Parameters:
        `name` - The B-tree's name
        `keySerializer` - Key serializer
        `valueSerializer` - Value serializer
      Returns:
        a new B-tree instance

    - #### createPersistedBTree

          public static <K,V> BTree<K,V> createPersistedBTree(String name,
                                              ElementSerializer<K> keySerializer,
                                              ElementSerializer<V> valueSerializer,
                                              boolean allowDuplicates)

      Creates a new persisted B-tree using the parameters to initialize the B-tree
      Parameters:
        `name` - The B-tree's name
        `keySerializer` - Key serializer
        `valueSerializer` - Value serializer
        `allowDuplicates` - Tells if the B-tree allows multiple value for a given key
      Returns:
        a new B-tree instance

    - #### createPersistedBTree

          public static <K,V> BTree<K,V> createPersistedBTree(String name,
                                              ElementSerializer<K> keySerializer,
                                              ElementSerializer<V> valueSerializer,
                                              boolean allowDuplicates,
                                              int cacheSize)

      Creates a new persisted B-tree using the parameters to initialize the B-tree
      Parameters:
        `name` - The B-tree's name
        `keySerializer` - Key serializer
        `valueSerializer` - Value serializer
        `allowDuplicates` - Tells if the B-tree allows multiple value for a given key
        `cacheSize` - The size to be used for this B-tree cache
      Returns:
        a new B-tree instance

    - #### createPersistedBTree

          public static <K,V> BTree<K,V> createPersistedBTree(String name,
                                              ElementSerializer<K> keySerializer,
                                              ElementSerializer<V> valueSerializer,
                                              int pageSize)

      Creates a new persisted B-tree using the parameters to initialize the B-tree
      Parameters:
        `name` - The B-tree's name
        `keySerializer` - Key serializer
        `valueSerializer` - Value serializer
        `pageSize` - Size of the page
      Returns:
        a new B-tree instance

    - #### createPersistedBTree

          public static <K,V> BTree<K,V> createPersistedBTree(String name,
                                              ElementSerializer<K> keySerializer,
                                              ElementSerializer<V> valueSerializer,
                                              int pageSize,
                                              boolean allowDuplicates)

      Creates a new persisted B-tree using the parameters to initialize the B-tree
      Parameters:
        `name` - The B-tree's name
        `keySerializer` - Key serializer
        `valueSerializer` - Value serializer
        `pageSize` - Size of the page
        `allowDuplicates` - Tells if the B-tree allows multiple value for a given key
      Returns:
        a new B-tree instance

    - #### createPersistedBTree

          public static <K,V> BTree<K,V> createPersistedBTree(String name,
                                              ElementSerializer<K> keySerializer,
                                              ElementSerializer<V> valueSerializer,
                                              int pageSize,
                                              boolean allowDuplicates,
                                              int cacheSize)

      Creates a new persisted B-tree using the parameters to initialize the B-tree
      Parameters:
        `name` - The B-tree's name
        `keySerializer` - Key serializer
        `valueSerializer` - Value serializer
        `pageSize` - Size of the page
        `allowDuplicates` - Tells if the B-tree allows multiple value for a given key
        `cacheSize` - The size to be used for this B-tree cache
      Returns:
        a new B-tree instance

    - #### createInMemoryBTree

          public static <K,V> BTree<K,V> createInMemoryBTree()

      Creates a new in-memory B-tree, with no initialization.
      Returns:
        a new B-tree instance

    - #### createInMemoryBTree

          public static <K,V> BTree<K,V> createInMemoryBTree(InMemoryBTreeConfiguration<K,V> configuration)

      Creates a new in-memory B-tree using the BTreeConfiguration to initialize the B-tree
      Parameters:
        `configuration` - The configuration to use
      Returns:
        a new B-tree instance

    - #### createInMemoryBTree

          public static <K,V> BTree<K,V> createInMemoryBTree(String name,
                                             ElementSerializer<K> keySerializer,
                                             ElementSerializer<V> valueSerializer)

      Creates a new in-memory B-tree using the parameters to initialize the B-tree
      Parameters:
        `name` - The B-tree's name
        `keySerializer` - Key serializer
        `valueSerializer` - Value serializer
      Returns:
        a new B-tree instance

    - #### createInMemoryBTree

          public static <K,V> BTree<K,V> createInMemoryBTree(String name,
                                             ElementSerializer<K> keySerializer,
                                             ElementSerializer<V> valueSerializer,
                                             boolean allowDuplicates)

      Creates a new in-memory B-tree using the parameters to initialize the B-tree
      Parameters:
        `name` - The B-tree's name
        `keySerializer` - Key serializer
        `valueSerializer` - Value serializer
        `allowDuplicates` - Tells if the B-tree allows multiple value for a given key
      Returns:
        a new B-tree instance

    - #### createInMemoryBTree

          public static <K,V> BTree<K,V> createInMemoryBTree(String name,
                                             ElementSerializer<K> keySerializer,
                                             ElementSerializer<V> valueSerializer,
                                             int pageSize)

      Creates a new in-memory B-tree using the parameters to initialize the B-tree
      Parameters:
        `name` - The B-tree's name
        `keySerializer` - Key serializer
        `valueSerializer` - Value serializer
        `pageSize` - Size of the page
      Returns:
        a new B-tree instance

    - #### createInMemoryBTree

          public static <K,V> BTree<K,V> createInMemoryBTree(String name,
                                             String filePath,
                                             ElementSerializer<K> keySerializer,
                                             ElementSerializer<V> valueSerializer)

      Creates a new in-memory B-tree using the parameters to initialize the B-tree
      Parameters:
        `name` - The B-tree's name
        `filePath` - The name of the data directory with absolute path
        `keySerializer` - Key serializer
        `valueSerializer` - Value serializer
      Returns:
        a new B-tree instance

    - #### createInMemoryBTree

          public static <K,V> BTree<K,V> createInMemoryBTree(String name,
                                             String filePath,
                                             ElementSerializer<K> keySerializer,
                                             ElementSerializer<V> valueSerializer,
                                             int pageSize)

      Creates a new in-memory B-tree using the parameters to initialize the B-tree
      Parameters:
        `name` - The B-tree's name
        `filePath` - The name of the data directory with absolute path
        `keySerializer` - Key serializer
        `valueSerializer` - Value serializer
        `pageSize` - Size of the page
      Returns:
        a new B-tree instance

    - #### createInMemoryBTree

          public static <K,V> BTree<K,V> createInMemoryBTree(String name,
                                             String filePath,
                                             ElementSerializer<K> keySerializer,
                                             ElementSerializer<V> valueSerializer,
                                             int pageSize,
                                             boolean allowDuplicates)

      Creates a new in-memory B-tree using the parameters to initialize the B-tree
      Parameters:
        `name` - The B-tree's name
        `filePath` - The name of the data directory with absolute path
        `keySerializer` - Key serializer
        `valueSerializer` - Value serializer
        `pageSize` - Size of the page
        `allowDuplicates` - Tells if the B-tree allows multiple value for a given key
      Returns:
        a new B-tree instance

Copyright © 2012–2015 Apache Mavibot Project Parent. All rights reserved.