ozone core API

org.ozoneDB.core.storage.gammaStore
Class IndexBranchNode

java.lang.Object
  extended byorg.ozoneDB.core.storage.gammaStore.IndexNode
      extended byorg.ozoneDB.core.storage.gammaStore.IndexBranchNode
All Implemented Interfaces:
java.io.Serializable, Storable

final class IndexBranchNode
extends IndexNode

Version:
$Id: IndexBranchNode.java,v 1.4 2004/02/01 20:55:47 leomekenkamp Exp $
Author:
Leo Mekenkamp (mind the anti sp@m)

Field Summary
private  NodeIdLoc nodeIdLoc
           
private static long serialVersionUID
           
 
Fields inherited from class org.ozoneDB.core.storage.gammaStore.IndexNode
log, LONGNULL, MAXOBJECTID, MINOBJECTID
 
Constructor Summary
(package private) IndexBranchNode(IndexManager indexManager)
          Creates a branch node; created node places itself in the index managers cache, but is not yet connected to any other nodes.
 
Method Summary
(package private)  void childMinObjectIdChanged(IndexNode childNode, long childOldMinObjectId)
           
(package private)  long getChildNodeId(long objectId)
          Returns the id of a child node of this node, containing the specified object id.
(package private)  long getMaxObjectId()
          Returns the maximum object id that can be found be in this node
(package private)  long getMinObjectId()
          Returns the minimum object id that can be found be in this node
private  NodeIdLoc getNodeIdLoc()
           
(package private)  void putChildNode(IndexNode childNode)
           
private  void rawPutChildNode(IndexNode childNode)
          Adds a child node in this node.
private  void rawRemoveChildNode(IndexNode childNode)
          Removes a child node from this node.
(package private)  void removeChildNode(IndexNode childNode)
           
protected  int size()
          Returns the number of elements in this node.
private  void split(IndexNode indexNode)
          Splits this instance into two nodes; the specified id is used to find out which child nodes should remain in this instance, and which should be put in the other one.
 java.lang.String toString()
           
 
Methods inherited from class org.ozoneDB.core.storage.gammaStore.IndexNode
endInvoke, finalize, getIndexManager, getMaxSize, getNextNode, getNextNodeId, getNodeId, getParentNode, getParentNodeId, getPrevNode, getPrevNodeId, getStorageName, isDirty, isFull, isFull, isInvoked, nodeIdToStorageName, read, relSize, setDirty, setDirty, setIndexManager, setMaxSize, setNextNode, setNextNodeId, setParentNode, setParentNodeId, setPrevNode, setPrevNodeId, startInvoke, storageNameToNodeId
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

nodeIdLoc

private NodeIdLoc nodeIdLoc
Constructor Detail

IndexBranchNode

IndexBranchNode(IndexManager indexManager)
Creates a branch node; created node places itself in the index managers cache, but is not yet connected to any other nodes.

Method Detail

getNodeIdLoc

private NodeIdLoc getNodeIdLoc()

getChildNodeId

long getChildNodeId(long objectId)
Returns the id of a child node of this node, containing the specified object id. If the specified object id does not exist in any child node, this method returns the most appropriate child node.


rawPutChildNode

private void rawPutChildNode(IndexNode childNode)
Adds a child node in this node. Does not do any merging or splitting, but does inform parent if changed because of this action.

Throws:
java.lang.IndexOutOfBoundsException - maximum size has already been reached

putChildNode

void putChildNode(IndexNode childNode)

rawRemoveChildNode

private void rawRemoveChildNode(IndexNode childNode)
Removes a child node from this node. Does not do any merging or splitting, but does inform parent if changing because of this action. Also removes itself from the tree if empty after the remove.


removeChildNode

void removeChildNode(IndexNode childNode)
Throws:
org.ozoneDB.OzoneInternalException - when given node not found

size

protected final int size()
Description copied from class: IndexNode
Returns the number of elements in this node.

Specified by:
size in class IndexNode
Returns:
number of elements in this node

childMinObjectIdChanged

void childMinObjectIdChanged(IndexNode childNode,
                             long childOldMinObjectId)

getMaxObjectId

long getMaxObjectId()
Description copied from class: IndexNode
Returns the maximum object id that can be found be in this node

Specified by:
getMaxObjectId in class IndexNode

getMinObjectId

long getMinObjectId()
Description copied from class: IndexNode
Returns the minimum object id that can be found be in this node

Specified by:
getMinObjectId in class IndexNode

split

private void split(IndexNode indexNode)
Splits this instance into two nodes; the specified id is used to find out which child nodes should remain in this instance, and which should be put in the other one. Say we have a full node with sub node ids [10, 20, 30, 40, 50] and we are adding 35, then we would split into [10, 20, 30] and [40, 50].


toString

public java.lang.String toString()
Overrides:
toString in class IndexNode

ozone core API

Copyright (C) The Ozone Database Project - www.ozone-db.org. All rights reserved.