class FileBPlusTree[K, V] extends BPlusTree[K, V] with FileBPlusTreeFormat
An on-disk B+ Tree implementation.
- K
- the type of the keys contained in this map. 
- V
- the type of the values associated with the keys. 
- Alphabetic
- By Inheritance
- FileBPlusTree
- FileBPlusTreeFormat
- BPlusTree
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- 
      
      
      
        
      
    
      
        
        new
      
      
        FileBPlusTree(filename: String, order: Int, synchronous: Boolean = false)(implicit arg0: (K) ⇒ Ordered[K])
      
      
      creates an object to provide access to the root B+ Tree contained within the file at filenamewith a branching factor oforder.creates an object to provide access to the root B+ Tree contained within the file at filenamewith a branching factor oforder. The on-disk tree's order must be equal toorderor an exception will be thrown. This is the constructor that would normally be used to access a B+ tree file.- filename
- path to the file to contain the tree. The file created is completely self contained: if the file alread exists (and - newfileis- false) then the object opens the file and provides continued access to the tree
- order
- the branching factor (maximum number of branches in an internal node) of the tree 
- synchronous
- truecauses any changes to the file to be written to disk immediately,- falseis the default
 
- 
      
      
      
        
      
    
      
        
        new
      
      
        FileBPlusTree(file: RandomAccessFile, tree: Long, order: Int)(implicit arg0: (K) ⇒ Ordered[K])
      
      
      creates an object to provide access to a B+ Tree contained within filewith it's tree descriptor record at offsettreeand with a branching factor oforder.creates an object to provide access to a B+ Tree contained within filewith it's tree descriptor record at offsettreeand with a branching factor oforder. The on-disk tree's order must be equal toorderor an exception will be thrown. This constructor is used internally to access a B+ tree that is a value in another B+ tree.- file
- the - java.io.RandomAccessFileto be used to access the B+ tree
- tree
- the offset within - fileof the tree's descriptor record
- order
- the branching factor (maximum number of branches in an internal node) of the tree 
 
Type Members
- 
      
      
      
        
      
    
      
        
        type
      
      
        N = Long
      
      
      Abstract node type. Abstract node type. For in-memory implementations this would probably be the actual node class and for on-disk it would likely be the file pointer where the node is stored. - Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
- Note
- Comparing two nodes for equality is required to be - truewhen they point to the same node.
 
Value Members
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        !=(arg0: Any): Boolean
      
      
      - Definition Classes
- AnyRef → Any
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        ##(): Int
      
      
      - Definition Classes
- AnyRef → Any
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        ==(arg0: Any): Boolean
      
      
      - Definition Classes
- AnyRef → Any
 
-  val BLOCK_SIZE: Int
-  val DATA_ARRAY_SIZE: Int
-  val DATUM_SIZE: Int
- 
      
      
      
        
      
    
      
        
        val
      
      
        FILE_BLOCKS: Int
      
      
      - Definition Classes
- FileBPlusTreeFormat
 
- 
      
      
      
        
      
    
      
        
        val
      
      
        FILE_FREE_PTR: Int
      
      
      - Definition Classes
- FileBPlusTreeFormat
 
- 
      
      
      
        
      
    
      
        
        val
      
      
        FILE_HEADER: Int
      
      
      - Definition Classes
- FileBPlusTreeFormat
 
- 
      
      
      
        
      
    
      
        
        val
      
      
        FILE_HEADER_SIZE: Int
      
      
      - Definition Classes
- FileBPlusTreeFormat
 
- 
      
      
      
        
      
    
      
        
        val
      
      
        FILE_ORDER: Int
      
      
      - Definition Classes
- FileBPlusTreeFormat
 
- 
      
      
      
        
      
    
      
        
        val
      
      
        FILE_ROOT_RECORD: Int
      
      
      - Definition Classes
- FileBPlusTreeFormat
 
-  val INTERNAL_BRANCHES: Int
-  val INTERNAL_NODE: Int
-  val LEAF_NODE: Int
-  val LEAF_VALUES: Int
-  val NODE_KEYS: Int
-  val NODE_LENGTH: Int
-  val NODE_NEXT_PTR: Int
-  val NODE_PARENT_PTR: Int
-  val NODE_PREV_PTR: Int
-  val NODE_TYPE: Int
-  val NUL: Int
- 
      
      
      
        
      
    
      
        
        val
      
      
        POINTER_SIZE: Int
      
      
      - Definition Classes
- FileBPlusTreeFormat
 
- 
      
      
      
        
      
    
      
        
        val
      
      
        TREE_FIRST_PTR: Int
      
      
      - Definition Classes
- FileBPlusTreeFormat
 
- 
      
      
      
        
      
    
      
        
        val
      
      
        TREE_LAST_PTR: Int
      
      
      - Definition Classes
- FileBPlusTreeFormat
 
- 
      
      
      
        
      
    
      
        
        val
      
      
        TREE_RECORD_SIZE: Int
      
      
      - Definition Classes
- FileBPlusTreeFormat
 
- 
      
      
      
        
      
    
      
        
        val
      
      
        TREE_ROOT_PTR: Int
      
      
      - Definition Classes
- FileBPlusTreeFormat
 
-  val TYPE_ARRAY: Int
-  val TYPE_BOOLEAN: Int
-  val TYPE_BOOLEAN_FALSE: Int
-  val TYPE_BOOLEAN_TRUE: Int
-  val TYPE_DOUBLE: Int
-  val TYPE_INT: Int
-  val TYPE_LONG: Int
-  val TYPE_MAP: Int
-  val TYPE_NULL: Int
-  val TYPE_STRING: Int
- 
      
      
      
        
      
    
      
        
        def
      
      
        addBranch(node: Long, branch: Long): Unit
      
      
      Adds a new branchto (internal)node.Adds a new branchto (internal)node.branchis placed at an index equal to the length ofnode, given that the length of a node is the number of keys.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        addKey(node: Long, key: K): Unit
      
      
      Adds a new keytonode.Adds a new keytonode. The length ofnodewill increase by one as a result. This method should be called before eitheraddBranchoraddValuesince those methods use the current node length to determine placemenet.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        alloc(size: Int): Long
      
      
      - Attributes
- protected
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        asInstanceOf[T0]: T0
      
      
      - Definition Classes
- Any
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        binarySearch(node: N, target: K): Int
      
      
      Performs a binary search for key targetwithinnode(tail recursively).Performs a binary search for key targetwithinnode(tail recursively).- returns
- the index of - targetwithin- nodeif it exists, or (-insertionPoint - 1) where insertionPoint is the index of the correct insertion point for key- target.
 - Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        boundedIterator(bounds: (Symbol, K)*): Iterator[(K, V)]
      
      
      Returns a bounded iterator over a range of key/value pairs in the tree in ascending sorted key order. Returns a bounded iterator over a range of key/value pairs in the tree in ascending sorted key order. The range of key/value pairs in the iterator is specified by bounds.boundsmust contain one or two pairs where the first element in the pair is a symbol corresponding to the type of bound (i.e. '<, '<=, '>, '>=) and the second element is a key value.An example of a bounded iterator over all elements in a tree (with Stringkeys) that will include all keys that sort greater than or equal to "a" and up to but not including "e" isboundedIterator( ('>=, "a"), ('<, "e") ).- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        boundedKeysIterator(bounds: (Symbol, K)*): Iterator[K]
      
      
      Returns a bounded iterator over a range of keys in the tree in ascending sorted key order. Returns a bounded iterator over a range of keys in the tree in ascending sorted key order. The boundsparameter is the same as for boundedIterator.- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        boundedPositionIterator(bounds: (Symbol, K)*): Iterator[(N, Int)]
      
      
      Returns a bounded iterator over a range of key positions (node/index pairs) in the tree in ascending sorted key order. Returns a bounded iterator over a range of key positions (node/index pairs) in the tree in ascending sorted key order. The boundsparameter is the same as for boundedIterator.- Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        boundedValuesIterator(bounds: (Symbol, K)*): Iterator[V]
      
      
      Returns a bounded iterator over a range of values in the tree in ascending sorted key order. Returns a bounded iterator over a range of values in the tree in ascending sorted key order. The boundsparameter is the same as for boundedIterator.- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        build(s: String): BPlusTree[K, V]
      
      
      Returns a B+ tree build from a string representation of the tree. Returns a B+ tree build from a string representation of the tree. The syntax of the input string is simple: internal nodes are coded as lists of nodes alternating with keys (alpha strings with no quotation marks) using parentheses with elements separated by space, leaf nodes are coded as lists of alpha strings (no quotation marks) using brackets with elements separated by space. - Definition Classes
- BPlusTree
- ( [g] j [j t] u [u v] ) - produces a tree that pretty prints as - [n0: (null, null, null) n1 | j | n2 | u | n3] [n1: (null, n0, n2) g] [n2: (n1, n0, n3) j t] [n3: (n2, n0, null) u v] 
 Example:
- 
      
      
      
        
      
    
      
        
        def
      
      
        clone(): AnyRef
      
      
      - Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
 
-  def close: Unit
- 
      
      
      
        
      
    
      
        
        def
      
      
        copyInternal(src: Long, begin: Int, end: Int, dst: Long, index: Int): Unit
      
      
      - Attributes
- protected
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        copyKeys(src: Long, begin: Int, end: Int, dst: Long, index: Int): Array[Byte]
      
      
      - Attributes
- protected
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        copyLeaf(src: Long, begin: Int, end: Int, dst: Long, index: Int): Unit
      
      
      - Attributes
- protected
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        decode(in: DataInput): Any
      
      
      - Attributes
- protected
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        delete(key: K): Boolean
      
      
      Performs the B+ tree deletion algorithm to remove keyand it's associated value from the tree, rebalancing the tree if necessary.Performs the B+ tree deletion algorithm to remove keyand it's associated value from the tree, rebalancing the tree if necessary.- returns
- trueif- keywas found (and therefore removed),- falseotherwise
 - Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        diagram(name: String): Unit
      
      
      Creates a PNG image file called name(with.pngadded) which visually represents the structure and contents of the tree, only showing the keys.Creates a PNG image file called name(with.pngadded) which visually represents the structure and contents of the tree, only showing the keys. This method uses GraphViz (specifically thedotcommand) to produce the diagram, and ImageMagik (specifically theconvertcommand) to convert it from SVG to PNG.dotcan product PNG files directly but I got better results producing SVG and converting to PNG.- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        dispose(addr: Long): Unit
      
      
      - Attributes
- protected
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        encode(out: DataOutput, datum: Any): Unit
      
      
      - Attributes
- protected
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        eq(arg0: AnyRef): Boolean
      
      
      - Definition Classes
- AnyRef
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        equals(arg0: Any): Boolean
      
      
      - Definition Classes
- AnyRef → Any
 
- 
      
      
      
        
      
    
      
        
        val
      
      
        file: RandomAccessFile
      
      
      - Attributes
- protected
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        finalize(): Unit
      
      
      - Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
 
- 
      
      
      
        
      
    
      
        
        var
      
      
        first: Long
      
      
      - Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        free(start: Long, size: Int): Unit
      
      
      - Attributes
- protected
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        freeKey(node: N, index: Int): Unit
      
      
      Free the storage previously allocated for the key at indexinnode.Free the storage previously allocated for the key at indexinnode. For in-memory implementations, this method probably won't do anything.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        freeNode(node: Long): Unit
      
      
      Free the storage previously allocated for node.Free the storage previously allocated for node. For in-memory implementations, this method probably won't do anything.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        freeValue(node: N, index: Int): Unit
      
      
      Free the storage previously allocated for the value at indexinnode.Free the storage previously allocated for the value at indexinnode. For in-memory implementations, this method probably won't do anything.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        getBranch(node: Long, index: Int): N
      
      
      Returns a branch pointer from an internal node at a given index.Returns a branch pointer from an internal node at a given index. There is always one more branch pointer than there are keys in an internal node so the highest index is equal tonodeLength( node ).- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        getBranches(node: Long): Seq[Long]
      
      
      Returns the branches of nodeas a non-strict immutable sequence.Returns the branches of nodeas a non-strict immutable sequence.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        getClass(): Class[_]
      
      
      - Definition Classes
- AnyRef → Any
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        getKey(node: Long, index: Int): K
      
      
      Returns a key from a leaf nodeat a givenindex.Returns a key from a leaf nodeat a givenindex.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        getKeyValue(leaf: N, index: Int): (K, V)
      
      
      Returns the key/value pair at indexwithinleaf.Returns the key/value pair at indexwithinleaf.- Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        getKeys(node: Long): Seq[K]
      
      
      Returns the keys of nodeas a non-strict immutable sequence.Returns the keys of nodeas a non-strict immutable sequence.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        getNext(node: Long): Long
      
      
      Returns the next pointer of (leaf) node.Returns the next pointer of (leaf) node.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        getParent(node: Long): Long
      
      
      Returns the parent pointer of node.Returns the parent pointer of node.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        getPrev(node: Long): Long
      
      
      Returns the previous leaf node link pointer of (leaf) node.Returns the previous leaf node link pointer of (leaf) node.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        getValue(node: Long, index: Int): V
      
      
      Returns a value from a leaf nodeat a givenindex.Returns a value from a leaf nodeat a givenindex.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        getValues(node: Long): AbstractSeq[V] with IndexedSeq[V]
      
      
      Returns the values of nodeas a non-strict immutable sequence.Returns the values of nodeas a non-strict immutable sequence.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        greatestLT(key: K): (N, Int)
      
      
      Returns the leaf position of the key that is greatest less than key.Returns the leaf position of the key that is greatest less than key.- Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        greatestLTE(key: K): (N, Int)
      
      
      Returns the leaf position of the key that is greatest less than or equal to key.Returns the leaf position of the key that is greatest less than or equal to key.- Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        greatestLessThan(key: K): Option[(K, V)]
      
      
      Returns the key/value pair whose key is greatest less than key.Returns the key/value pair whose key is greatest less than key.- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        greatestLessThanOrEqual(key: K): Option[(K, V)]
      
      
      Returns the key/value pair whose key is greatest less than or equal to key.Returns the key/value pair whose key is greatest less than or equal to key.- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        hashCode(): Int
      
      
      - Definition Classes
- AnyRef → Any
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        insert[V1 >: V](key: K, value: V1 = null.asInstanceOf[V1]): Boolean
      
      
      Inserts keywith associatedvalueinto the tree.Inserts keywith associatedvalueinto the tree. Ifkeyexists, then it's new associated value will bevalue.- returns
- trueif- keyexists
 - Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        insertAt[V1 >: V](key: K, value: V1, leaf: N, index: Int): Unit
      
      
      Performs the B+ tree insertion algorithm to insert keyand associatedvalueinto the tree, specifically inleafatindex, rebalancing the tree if necessary.Performs the B+ tree insertion algorithm to insert keyand associatedvalueinto the tree, specifically inleafatindex, rebalancing the tree if necessary. Ifleafandindexis not the correct insertion point forkeythen this method will probably result in an invalid B+ tree.- Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        insertIfNotFound[V1 >: V](key: K, value: V1 = null.asInstanceOf[V1]): Boolean
      
      
      Inserts keywith associatedvalueinto the tree only ifkeydoes not exist.Inserts keywith associatedvalueinto the tree only ifkeydoes not exist.- returns
- trueif- keyexists
 - Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        insertInternal(node: Long, keyIndex: Int, key: K, branchIndex: Int, branch: Long): Unit
      
      
      Inserts keyandbranchinto (internal)nodeatkeyIndexandbranchIndex, respectively.Inserts keyandbranchinto (internal)nodeatkeyIndexandbranchIndex, respectively.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        insertKeys(keys: K*): Unit
      
      
      Inserts keysinto the tree each with an associated value ofnull.Inserts keysinto the tree each with an associated value ofnull. If a given key exists, then it's new associated value will benull.- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        insertKeysAndCheck(keys: K*): String
      
      
      Inserts keysinto the tree each with an associated value ofnull, and checks that the tree is well constructed after each key is inserted.Inserts keysinto the tree each with an associated value ofnull, and checks that the tree is well constructed after each key is inserted. If a given key exists, then it's new associated value will benull. This method is used for testing.- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        insertLeaf[V1 >: V](node: Long, index: Int, key: K, value: V1): Unit
      
      
      Inserts keyandvalueinto (leaf)nodeatindex.Inserts keyandvalueinto (leaf)nodeatindex.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        isEmpty: Boolean
      
      
      Returns trueis the tree is empty.Returns trueis the tree is empty.- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        isInstanceOf[T0]: Boolean
      
      
      - Definition Classes
- Any
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        isLeaf(node: Long): Boolean
      
      
      Returns trueifnodeis a leaf nodeReturns trueifnodeis a leaf node- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        iterator: Iterator[(K, V)]
      
      
      Returns an iterator over all key/value pairs in the tree in ascending sorted key order. Returns an iterator over all key/value pairs in the tree in ascending sorted key order. - Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        keys: Iterable[K]
      
      
      Returns a non-strict Iterablecontaining the keys in the tree.Returns a non-strict Iterablecontaining the keys in the tree.- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        keysIterator: Iterator[K]
      
      
      Returns an iterator over all keys in the tree in ascending sorted order. Returns an iterator over all keys in the tree in ascending sorted order. - Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        var
      
      
        last: Long
      
      
      - Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        var
      
      
        lastlen: Int
      
      
      - Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        leastGT(key: K): (N, Int)
      
      
      Returns the leaf position of the key that is least greater than key.Returns the leaf position of the key that is least greater than key.- Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        leastGTE(key: K): (N, Int)
      
      
      Returns the leaf position of the key that is least greater than or equal to key.Returns the leaf position of the key that is least greater than or equal to key.- Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        leastGreaterThan(key: K): Option[(K, V)]
      
      
      Returns the key/value pair whose key is least greater than key.Returns the key/value pair whose key is least greater than key.- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        leastGreaterThanOrEqual(key: K): Option[(K, V)]
      
      
      Returns the key/value pair whose key is least greater than or equal to key.Returns the key/value pair whose key is least greater than or equal to key.- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        leftmost(node: N): K
      
      
      Returns the left most or least key within or under node.Returns the left most or least key within or under node.- Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        load[V1 >: V](kvs: (K, V1)*): Unit
      
      
      Performs the B+ tree bulk loading algorithm to insert key/value pairs kvsinto the tree efficiently.Performs the B+ tree bulk loading algorithm to insert key/value pairs kvsinto the tree efficiently. This method is more efficient than usinginsertbecauseinsertperforms a search to determine the correct insertion point for the key whereasloaddoes not.loadcan only work if the tree is empty, or if the minimum key to be inserted is greater than the maximum key in the tree.- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        lookup(key: K): (Boolean, N, Int)
      
      
      Performs the B+ tree lookup algorithm (tail recursively) beginning at the root, in search of the location (if found) or correct insertion point (if not found) of key.Performs the B+ tree lookup algorithm (tail recursively) beginning at the root, in search of the location (if found) or correct insertion point (if not found) of key.- returns
- a triple where the first element is - trueif- keyexists and- falseotherwise, the second element is the node containing- keyif found or the correct insertion point for- keyif not found, the third is the index within that node.
 - Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        lookupGTE(key: K): (Boolean, N, Int)
      
      
      Searches for keyreturning a point in a leaf node that is the least greater than (if not found) or equal to (if found)key.Searches for keyreturning a point in a leaf node that is the least greater than (if not found) or equal to (if found)key. The leaf node and index returned in casekeydoes not exist is not necessarily the correct insertion point. This method is used byboundedIterator.- returns
- a triple where the first element is - trueif- keyexists and- falseotherwise, and the second element is the leaf node containing the least greater than or equal key, and the third is the index of that key.
 - Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        lookupLTE(key: K): (Boolean, N, Int)
      
      
      Searches for keyreturning a point in a leaf node that is the greatest less than (if not found) or equal to (if found)key.Searches for keyreturning a point in a leaf node that is the greatest less than (if not found) or equal to (if found)key. The leaf node and index returned in casekeydoes not exist is not necessarily the correct insertion point. This method is used byreverseBoundedIterator.- returns
- a triple where the first element is - trueif- keyexists and- falseotherwise, and the second element is the leaf node containing the greatest less than or equal key, and the third is the index of that key.
 - Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        max: Option[(K, V)]
      
      
      Returns the maximum key and it's associated value. Returns the maximum key and it's associated value. - returns
- Some( (key, value) )where- keyis the maximum key and- valueis it's associated value if the tree is non-empty, or- Noneif the tree is empty.
 - Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        maxKey: Option[K]
      
      
      Returns the maximum key. Returns the maximum key. - Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        min: Option[(K, V)]
      
      
      Returns the minimum key and it's associated value. Returns the minimum key and it's associated value. - returns
- Some( (key, value) )where- keyis the minimum key and- valueis it's associated value if the tree is non-empty, or- Noneif the tree is empty.
 - Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        minKey: Option[K]
      
      
      Returns the minimum key. Returns the minimum key. - Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        val
      
      
        minlen: Int
      
      
      The minimum length (number of keys) that a non-root node (internal or leaf) may have is ceil(order/2) - 1.The minimum length (number of keys) that a non-root node (internal or leaf) may have is ceil(order/2) - 1. The minimum length for a root leaf node is 0. The minimum length for a root internal node is 1.- Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        moveInternal(src: Long, begin: Int, end: Int, dst: Long, index: Int): Unit
      
      
      Moves key/branch pairs from node srcbeginning at indexbeginup to but not including indexendto nodedstatindex.Moves key/branch pairs from node srcbeginning at indexbeginup to but not including indexendto nodedstatindex.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        moveLeaf(src: Long, begin: Int, end: Int, dst: Long, index: Int): Unit
      
      
      Moves key/value pairs from node srcto nodedstbeginning at indexbeginand ending up to but not including indexend.Moves key/value pairs from node srcto nodedstbeginning at indexbeginand ending up to but not including indexend.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        ne(arg0: AnyRef): Boolean
      
      
      - Definition Classes
- AnyRef
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        newInternal(parent: Long): Long
      
      
      Creates a new internal node with parentas its parent pointer.Creates a new internal node with parentas its parent pointer.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        newLeaf(parent: Long): Long
      
      
      Creates a new leaf node with parentas its parent pointer.Creates a new leaf node with parentas its parent pointer.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        newRoot(branch: Long): Long
      
      
      Creates a new root (internal) node with branchas its leftmost branch pointer andnullparent pointer.Creates a new root (internal) node with branchas its leftmost branch pointer andnullparent pointer. Implementations are require to update the in-storage copy of the root pointer if needed (only really applies to on-disk implementations).- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        nextPosition(leaf: N, index: Int): (N, Int)
      
      
      Returns the node/index pair pointing to the location of the leaf node key following the one at indexinleaf.Returns the node/index pair pointing to the location of the leaf node key following the one at indexinleaf.- Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        nodeLength(node: Long, len: Int): Unit
      
      
      - Attributes
- protected
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        nodeLength(node: Long): Int
      
      
      Returns the length (number of keys) of node.Returns the length (number of keys) of node. For internal nodes, the number of branch pointers will one more than the length.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        notify(): Unit
      
      
      - Definition Classes
- AnyRef
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        notifyAll(): Unit
      
      
      - Definition Classes
- AnyRef
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        nul: Long
      
      
      Returns the null node pointer. Returns the null node pointer. For in-memory implementations this will usually be a Scala nullvalue. For on-disk it would make sense for this to be0L.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        optionalKey(pos: (N, Int)): Option[K]
      
      
      - Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        optionalKeyValue(pos: (N, Int)): Option[(K, V)]
      
      
      - Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        val
      
      
        order: Int
      
      
      - Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        positionIterator: Iterator[(N, Int)]
      
      
      Returns an iterator over all key positions (node/index pairs) in the tree in ascending sorted key order. Returns an iterator over all key positions (node/index pairs) in the tree in ascending sorted key order. - Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        prettyPrint: Unit
      
      
      Prints (to stdout) a readable representation of the structure and contents of the tree. Prints (to stdout) a readable representation of the structure and contents of the tree. - Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        prettyPrintKeysOnly: Unit
      
      
      Prints (to stdout) a readable representation of the structure and contents of the tree, omitting the values and only printing the keys. Prints (to stdout) a readable representation of the structure and contents of the tree, omitting the values and only printing the keys. - Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        prettySearch(key: K): String
      
      
      Returns a string representing a search result for keythat will be consistant withprettyPrint.Returns a string representing a search result for keythat will be consistant withprettyPrint. This method is used mainly for unit testing.- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        prettyString: String
      
      
      Returns a string containing a readable representation of the structure and contents of the tree, omitting the values and only printing the keys. Returns a string containing a readable representation of the structure and contents of the tree, omitting the values and only printing the keys. This method is used mainly for unit testing. - Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        prettyStringWithValues: String
      
      
      Returns a string containing a readable representation of the structure and contents of the tree. Returns a string containing a readable representation of the structure and contents of the tree. This method is used mainly for unit testing. - Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        prevPosition(leaf: N, index: Int): (N, Int)
      
      
      Returns the node/index pair pointing to the location of the leaf node key preceding the one at indexinleaf.Returns the node/index pair pointing to the location of the leaf node key preceding the one at indexinleaf.- Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        readDatumArray(array: Array[Byte], index: Int): Any
      
      
      - Attributes
- protected
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        readDatumFile(addr: Long): Any
      
      
      - Attributes
- protected
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        removeInternal(node: Long, keyIndex: Int, branchIndex: Int): Int
      
      
      Removes the key and branch pair from internal nodeatkeyIndexandbranchIndex, respectively.Removes the key and branch pair from internal nodeatkeyIndexandbranchIndex, respectively. This method is perhaps poorly named: it does not remove an internal node from the tree.- returns
- length of - nodeafter removal
 - Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        removeLeaf(node: Long, index: Int): Int
      
      
      Removes the key/value pair from leaf nodeatindex.Removes the key/value pair from leaf nodeatindex. This method is perhaps poorly named: it does not remove a leaf node from the tree.- returns
- length of - nodeafter removal
 - Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        reverseBoundedIterator(bounds: (Symbol, K)*): Iterator[(K, V)]
      
      
      Returns a bounded iterator over a range of key/value pairs in the tree in descending sorted key order. Returns a bounded iterator over a range of key/value pairs in the tree in descending sorted key order. The range of key/value pairs in the iterator is specified by bounds.boundsmust contain one or two pairs where the first element in the pair is a symbol corresponding to the type of bound (i.e. '<, '<=, '>, '>=) and the second element is a key value.An example of a reverse bounded iterator over all elements in a tree (with Stringkeys) that will include all keys that sort greater than or equal to "a" and up to but not including "e", iterated over in reverse order, isreverseBoundedIterator( ('>=, "a"), ('<, "e") ).- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        reverseBoundedKeysIterator(bounds: (Symbol, K)*): Iterator[K]
      
      
      Returns a bounded iterator over a range of keys in the tree in descending sorted key order. Returns a bounded iterator over a range of keys in the tree in descending sorted key order. The boundsparameter is the same as for boundedIterator.- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        reverseBoundedPositionIterator(bounds: (Symbol, K)*): Iterator[(N, Int)]
      
      
      Returns a bounded iterator over a range of key positions (node/index pairs) in the tree in descending sorted key order. Returns a bounded iterator over a range of key positions (node/index pairs) in the tree in descending sorted key order. The boundsparameter is the same as for boundedIterator.- Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        reverseBoundedValuesIterator(bounds: (Symbol, K)*): Iterator[V]
      
      
      Returns a bounded iterator over a range of values in the tree in descending sorted key order. Returns a bounded iterator over a range of values in the tree in descending sorted key order. The boundsparameter is the same as for boundedIterator.- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        reverseIterator: Iterator[(K, V)]
      
      
      Returns an iterator over all key/value pairs in the tree in descending sorted key order. Returns an iterator over all key/value pairs in the tree in descending sorted key order. - Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        reverseKeysIterator: Iterator[K]
      
      
      Returns a reverse iterator over all keys in the tree in descending sorted order. Returns a reverse iterator over all keys in the tree in descending sorted order. - Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        reversePositionIterator: Iterator[(N, Int)]
      
      
      Returns a reverse iterator over all key positions (node/index pairs) in the tree in descending sorted key order. Returns a reverse iterator over all key positions (node/index pairs) in the tree in descending sorted key order. - Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        rightmost(node: N): K
      
      
      Returns the right most or greatest key within or under node.Returns the right most or greatest key within or under node.- Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        var
      
      
        root: Long
      
      
      - Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        search(key: K): Option[V]
      
      
      Searches for keyreturning it's associated value ifkeyexists.Searches for keyreturning it's associated value ifkeyexists.- returns
- Some( value )where- valueis the value associated to- keyif it exists, or- Noneotherwise
 - Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        serialize(before: String, prefix: String, internalnode: (N, (N) ⇒ String, (String) ⇒ Unit) ⇒ String, leafnode: (N, (N) ⇒ String) ⇒ String, after: String): String
      
      
      Returns a serialization (string representation of the tree) using string and function arguments to specify the exact form of the serialization. Returns a serialization (string representation of the tree) using string and function arguments to specify the exact form of the serialization. This method is used for pretty printing and to generate a DOT (graph description language) description of the tree so that it can be visualized. - before
- string to be prepended to the serialization 
- prefix
- string to be place before each line of the serialization that includes internal and leaf nodes 
- internalnode
- function to generate internal node serializations using three parameters: the current node, a function to return a string id of a node, a function that allows a line of text to be appended after all nodes have been serialized 
- leafnode
- function to generate leaf node serializations using two parameters: the current node, a function to return a string id of a node 
- after
- string to be appended to the serialization 
 - Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        setBranch(node: Long, index: Int, branch: Long): Unit
      
      
      - Attributes
- protected
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        setFirst(leaf: Long): Unit
      
      
      Sets the in-storage copy of the first leaf node pointer. Sets the in-storage copy of the first leaf node pointer. This method is not responsable for setting the firstvariable.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        setKey(node: Long, index: Int, key: K): Unit
      
      
      Sets the key at indexofnodetokey.Sets the key at indexofnodetokey.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        setLast(leaf: Long): Unit
      
      
      Sets the in-storage copy of the last leaf node pointer. Sets the in-storage copy of the last leaf node pointer. This method is not responsable for setting the lastvariable nor thelastlenvariable.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        setNext(node: Long, p: Long): Unit
      
      
      Sets the next pointer of (leaf) nodetop.Sets the next pointer of (leaf) nodetop.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        setParent(node: Long, p: Long): Unit
      
      
      Sets the parent pointer of nodetop.Sets the parent pointer of nodetop.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        setPrev(node: Long, p: Long): Unit
      
      
      Sets previous leaf node link pointer of (leaf) nodetop.Sets previous leaf node link pointer of (leaf) nodetop.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        setRoot(node: Long): Unit
      
      
      Sets the in-storage copy of the root node pointer. Sets the in-storage copy of the root node pointer. This method is not responsable for setting the rootvariable.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        setValue[V1 >: V](node: Long, index: Int, v: V1): Unit
      
      
      Sets the value at indexofnodetov.Sets the value at indexofnodetov.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        str(n: Long): String
      
      
      Returns a string representation of the keys in node.Returns a string representation of the keys in node. This method was used in debugging FileBPlusTree since the node type isLong.- Attributes
- protected
- Definition Classes
- FileBPlusTree → BPlusTree
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        synchronized[T0](arg0: ⇒ T0): T0
      
      
      - Definition Classes
- AnyRef
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        toString(): String
      
      
      - Definition Classes
- AnyRef → Any
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        traverseBreadthFirst(level: (List[N]) ⇒ Unit): Unit
      
      
      Performs a breadth first traversal of the tree (tail recursively), applying levelto each level of the tree beginning at the root.Performs a breadth first traversal of the tree (tail recursively), applying levelto each level of the tree beginning at the root.- Attributes
- protected
- Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        val
      
      
        tree: Long
      
      
      - Attributes
- protected
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        valuesIterator: Iterator[V]
      
      
      Returns an iterator over all values in the tree in the order corresponding to ascending keys. Returns an iterator over all values in the tree in the order corresponding to ascending keys. - Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        wait(): Unit
      
      
      - Definition Classes
- AnyRef
- Annotations
- @throws( ... )
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        wait(arg0: Long, arg1: Int): Unit
      
      
      - Definition Classes
- AnyRef
- Annotations
- @throws( ... )
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        wait(arg0: Long): Unit
      
      
      - Definition Classes
- AnyRef
- Annotations
- @throws( ... )
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        wellConstructed: String
      
      
      Analyzes the tree to determine if it is well constructed. Analyzes the tree to determine if it is well constructed. - returns
- "true"(as a string) if the tree is a well constructed B+ tree, a string description of the flaw otherwise.
 - Definition Classes
- BPlusTree
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        writeDatumArray(array: Array[Byte], index: Int, datum: Any): Unit
      
      
      - Attributes
- protected
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        writeDatumFile(addr: Long, datum: Any): Unit
      
      
      - Attributes
- protected
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        writeEmptyRecord(node: Long): Unit
      
      
      - Attributes
- protected