Ejemplo n.º 1
0
 BplusNode MaterializeNodeAtIndex(int myposition)
 {
     if (this.isLeaf)
     {
         throw new BplusTreeException("cannot materialize child for leaf");
     }
     long childBufferNumber = this.ChildBufferNumbers[myposition];
     if (childBufferNumber==BplusTreeLong.NULLBUFFERNUMBER)
     {
         throw new BplusTreeException("can't search null subtree at position "+myposition+" in "+this.myBufferNumber);
     }
     // is it already materialized?
     BplusNode result = this.MaterializedChildNodes[myposition];
     if (result!=null)
     {
         return result;
     }
     // otherwise read it in...
     result = new BplusNode(this.owner, this, myposition, true); // dummy isLeaf value
     result.LoadFromBuffer(childBufferNumber);
     this.MaterializedChildNodes[myposition] = result;
     // no longer terminal
     this.owner.ForgetTerminalNode(this);
     return result;
 }
Ejemplo n.º 2
0
 BplusNode MaterializeNodeAtIndex(int myposition)
 {
     if (IsLeaf)
     {
         throw new BplusTreeException("cannot materialize child for leaf");
     }
     var childBufferNumber = m_childBufferNumbers[myposition];
     if (childBufferNumber==BplusTreeLong.Nullbuffernumber)
     {
         throw new BplusTreeException("can't search null subtree at position "+myposition+" in "+MyBufferNumber);
     }
     // is it already materialized?
     var result = m_materializedChildNodes[myposition];
     if (result!=null)
     {
         return result;
     }
     // otherwise read it in...
     result = new BplusNode(m_owner, this, myposition, true); // dummy isLeaf value
     result.LoadFromBuffer(childBufferNumber);
     m_materializedChildNodes[myposition] = result;
     // no longer terminal
     m_owner.ForgetTerminalNode(this);
     return result;
 }