| java.lang.Object com.quadcap.sql.index.Btree
Btree | public class Btree implements BIndex(Code) | | A Btree implementation. Most of the real work happens in the Bnode
class.
author: Stan Bailes |
Constructor Summary | |
public | Btree(BlockFile file, Comparator compare, long rootBlock, boolean create) Open a btree index. | public | Btree(BlockFile file, long rootBlock, boolean create) Open a btree index. |
Method Summary | |
public boolean | delete(byte[] key) | public boolean | deleteObs(byte[] key) | public void | display(PrintWriter w) | public void | free() | public int | get(byte[] key, int klen, byte[] data) Get the data bytes for the specified key. | public byte[] | get(byte[] key) | public Comparator | getComparator() | public BCursor | getCursor() | public BCursor | getCursor(boolean skipSetup) | public BlockFile | getFile() Return a reference to the underlying BlockFile | Bnode | getNode(long ref) | Bnode | getRoot() | public long | getRootBlock() | public void | insert(byte[] key, int klen, byte[] val, int off, int len) | public void | notifyUpdate(BCursor notMe) | public void | releaseCursor(BCursor c) | public void | set(byte[] key, byte[] val) | public boolean | set(byte[] key, int klen, byte[] val, int off, int len) | void | setRoot(long ref) | public int | size() | public String | toString() | public void | update(byte[] key, int klen, byte[] val, int off, int len) |
rootBlock | long rootBlock(Code) | | |
Btree | public Btree(BlockFile file, Comparator compare, long rootBlock, boolean create) throws IOException(Code) | | Open a btree index. Fetch the root block and create an empty tree if
the block is zero, open the existing tree otherwise.
Parameters: file - the (already opened) blockfile Parameters: compare - the compare function for key ordering Parameters: rootBlock - the block number of the root block of this tree Parameters: create - if true, initialize the rootblock to be empty. exception: IOException - if an I/O error occurs opening or accessingthe file. |
Btree | public Btree(BlockFile file, long rootBlock, boolean create) throws IOException(Code) | | Open a btree index. Fetch the root block and create an empty tree if
the block is zero, open the existing tree otherwise.
Parameters: file - the (already opened) blockfile Parameters: rootBlock - the block number of the root block of this tree Parameters: create - if true, initialize the rootblock to be empty. exception: IOException - if an I/O error occurs opening or accessingthe file. |
free | public void free() throws IOException(Code) | | Destroy this tree and free all of its resources
|
get | public int get(byte[] key, int klen, byte[] data) throws IOException(Code) | | Get the data bytes for the specified key. If the key is found,
return the length of the data portion and place as many bytes
as will fit in the data array. If the key isn't found, return
-1.
|
getComparator | public Comparator getComparator()(Code) | | Return the comparator used to collate keys
|
getFile | public BlockFile getFile()(Code) | | Return a reference to the underlying BlockFile |
getRootBlock | public long getRootBlock()(Code) | | |
insert | public void insert(byte[] key, int klen, byte[] val, int off, int len) throws IOException(Code) | | |
set | public boolean set(byte[] key, int klen, byte[] val, int off, int len) throws IOException(Code) | | |
setRoot | void setRoot(long ref)(Code) | | |
update | public void update(byte[] key, int klen, byte[] val, int off, int len) throws IOException(Code) | | |
|
|