| java.lang.Object com.quadcap.sql.lock.PooledObject com.quadcap.sql.index.BtreeCursor
BtreeCursor | public class BtreeCursor extends PooledObject implements BCursor(Code) | | A cursor for a Quadcap Btree.
author: Stan Bailes |
Method Summary | |
public boolean | absolute(int x) | public void | afterLast() Move the cursor after the last key. | public void | beforeFirst() Move the cursor before the first key. | public void | close() | public PooledObject | create() | public boolean | delete() | static String | doLine(BCursor bc, String line) | final String | dr() | static BtreeCursor | get(Btree tree, boolean skipSetup) | public int | getKey(byte[] buf) | public byte[] | getKey() | public byte[] | getKeyBuf() | public int | getKeyLen() | final boolean | getNextBlock() | final boolean | getPrevBlock() | public int | getVal(byte[] buf) | public byte[] | getVal() | public long | getValAsLong() | public byte[] | getValBuf() | public int | getValLen() | final void | holdKey(int off) | final String | id() | public void | init(Btree tree, boolean skipSetup) | public boolean | insert(byte[] key, int klen, byte[] data, int doff, int dlen) Insert a new key/data pair. | public boolean | insert(byte[] key, byte[] data) | static void | itest(BCursor bc) | static void | jtest(BCursor c) | String | k(byte[] b, int off, int len) | static void | kshow(BCursor c) | static void | ktest(BCursor c) | static void | ktest(Btree t) | public static void | main(String[] args) | final static void | mkey(int i, byte[] b) | public boolean | next() Move the cursor to the next row and return true if the
cursor is positioned on a valid row. | public long | position() | public boolean | prev() Move the cursor to the next row and return true if the
cursor is positioned on a valid row. | final static String | r(boolean b) | public void | release() | public boolean | replace(byte[] data, int doff, int dlen) | public boolean | replace(byte[] data) | final public boolean | seek(byte[] key) Seek: Position the cursor on or before the specified key value. | public boolean | seek(byte[] key, int len) Seek, but the key can be a subsequence of the given byte array. | boolean | seek1(int level, byte[] key, int len) | final void | setBlock(int i, Block b) Manage updates to the 'blocks' array through this function to
assuage refcount madness. | public void | setKeyBuf(byte[] buf) | public void | setValBuf(byte[] buf) | protected void | setup(boolean restoreKey) Called to re-establish the synchronization of this cursor in
the case where the underlying index has been modified. | static void | show(String s) | public long | size() | static long | subtreeSize(Bnode root, Block b) | String | t() | final static long | tick() | public String | toString() | public void | unsetup() Called (in theory) by the owning Btree when the index is modified. |
lastCount | static int lastCount(Code) | | |
noPool | final static boolean noPool(Code) | | |
posAFTER_LAST | final static long posAFTER_LAST(Code) | | |
posBEFORE_FIRST | final static long posBEFORE_FIRST(Code) | | |
posUNKNOWN | final static long posUNKNOWN(Code) | |
For the position variable:
-2 unknown
-1 after last
0 before first
>0 on key
|
absolute | public boolean absolute(int x) throws IOException(Code) | | Move the cursor to the specified absolute position
|
afterLast | public void afterLast() throws IOException(Code) | | Move the cursor after the last key.
|
beforeFirst | public void beforeFirst() throws IOException(Code) | | Move the cursor before the first key.
|
close | public void close()(Code) | | Close the index
|
delete | public boolean delete() throws IOException(Code) | | Delete the current row (if the cursor is positioned on a valid
row, that is ;-)
|
getKey | public int getKey(byte[] buf)(Code) | | |
getKey | public byte[] getKey()(Code) | | |
getKeyBuf | public byte[] getKeyBuf()(Code) | | |
getKeyLen | public int getKeyLen()(Code) | | |
getVal | public int getVal(byte[] buf)(Code) | | |
getVal | public byte[] getVal()(Code) | | |
getValAsLong | public long getValAsLong()(Code) | | |
getValBuf | public byte[] getValBuf()(Code) | | |
getValLen | public int getValLen()(Code) | | |
holdKey | final void holdKey(int off)(Code) | | |
insert | public boolean insert(byte[] key, int klen, byte[] data, int doff, int dlen) throws IOException(Code) | | Insert a new key/data pair. We are presumably positioned just before
the spot where the new record should go, but we should check, anyway.
This will return false if the key already exists in the index.
|
main | public static void main(String[] args)(Code) | | Main for testing
|
mkey | final static void mkey(int i, byte[] b)(Code) | | |
next | public boolean next() throws IOException(Code) | | Move the cursor to the next row and return true if the
cursor is positioned on a valid row.
|
position | public long position() throws IOException(Code) | | Return the current position in the index
|
prev | public boolean prev() throws IOException(Code) | | Move the cursor to the next row and return true if the
cursor is positioned on a valid row.
|
release | public void release()(Code) | | |
replace | public boolean replace(byte[] data, int doff, int dlen) throws IOException(Code) | | Replace the data portion of the current item with the specified data
|
seek | final public boolean seek(byte[] key) throws IOException(Code) | | Seek: Position the cursor on or before the specified key value.
Return true if the key matches exactly.
|
seek | public boolean seek(byte[] key, int len) throws IOException(Code) | | Seek, but the key can be a subsequence of the given byte array.
|
seek1 | boolean seek1(int level, byte[] key, int len) throws IOException(Code) | | (Private) seek recursion kernel
|
setBlock | final void setBlock(int i, Block b)(Code) | | Manage updates to the 'blocks' array through this function to
assuage refcount madness.
|
setKeyBuf | public void setKeyBuf(byte[] buf)(Code) | | |
setValBuf | public void setValBuf(byte[] buf)(Code) | | |
setup | protected void setup(boolean restoreKey) throws IOException(Code) | | Called to re-establish the synchronization of this cursor in
the case where the underlying index has been modified.
|
size | public long size() throws IOException(Code) | | Return the total number of entries in this index
|
tick | final static long tick()(Code) | | |
unsetup | public void unsetup()(Code) | | Called (in theory) by the owning Btree when the index is modified.
|
|
|