org.teiid.common.buffer
Class STree

java.lang.Object
  extended by org.teiid.common.buffer.STree

public class STree
extends java.lang.Object

Self balancing search tree using skip list like logic This has similar performance similar to a B+/-Tree, but with fewer updates.


Nested Class Summary
static class STree.InsertMode
           
 
Field Summary
protected  ListNestedSortComparator comparator
           
protected  org.teiid.common.buffer.SPage[] header
           
protected  int keyLength
           
protected  BatchManager keyManager
           
protected  java.lang.String[] keytypes
           
protected  BatchManager leafManager
           
protected  int pageSize
           
protected  boolean preferMemory
           
protected  int randomSeed
           
protected  java.lang.String[] types
           
protected  java.util.concurrent.locks.ReentrantLock updateLock
           
 
Constructor Summary
STree(BatchManager manager, BatchManager leafManager, ListNestedSortComparator comparator, int pageSize, int keyLength, java.lang.String[] types)
           
 
Method Summary
 void compact()
          Quickly check if the index can be compacted
 java.util.List find(java.util.List n)
           
protected  org.teiid.common.buffer.SPage findChildTail(org.teiid.common.buffer.SPage page)
           
 ListNestedSortComparator getComparator()
           
 int getExpectedHeight(int sizeHint)
           
 int getHeight()
           
 int getKeyLength()
           
 int getRowCount()
           
 java.util.List insert(java.util.List tuple, STree.InsertMode mode, int sizeHint)
           
 boolean isPreferMemory()
           
 void remove()
           
 java.util.List remove(java.util.List key)
           
 void removeRowIdFromKey()
           
 void setPreferMemory(boolean preferMemory)
           
 java.lang.String toString()
           
 int truncate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

randomSeed

protected int randomSeed

header

protected volatile org.teiid.common.buffer.SPage[] header

keyManager

protected BatchManager keyManager

leafManager

protected BatchManager leafManager

comparator

protected ListNestedSortComparator comparator

pageSize

protected int pageSize

keyLength

protected int keyLength

types

protected java.lang.String[] types

keytypes

protected java.lang.String[] keytypes

preferMemory

protected boolean preferMemory

updateLock

protected java.util.concurrent.locks.ReentrantLock updateLock
Constructor Detail

STree

public STree(BatchManager manager,
             BatchManager leafManager,
             ListNestedSortComparator comparator,
             int pageSize,
             int keyLength,
             java.lang.String[] types)
Method Detail

findChildTail

protected org.teiid.common.buffer.SPage findChildTail(org.teiid.common.buffer.SPage page)

find

public java.util.List find(java.util.List n)
                    throws TeiidComponentException
Throws:
TeiidComponentException

insert

public java.util.List insert(java.util.List tuple,
                             STree.InsertMode mode,
                             int sizeHint)
                      throws TeiidComponentException
Throws:
TeiidComponentException

getExpectedHeight

public int getExpectedHeight(int sizeHint)

remove

public java.util.List remove(java.util.List key)
                      throws TeiidComponentException
Throws:
TeiidComponentException

remove

public void remove()

getRowCount

public int getRowCount()

truncate

public int truncate()

getHeight

public int getHeight()

toString

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

getKeyLength

public int getKeyLength()

setPreferMemory

public void setPreferMemory(boolean preferMemory)

isPreferMemory

public boolean isPreferMemory()

getComparator

public ListNestedSortComparator getComparator()

compact

public void compact()
Quickly check if the index can be compacted


removeRowIdFromKey

public void removeRowIdFromKey()


Copyright © 2011. All Rights Reserved.