/** * Creates a new in-memory B-tree, with no initialization. * * @return a new B-tree instance */ public static <K, V> BTree<K, V> createInMemoryBTree() { BTree<K, V> btree = new InMemoryBTree<K, V>(); return btree; }
/** * Creates a new in-memory B-tree using the BTreeConfiguration to initialize the * B-tree * * @param configuration The configuration to use * @return a new B-tree instance */ public static <K, V> BTree<K, V> createInMemoryBTree( InMemoryBTreeConfiguration<K, V> configuration ) { BTree<K, V> btree = new InMemoryBTree<K, V>( configuration ); return btree; }
/** * Creates a new in-memory B-tree using the parameters to initialize the * B-tree * * @param name The B-tree's name * @param keySerializer Key serializer * @param valueSerializer Value serializer * @return a new B-tree instance */ public static <K, V> BTree<K, V> createInMemoryBTree( String name, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer ) { InMemoryBTreeConfiguration<K, V> configuration = new InMemoryBTreeConfiguration<K, V>(); configuration.setName( name ); configuration.setKeySerializer( keySerializer ); configuration.setValueSerializer( valueSerializer ); configuration.setPageSize( BTree.DEFAULT_PAGE_SIZE ); configuration.setAllowDuplicates( BTree.FORBID_DUPLICATES ); configuration.setWriteBufferSize( BTree.DEFAULT_WRITE_BUFFER_SIZE ); BTree<K, V> btree = new InMemoryBTree<K, V>( configuration ); return btree; }
/** * Creates a new in-memory B-tree using the parameters to initialize the * B-tree * * @param name The B-tree's name * @param keySerializer Key serializer * @param valueSerializer Value serializer * @param pageSize Size of the page * @return a new B-tree instance */ public static <K, V> BTree<K, V> createInMemoryBTree( String name, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer, int pageSize ) { InMemoryBTreeConfiguration<K, V> configuration = new InMemoryBTreeConfiguration<K, V>(); configuration.setName( name ); configuration.setKeySerializer( keySerializer ); configuration.setValueSerializer( valueSerializer ); configuration.setPageSize( pageSize ); configuration.setAllowDuplicates( BTree.FORBID_DUPLICATES ); configuration.setWriteBufferSize( BTree.DEFAULT_WRITE_BUFFER_SIZE ); BTree<K, V> btree = new InMemoryBTree<K, V>( configuration ); return btree; }
/** * Creates a new in-memory B-tree using the parameters to initialize the * B-tree * * @param name The B-tree's name * @param keySerializer Key serializer * @param valueSerializer Value serializer * @param allowDuplicates Tells if the B-tree allows multiple value for a given key * @return a new B-tree instance */ public static <K, V> BTree<K, V> createInMemoryBTree( String name, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer, boolean allowDuplicates ) { InMemoryBTreeConfiguration<K, V> configuration = new InMemoryBTreeConfiguration<K, V>(); configuration.setName( name ); configuration.setKeySerializer( keySerializer ); configuration.setValueSerializer( valueSerializer ); configuration.setPageSize( BTree.DEFAULT_PAGE_SIZE ); configuration.setAllowDuplicates( allowDuplicates ); configuration.setWriteBufferSize( BTree.DEFAULT_WRITE_BUFFER_SIZE ); BTree<K, V> btree = new InMemoryBTree<K, V>( configuration ); return btree; }
/** * Creates a new in-memory B-tree using the parameters to initialize the * B-tree * * @param name The B-tree's name * @param filePath The name of the data directory with absolute path * @param keySerializer Key serializer * @param valueSerializer Value serializer * @return a new B-tree instance */ public static <K, V> BTree<K, V> createInMemoryBTree( String name, String filePath, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer ) { InMemoryBTreeConfiguration<K, V> configuration = new InMemoryBTreeConfiguration<K, V>(); configuration.setName( name ); configuration.setFilePath( filePath ); configuration.setKeySerializer( keySerializer ); configuration.setValueSerializer( valueSerializer ); configuration.setPageSize( BTree.DEFAULT_PAGE_SIZE ); configuration.setAllowDuplicates( BTree.FORBID_DUPLICATES ); configuration.setWriteBufferSize( BTree.DEFAULT_WRITE_BUFFER_SIZE ); BTree<K, V> btree = new InMemoryBTree<K, V>( configuration ); return btree; }
/** * Creates a new in-memory B-tree using the parameters to initialize the * B-tree * * @param name The B-tree's name * @param filePath The name of the data directory with absolute path * @param keySerializer Key serializer * @param valueSerializer Value serializer * @param pageSize Size of the page * @return a new B-tree instance */ public static <K, V> BTree<K, V> createInMemoryBTree( String name, String filePath, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer, int pageSize ) { InMemoryBTreeConfiguration<K, V> configuration = new InMemoryBTreeConfiguration<K, V>(); configuration.setName( name ); configuration.setFilePath( filePath ); configuration.setKeySerializer( keySerializer ); configuration.setValueSerializer( valueSerializer ); configuration.setPageSize( pageSize ); configuration.setAllowDuplicates( BTree.FORBID_DUPLICATES ); configuration.setWriteBufferSize( BTree.DEFAULT_WRITE_BUFFER_SIZE ); BTree<K, V> btree = new InMemoryBTree<K, V>( configuration ); return btree; }
/** * Creates a new in-memory B-tree using the parameters to initialize the * B-tree * * @param name The B-tree's name * @param filePath The name of the data directory with absolute path * @param keySerializer Key serializer * @param valueSerializer Value serializer * @param pageSize Size of the page * @param allowDuplicates Tells if the B-tree allows multiple value for a given key * @return a new B-tree instance */ public static <K, V> BTree<K, V> createInMemoryBTree( String name, String filePath, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer, int pageSize, boolean allowDuplicates ) { InMemoryBTreeConfiguration<K, V> configuration = new InMemoryBTreeConfiguration<K, V>(); configuration.setName( name ); configuration.setFilePath( filePath ); configuration.setKeySerializer( keySerializer ); configuration.setValueSerializer( valueSerializer ); configuration.setPageSize( pageSize ); configuration.setAllowDuplicates( allowDuplicates ); configuration.setWriteBufferSize( BTree.DEFAULT_WRITE_BUFFER_SIZE ); BTree<K, V> btree = new InMemoryBTree<K, V>( configuration ); return btree; }