/** * Creates a new persisted B-tree, with no initialization. * * @return a new B-tree instance */ public static <K, V> BTree<K, V> createPersistedBTree() { BTree<K, V> btree = new PersistedBTree<K, V>(); return btree; }
/** * Creates a new persisted 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> createPersistedBTree( PersistedBTreeConfiguration<K, V> configuration ) { BTree<K, V> btree = new PersistedBTree<K, V>( configuration ); return btree; }
/** * Creates a new persisted B-tree, with no initialization. * * @return a new B-tree instance */ public static <K, V> BTree<K, V> createPersistedBTree( BTreeTypeEnum type ) { BTree<K, V> btree = new PersistedBTree<K, V>(); ( ( AbstractBTree<K, V> ) btree ).setType( type ); return btree; }
/** * Creates a B-tree and automatically adds it to the list of managed btrees * * @param name the name of the B-tree * @param keySerializer key serializer * @param valueSerializer value serializer * @param allowDuplicates flag for allowing duplicate keys * @return a managed B-tree * @throws IOException If we weren't able to update the file on disk * @throws BTreeAlreadyManagedException If the B-tree is already managed */ @SuppressWarnings("all") public <K, V> BTree<K, V> addBTree( String name, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer, boolean allowDuplicates ) throws IOException, BTreeAlreadyManagedException { PersistedBTreeConfiguration config = new PersistedBTreeConfiguration(); config.setName( name ); config.setKeySerializer( keySerializer ); config.setValueSerializer( valueSerializer ); config.setAllowDuplicates( allowDuplicates ); BTree btree = new PersistedBTree( config ); manage( btree ); if ( LOG_CHECK.isDebugEnabled() ) { MavibotInspector.check( this ); } return btree; }
/** * Creates a new persisted 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 * @param allowDuplicates Tells if the B-tree allows multiple value for a given key * @param cacheSize The size to be used for this B-tree cache * @return a new B-tree instance */ public static <K, V> BTree<K, V> createPersistedBTree( String name, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer, int pageSize, boolean allowDuplicates, int cacheSize ) { PersistedBTreeConfiguration<K, V> configuration = new PersistedBTreeConfiguration<K, V>(); configuration.setName( name ); configuration.setKeySerializer( keySerializer ); configuration.setValueSerializer( valueSerializer ); configuration.setPageSize( pageSize ); configuration.setAllowDuplicates( allowDuplicates ); configuration.setCacheSize( cacheSize ); configuration.setWriteBufferSize( BTree.DEFAULT_WRITE_BUFFER_SIZE ); BTree<K, V> btree = new PersistedBTree<K, V>( configuration ); return btree; }
/** * Creates a new persisted 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> createPersistedBTree( String name, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer, int pageSize ) { PersistedBTreeConfiguration<K, V> configuration = new PersistedBTreeConfiguration<K, V>(); configuration.setName( name ); configuration.setKeySerializer( keySerializer ); configuration.setValueSerializer( valueSerializer ); configuration.setPageSize( pageSize ); configuration.setAllowDuplicates( BTree.FORBID_DUPLICATES ); configuration.setCacheSize( PersistedBTree.DEFAULT_CACHE_SIZE ); configuration.setWriteBufferSize( BTree.DEFAULT_WRITE_BUFFER_SIZE ); BTree<K, V> btree = new PersistedBTree<K, V>( configuration ); return btree; }
/** * Creates a new persisted 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 * @param cacheSize The size to be used for this B-tree cache * @return a new B-tree instance */ public static <K, V> BTree<K, V> createPersistedBTree( String name, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer, boolean allowDuplicates, int cacheSize ) { PersistedBTreeConfiguration<K, V> configuration = new PersistedBTreeConfiguration<K, V>(); configuration.setName( name ); configuration.setKeySerializer( keySerializer ); configuration.setValueSerializer( valueSerializer ); configuration.setPageSize( BTree.DEFAULT_PAGE_SIZE ); configuration.setAllowDuplicates( allowDuplicates ); configuration.setCacheSize( cacheSize ); configuration.setWriteBufferSize( BTree.DEFAULT_WRITE_BUFFER_SIZE ); BTree<K, V> btree = new PersistedBTree<K, V>( configuration ); return btree; }
/** * Creates a new persisted 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> createPersistedBTree( String name, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer ) { PersistedBTreeConfiguration<K, V> configuration = new PersistedBTreeConfiguration<K, V>(); configuration.setName( name ); configuration.setKeySerializer( keySerializer ); configuration.setValueSerializer( valueSerializer ); configuration.setPageSize( BTree.DEFAULT_PAGE_SIZE ); configuration.setAllowDuplicates( BTree.FORBID_DUPLICATES ); configuration.setCacheSize( PersistedBTree.DEFAULT_CACHE_SIZE ); configuration.setWriteBufferSize( BTree.DEFAULT_WRITE_BUFFER_SIZE ); BTree<K, V> btree = new PersistedBTree<K, V>( configuration ); return btree; }
/** * Creates a new persisted 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> createPersistedBTree( String name, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer, boolean allowDuplicates ) { PersistedBTreeConfiguration<K, V> configuration = new PersistedBTreeConfiguration<K, V>(); configuration.setName( name ); configuration.setKeySerializer( keySerializer ); configuration.setValueSerializer( valueSerializer ); configuration.setPageSize( BTree.DEFAULT_PAGE_SIZE ); configuration.setAllowDuplicates( allowDuplicates ); configuration.setCacheSize( PersistedBTree.DEFAULT_CACHE_SIZE ); configuration.setWriteBufferSize( BTree.DEFAULT_WRITE_BUFFER_SIZE ); BTree<K, V> btree = new PersistedBTree<K, V>( configuration ); return btree; }
/** * Creates a new persisted 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 * @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> createPersistedBTree( String name, ElementSerializer<K> keySerializer, ElementSerializer<V> valueSerializer, int pageSize, boolean allowDuplicates ) { PersistedBTreeConfiguration<K, V> configuration = new PersistedBTreeConfiguration<K, V>(); configuration.setName( name ); configuration.setKeySerializer( keySerializer ); configuration.setValueSerializer( valueSerializer ); configuration.setPageSize( pageSize ); configuration.setAllowDuplicates( allowDuplicates ); configuration.setCacheSize( PersistedBTree.DEFAULT_CACHE_SIZE ); configuration.setWriteBufferSize( BTree.DEFAULT_WRITE_BUFFER_SIZE ); BTree<K, V> btree = new PersistedBTree<K, V>( configuration ); return btree; }