Quadcap Embeddable Database

com.quadcap.sql.index.BtreeCursor Class Reference

Inheritance diagram for com.quadcap.sql.index.BtreeCursor:

PooledObject com.quadcap.sql.index.BCursor List of all members.

Detailed Description

A cursor for a Quadcap Btree.

Author:
Stan Bailes

Definition at line 63 of file BtreeCursor.java.

Public Member Functions

void release ()
 Release this cursor back to the pool.

PooledObject create ()
 PooledObject factory.

void init (Btree tree, boolean skipSetup) throws IOException
 Init for use/reuse.

void unsetup ()
 Called (in theory) by the owning Btree when the index is modified.

final boolean seek (byte[] key) throws IOException
 Seek: Position the cursor on or before the specified key value.

boolean seek (byte[] key, int len) throws IOException
 Seek, but the key can be a subsequence of the given byte array.

void beforeFirst () throws IOException
 Move the cursor before the first key.

void afterLast () throws IOException
 Move the cursor after the last key.

boolean absolute (int x) throws IOException
 Move the cursor to the specified absolute position.

boolean next () throws IOException
 Move the cursor to the next row and return true if the cursor is positioned on a valid row.

boolean prev () throws IOException
 Move the cursor to the next row and return true if the cursor is positioned on a valid row.

boolean delete () throws IOException
 Delete the current row (if the cursor is positioned on a valid row, that is ;-).

boolean insert (byte[] key, int klen, byte[] data, int doff, int dlen) throws IOException
 Insert a new key/data pair.

boolean insert (byte[] key, byte[] data) throws IOException
boolean replace (byte[] data, int doff, int dlen) throws IOException
 Replace the data portion of the current item with the specified data.

boolean replace (byte[] data) throws IOException
long size () throws IOException
 Return the total number of entries in this index.

long position () throws IOException
 Return the current position in the index.

void close ()
 Close the index.

int getKey (byte[] buf)
byte[] getKeyBuf ()
void setKeyBuf (byte[] buf)
int getKeyLen ()
byte[] getKey ()
int getVal (byte[] buf)
byte[] getValBuf ()
void setValBuf (byte[] buf)
int getValLen ()
byte[] getVal ()
long getValAsLong ()
String toString ()

Static Public Member Functions

void main (String[] args)
 Main for testing.


Protected Member Functions

void setup (boolean restoreKey) throws IOException
 Called to re-establish the synchronization of this cursor in the case where the underlying index has been modified.


Package Functions

final String id ()
final String dr ()
boolean seek1 (int level, byte[] key, int len) throws IOException
 (Private) seek recursion kernel

final void setBlock (int i, Block b)
 Manage updates to the 'blocks' array through this function to assuage refcount madness.

final boolean getNextBlock () throws IOException
final boolean getPrevBlock () throws IOException
final void holdKey (int off)
String k (byte[] b, int off, int len)
String t ()

Static Package Functions

BtreeCursor get (Btree tree, boolean skipSetup) throws IOException
long subtreeSize (Bnode root, Block b) throws IOException
final String r (boolean b)
void itest (BCursor bc) throws IOException
String doLine (BCursor bc, String line) throws Exception
void show (String s)
final long tick ()
final void mkey (int i, byte[] b)
void ktest (BCursor c) throws IOException
void kshow (BCursor c) throws IOException
void ktest (Btree t) throws IOException
void jtest (BCursor c) throws Exception

Package Attributes

Object fileLock
Btree tree
Bnode root = null
Comparator compare = null
Block[] blocks = new Block[16]
int[] pointers = new int[16]
byte[] curKey = new byte[4096]
byte[] curVal = new byte[4096]
int[] lengths = new int[2]
int depth = -1
long size = -1
long position = posUNKNOWN

Static Package Attributes

final long posUNKNOWN = -2
final long posAFTER_LAST = -1
final long posBEFORE_FIRST = 0
final boolean noPool = false
ObjectPool pool = new ObjectPool(new BtreeCursor())
int lastCount = -1
StringBuffer lastBuf = new StringBuffer()

Private Member Functions

 BtreeCursor ()
 Constructor for cursor on a given Btree.


Static Private Member Functions

final int countNext (BCursor c) throws IOException
final int countPrev (BCursor c) throws IOException


Constructor & Destructor Documentation

com.quadcap.sql.index.BtreeCursor.BtreeCursor  )  [private]
 

Constructor for cursor on a given Btree.

Definition at line 98 of file BtreeCursor.java.

Referenced by com.quadcap.sql.index.BtreeCursor.create(), and com.quadcap.sql.index.BtreeCursor.get().


Member Function Documentation

boolean com.quadcap.sql.index.BtreeCursor.absolute int  x  )  throws IOException
 

Move the cursor to the specified absolute position.

Implements com.quadcap.sql.index.BCursor.

Definition at line 316 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.absolute(), com.quadcap.sql.index.BtreeCursor.afterLast(), com.quadcap.sql.index.BtreeCursor.beforeFirst(), com.quadcap.sql.index.BtreeCursor.blocks, com.quadcap.sql.index.BtreeCursor.depth, com.quadcap.sql.index.BtreeCursor.fileLock, com.quadcap.sql.index.BtreeCursor.getNextBlock(), com.quadcap.sql.index.BtreeCursor.getPrevBlock(), com.quadcap.sql.index.BtreeCursor.holdKey(), com.quadcap.sql.index.BtreeCursor.pointers, com.quadcap.sql.index.BtreeCursor.position, com.quadcap.sql.index.BtreeCursor.size, and com.quadcap.sql.index.BtreeCursor.toString().

Referenced by com.quadcap.sql.index.BtreeCursor.absolute().

void com.quadcap.sql.index.BtreeCursor.afterLast  )  throws IOException
 

Move the cursor after the last key.

Implements com.quadcap.sql.index.BCursor.

Definition at line 290 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.fileLock, com.quadcap.sql.index.Bnode.getBlock(), com.quadcap.sql.index.BtreeCursor.pointers, com.quadcap.sql.index.BtreeCursor.posAFTER_LAST, com.quadcap.sql.index.BtreeCursor.position, com.quadcap.sql.index.BtreeCursor.root, and com.quadcap.sql.index.BtreeCursor.toString().

Referenced by com.quadcap.sql.index.BtreeCursor.absolute().

void com.quadcap.sql.index.BtreeCursor.beforeFirst  )  throws IOException
 

Move the cursor before the first key.

Implements com.quadcap.sql.index.BCursor.

Definition at line 260 of file BtreeCursor.java.

References com.quadcap.sql.index.Btree.compare, com.quadcap.sql.index.BtreeCursor.depth, com.quadcap.sql.index.BtreeCursor.fileLock, com.quadcap.sql.index.Bnode.getBlock(), com.quadcap.sql.index.Btree.getRoot(), com.quadcap.sql.index.BtreeCursor.lengths, com.quadcap.sql.index.BtreeCursor.pointers, com.quadcap.sql.index.BtreeCursor.posBEFORE_FIRST, com.quadcap.sql.index.BtreeCursor.position, com.quadcap.sql.index.BtreeCursor.root, com.quadcap.sql.index.BtreeCursor.toString(), and com.quadcap.sql.index.BtreeCursor.tree.

Referenced by com.quadcap.sql.index.BtreeCursor.absolute(), com.quadcap.sql.index.BtreeCursor.init(), and com.quadcap.sql.index.BtreeCursor.setup().

void com.quadcap.sql.index.BtreeCursor.close  ) 
 

Close the index.

Implements com.quadcap.sql.index.BCursor.

Definition at line 597 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.unsetup().

final int com.quadcap.sql.index.BtreeCursor.countNext BCursor  c  )  throws IOException [static, private]
 

Definition at line 746 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.countNext(), and com.quadcap.sql.index.BtreeCursor.lastCount.

Referenced by com.quadcap.sql.index.BtreeCursor.countNext().

final int com.quadcap.sql.index.BtreeCursor.countPrev BCursor  c  )  throws IOException [static, private]
 

Definition at line 753 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.countPrev(), com.quadcap.sql.index.BtreeCursor.lastBuf, and com.quadcap.sql.index.BtreeCursor.lastCount.

Referenced by com.quadcap.sql.index.BtreeCursor.countPrev().

PooledObject com.quadcap.sql.index.BtreeCursor.create  ) 
 

PooledObject factory.

Definition at line 134 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.BtreeCursor().

boolean com.quadcap.sql.index.BtreeCursor.delete  )  throws IOException
 

Delete the current row (if the cursor is positioned on a valid row, that is ;-).

Implements com.quadcap.sql.index.BCursor.

Definition at line 448 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.blocks, com.quadcap.sql.index.Bnode.deleteKeyAtPos(), com.quadcap.sql.index.BtreeCursor.depth, com.quadcap.sql.index.BtreeCursor.fileLock, com.quadcap.sql.index.Btree.notifyUpdate(), com.quadcap.sql.index.BtreeCursor.pointers, com.quadcap.sql.index.BtreeCursor.root, com.quadcap.sql.index.BtreeCursor.toString(), and com.quadcap.sql.index.BtreeCursor.tree.

String com.quadcap.sql.index.BtreeCursor.doLine BCursor  bc,
String  line
throws Exception [static, package]
 

Definition at line 792 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.doLine(), and com.quadcap.sql.index.BtreeCursor.show().

Referenced by com.quadcap.sql.index.BtreeCursor.doLine(), and com.quadcap.sql.index.BtreeCursor.itest().

final String com.quadcap.sql.index.BtreeCursor.dr  )  [package]
 

Definition at line 217 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.getVal(), and com.quadcap.sql.index.BtreeCursor.lengths.

Referenced by com.quadcap.sql.index.BtreeCursor.next().

BtreeCursor com.quadcap.sql.index.BtreeCursor.get Btree  tree,
boolean  skipSetup
throws IOException [static, package]
 

Definition at line 103 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.BtreeCursor(), com.quadcap.sql.index.BtreeCursor.get(), com.quadcap.sql.index.BtreeCursor.init(), com.quadcap.sql.index.Btree.lock, com.quadcap.sql.index.BtreeCursor.noPool, com.quadcap.sql.index.BtreeCursor.pool, and com.quadcap.sql.index.BtreeCursor.tree.

Referenced by com.quadcap.sql.index.BtreeCursor.get().

byte [] com.quadcap.sql.index.BtreeCursor.getKey  ) 
 

Implements com.quadcap.sql.index.BCursor.

Definition at line 612 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.curKey, and com.quadcap.sql.index.BtreeCursor.lengths.

int com.quadcap.sql.index.BtreeCursor.getKey byte[]  buf  ) 
 

Implements com.quadcap.sql.index.BCursor.

Definition at line 601 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.curKey, and com.quadcap.sql.index.BtreeCursor.lengths.

byte [] com.quadcap.sql.index.BtreeCursor.getKeyBuf  ) 
 

Implements com.quadcap.sql.index.BCursor.

Definition at line 606 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.curKey.

Referenced by com.quadcap.sql.index.BtreeCursor.next().

int com.quadcap.sql.index.BtreeCursor.getKeyLen  ) 
 

Implements com.quadcap.sql.index.BCursor.

Definition at line 610 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.lengths.

Referenced by com.quadcap.sql.index.BtreeCursor.next().

final boolean com.quadcap.sql.index.BtreeCursor.getNextBlock  )  throws IOException [package]
 

Definition at line 641 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.blocks, com.quadcap.sql.index.BtreeCursor.depth, com.quadcap.sql.index.Bnode.getBlock(), com.quadcap.sql.index.BtreeCursor.pointers, and com.quadcap.sql.index.BtreeCursor.root.

Referenced by com.quadcap.sql.index.BtreeCursor.absolute(), and com.quadcap.sql.index.BtreeCursor.next().

final boolean com.quadcap.sql.index.BtreeCursor.getPrevBlock  )  throws IOException [package]
 

Definition at line 663 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.blocks, com.quadcap.sql.index.BtreeCursor.depth, com.quadcap.sql.index.Bnode.getBlock(), com.quadcap.sql.index.BtreeCursor.pointers, and com.quadcap.sql.index.BtreeCursor.root.

Referenced by com.quadcap.sql.index.BtreeCursor.absolute(), and com.quadcap.sql.index.BtreeCursor.prev().

byte [] com.quadcap.sql.index.BtreeCursor.getVal  ) 
 

Implements com.quadcap.sql.index.BCursor.

Definition at line 629 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.curVal, and com.quadcap.sql.index.BtreeCursor.lengths.

Referenced by com.quadcap.sql.index.BtreeCursor.dr().

int com.quadcap.sql.index.BtreeCursor.getVal byte[]  buf  ) 
 

Implements com.quadcap.sql.index.BCursor.

Definition at line 618 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.curVal, and com.quadcap.sql.index.BtreeCursor.lengths.

long com.quadcap.sql.index.BtreeCursor.getValAsLong  ) 
 

Implements com.quadcap.sql.index.BCursor.

Definition at line 635 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.curVal.

byte [] com.quadcap.sql.index.BtreeCursor.getValBuf  ) 
 

Implements com.quadcap.sql.index.BCursor.

Definition at line 623 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.curVal.

int com.quadcap.sql.index.BtreeCursor.getValLen  ) 
 

Implements com.quadcap.sql.index.BCursor.

Definition at line 627 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.lengths.

final void com.quadcap.sql.index.BtreeCursor.holdKey int  off  )  [package]
 

Definition at line 688 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.blocks, com.quadcap.sql.index.BtreeCursor.curKey, com.quadcap.sql.index.BtreeCursor.curVal, com.quadcap.sql.index.BtreeCursor.depth, com.quadcap.sql.index.BtreeCursor.holdKey(), com.quadcap.sql.index.BtreeCursor.lengths, and com.quadcap.sql.index.BtreeCursor.pointers.

Referenced by com.quadcap.sql.index.BtreeCursor.absolute(), com.quadcap.sql.index.BtreeCursor.holdKey(), com.quadcap.sql.index.BtreeCursor.next(), com.quadcap.sql.index.BtreeCursor.prev(), and com.quadcap.sql.index.BtreeCursor.seek().

final String com.quadcap.sql.index.BtreeCursor.id  )  [package]
 

Definition at line 213 of file BtreeCursor.java.

References com.quadcap.sql.index.Btree.getFile(), com.quadcap.sql.file.BlockFile.getName(), com.quadcap.sql.index.Btree.getRootBlock(), and com.quadcap.sql.index.BtreeCursor.tree.

void com.quadcap.sql.index.BtreeCursor.init Btree  tree,
boolean  skipSetup
throws IOException
 

Init for use/reuse.

Definition at line 141 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.beforeFirst(), com.quadcap.sql.index.BtreeCursor.init(), com.quadcap.sql.index.Btree.lock, and com.quadcap.sql.index.BtreeCursor.tree.

Referenced by com.quadcap.sql.index.BtreeCursor.get(), and com.quadcap.sql.index.BtreeCursor.init().

boolean com.quadcap.sql.index.BtreeCursor.insert byte[]  key,
byte[]  data
throws IOException
 

Implements com.quadcap.sql.index.BCursor.

Definition at line 510 of file BtreeCursor.java.

boolean com.quadcap.sql.index.BtreeCursor.insert byte[]  key,
int  klen,
byte[]  data,
int  doff,
int  dlen
throws IOException
 

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.

Implements com.quadcap.sql.index.BCursor.

Definition at line 476 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.blocks, com.quadcap.sql.index.BtreeCursor.compare, com.quadcap.sql.index.BtreeCursor.depth, com.quadcap.sql.index.BtreeCursor.fileLock, com.quadcap.sql.index.BtreeCursor.insert(), com.quadcap.sql.index.BtreeCursor.k(), com.quadcap.sql.index.Btree.notifyUpdate(), com.quadcap.sql.index.BtreeCursor.pointers, com.quadcap.sql.index.BtreeCursor.r(), com.quadcap.sql.index.BtreeCursor.root, com.quadcap.sql.index.Bnode.setKey(), com.quadcap.sql.index.BtreeCursor.toString(), and com.quadcap.sql.index.BtreeCursor.tree.

Referenced by com.quadcap.sql.index.BtreeCursor.insert().

void com.quadcap.sql.index.BtreeCursor.itest BCursor  bc  )  throws IOException [static, package]
 

Definition at line 773 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.doLine(), com.quadcap.sql.index.BtreeCursor.itest(), and com.quadcap.sql.index.BtreeCursor.t().

Referenced by com.quadcap.sql.index.BtreeCursor.itest().

void com.quadcap.sql.index.BtreeCursor.jtest BCursor  c  )  throws Exception [static, package]
 

Definition at line 945 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.jtest(), com.quadcap.sql.index.BtreeCursor.lastBuf, and com.quadcap.sql.index.BtreeCursor.lastCount.

Referenced by com.quadcap.sql.index.BtreeCursor.jtest().

String com.quadcap.sql.index.BtreeCursor.k byte[]  b,
int  off,
int  len
[package]
 

Definition at line 728 of file BtreeCursor.java.

References com.quadcap.sql.index.Btree.compare, com.quadcap.sql.index.BtreeCursor.k(), com.quadcap.sql.index.Comparator.toString(), and com.quadcap.sql.index.BtreeCursor.tree.

Referenced by com.quadcap.sql.index.BtreeCursor.insert(), com.quadcap.sql.index.BtreeCursor.k(), and com.quadcap.sql.index.BtreeCursor.replace().

void com.quadcap.sql.index.BtreeCursor.kshow BCursor  c  )  throws IOException [static, package]
 

Definition at line 887 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.kshow(), and com.quadcap.sql.index.BtreeCursor.tick().

Referenced by com.quadcap.sql.index.BtreeCursor.kshow(), and com.quadcap.sql.index.BtreeCursor.ktest().

void com.quadcap.sql.index.BtreeCursor.ktest Btree  t  )  throws IOException [static, package]
 

Definition at line 904 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.tick().

void com.quadcap.sql.index.BtreeCursor.ktest BCursor  c  )  throws IOException [static, package]
 

Definition at line 870 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.kshow(), com.quadcap.sql.index.BtreeCursor.ktest(), and com.quadcap.sql.index.BtreeCursor.tick().

Referenced by com.quadcap.sql.index.BtreeCursor.ktest().

void com.quadcap.sql.index.BtreeCursor.main String[]  args  )  [static]
 

Main for testing.

Definition at line 921 of file BtreeCursor.java.

References com.quadcap.sql.index.Btree.getCursor(), com.quadcap.sql.index.BtreeCursor.main(), and com.quadcap.sql.file.BlockFile.newPage().

Referenced by com.quadcap.sql.index.BtreeCursor.main().

final void com.quadcap.sql.index.BtreeCursor.mkey int  i,
byte[]  b
[static, package]
 

Definition at line 861 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.mkey().

Referenced by com.quadcap.sql.index.BtreeCursor.mkey().

boolean com.quadcap.sql.index.BtreeCursor.next  )  throws IOException
 

Move the cursor to the next row and return true if the cursor is positioned on a valid row.

Implements com.quadcap.sql.index.BCursor.

Definition at line 369 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.blocks, com.quadcap.sql.index.BtreeCursor.depth, com.quadcap.sql.index.BtreeCursor.dr(), com.quadcap.sql.index.BtreeCursor.fileLock, com.quadcap.sql.index.BtreeCursor.getKeyBuf(), com.quadcap.sql.index.BtreeCursor.getKeyLen(), com.quadcap.sql.index.BtreeCursor.getNextBlock(), com.quadcap.sql.index.BtreeCursor.holdKey(), com.quadcap.sql.index.BtreeCursor.pointers, com.quadcap.sql.index.BtreeCursor.position, and com.quadcap.sql.index.BtreeCursor.toString().

long com.quadcap.sql.index.BtreeCursor.position  )  throws IOException
 

Return the current position in the index.

Implements com.quadcap.sql.index.BCursor.

Definition at line 562 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.blocks, com.quadcap.sql.index.BtreeCursor.depth, com.quadcap.sql.index.BtreeCursor.fileLock, com.quadcap.sql.index.Bnode.getBlock(), com.quadcap.sql.index.BtreeCursor.pointers, com.quadcap.sql.index.BtreeCursor.r(), com.quadcap.sql.index.BtreeCursor.root, com.quadcap.sql.index.BtreeCursor.size(), and com.quadcap.sql.index.BtreeCursor.subtreeSize().

boolean com.quadcap.sql.index.BtreeCursor.prev  )  throws IOException
 

Move the cursor to the next row and return true if the cursor is positioned on a valid row.

Implements com.quadcap.sql.index.BCursor.

Definition at line 413 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.blocks, com.quadcap.sql.index.BtreeCursor.depth, com.quadcap.sql.index.BtreeCursor.fileLock, com.quadcap.sql.index.BtreeCursor.getPrevBlock(), com.quadcap.sql.index.BtreeCursor.holdKey(), com.quadcap.sql.index.BtreeCursor.pointers, com.quadcap.sql.index.BtreeCursor.posAFTER_LAST, com.quadcap.sql.index.BtreeCursor.position, com.quadcap.sql.index.BtreeCursor.posUNKNOWN, com.quadcap.sql.index.BtreeCursor.size, and com.quadcap.sql.index.BtreeCursor.toString().

final String com.quadcap.sql.index.BtreeCursor.r boolean  b  )  [static, package]
 

Definition at line 770 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.r().

Referenced by com.quadcap.sql.index.BtreeCursor.insert(), com.quadcap.sql.index.BtreeCursor.position(), and com.quadcap.sql.index.BtreeCursor.r().

void com.quadcap.sql.index.BtreeCursor.release  ) 
 

Release this cursor back to the pool.

Implements com.quadcap.sql.index.BCursor.

Definition at line 118 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.fileLock, com.quadcap.sql.index.BtreeCursor.noPool, com.quadcap.sql.index.BtreeCursor.pool, com.quadcap.sql.index.Btree.releaseCursor(), com.quadcap.sql.index.BtreeCursor.tree, and com.quadcap.sql.index.BtreeCursor.unsetup().

Referenced by com.quadcap.sql.index.Btree.free().

boolean com.quadcap.sql.index.BtreeCursor.replace byte[]  data  )  throws IOException
 

Implements com.quadcap.sql.index.BCursor.

Definition at line 542 of file BtreeCursor.java.

boolean com.quadcap.sql.index.BtreeCursor.replace byte[]  data,
int  doff,
int  dlen
throws IOException
 

Replace the data portion of the current item with the specified data.

Implements com.quadcap.sql.index.BCursor.

Definition at line 517 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.blocks, com.quadcap.sql.index.BtreeCursor.curKey, com.quadcap.sql.index.BtreeCursor.depth, com.quadcap.sql.index.BtreeCursor.fileLock, com.quadcap.sql.index.BtreeCursor.k(), com.quadcap.sql.index.BtreeCursor.lengths, com.quadcap.sql.index.Btree.notifyUpdate(), com.quadcap.sql.index.BtreeCursor.pointers, com.quadcap.sql.index.BtreeCursor.replace(), com.quadcap.sql.index.BtreeCursor.root, com.quadcap.sql.index.Bnode.setKey(), com.quadcap.sql.index.BtreeCursor.toString(), and com.quadcap.sql.index.BtreeCursor.tree.

Referenced by com.quadcap.sql.index.BtreeCursor.replace().

boolean com.quadcap.sql.index.BtreeCursor.seek byte[]  key,
int  len
throws IOException
 

Seek, but the key can be a subsequence of the given byte array.

Implements com.quadcap.sql.index.BCursor.

Definition at line 193 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.fileLock, com.quadcap.sql.index.Bnode.getBlock(), com.quadcap.sql.index.BtreeCursor.holdKey(), com.quadcap.sql.index.BtreeCursor.position, com.quadcap.sql.index.BtreeCursor.posUNKNOWN, com.quadcap.sql.index.BtreeCursor.root, com.quadcap.sql.index.BtreeCursor.seek1(), com.quadcap.sql.index.BtreeCursor.setBlock(), and com.quadcap.sql.index.BtreeCursor.toString().

final boolean com.quadcap.sql.index.BtreeCursor.seek byte[]  key  )  throws IOException
 

Seek: Position the cursor on or before the specified key value.

Return true if the key matches exactly.

Implements com.quadcap.sql.index.BCursor.

Definition at line 186 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.seek().

Referenced by com.quadcap.sql.index.BtreeCursor.seek(), and com.quadcap.sql.index.BtreeCursor.setup().

boolean com.quadcap.sql.index.BtreeCursor.seek1 int  level,
byte[]  key,
int  len
throws IOException [package]
 

(Private) seek recursion kernel

Definition at line 227 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.blocks, com.quadcap.sql.index.BtreeCursor.compare, com.quadcap.sql.index.BtreeCursor.depth, com.quadcap.sql.index.Bnode.getBlock(), com.quadcap.sql.index.BtreeCursor.pointers, com.quadcap.sql.index.BtreeCursor.root, com.quadcap.sql.index.BtreeCursor.seek1(), and com.quadcap.sql.index.BtreeCursor.setBlock().

Referenced by com.quadcap.sql.index.BtreeCursor.seek(), and com.quadcap.sql.index.BtreeCursor.seek1().

final void com.quadcap.sql.index.BtreeCursor.setBlock int  i,
Block  b
[package]
 

Manage updates to the 'blocks' array through this function to assuage refcount madness.

Definition at line 252 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.blocks, and com.quadcap.sql.index.BtreeCursor.setBlock().

Referenced by com.quadcap.sql.index.BtreeCursor.seek(), com.quadcap.sql.index.BtreeCursor.seek1(), com.quadcap.sql.index.BtreeCursor.setBlock(), and com.quadcap.sql.index.BtreeCursor.unsetup().

void com.quadcap.sql.index.BtreeCursor.setKeyBuf byte[]  buf  ) 
 

Implements com.quadcap.sql.index.BCursor.

Definition at line 608 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.curKey, and com.quadcap.sql.index.BtreeCursor.setKeyBuf().

Referenced by com.quadcap.sql.index.BtreeCursor.setKeyBuf().

void com.quadcap.sql.index.BtreeCursor.setup boolean  restoreKey  )  throws IOException [protected]
 

Called to re-establish the synchronization of this cursor in the case where the underlying index has been modified.

Definition at line 153 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.beforeFirst(), com.quadcap.sql.index.Btree.compare, com.quadcap.sql.index.BtreeCursor.curKey, com.quadcap.sql.index.BtreeCursor.depth, com.quadcap.sql.index.BtreeCursor.fileLock, com.quadcap.sql.index.Btree.getRoot(), com.quadcap.sql.index.BtreeCursor.lengths, com.quadcap.sql.index.BtreeCursor.seek(), com.quadcap.sql.index.BtreeCursor.setup(), and com.quadcap.sql.index.BtreeCursor.tree.

Referenced by com.quadcap.sql.index.BtreeCursor.setup().

void com.quadcap.sql.index.BtreeCursor.setValBuf byte[]  buf  ) 
 

Implements com.quadcap.sql.index.BCursor.

Definition at line 625 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.curVal, and com.quadcap.sql.index.BtreeCursor.setValBuf().

Referenced by com.quadcap.sql.index.BtreeCursor.setValBuf().

void com.quadcap.sql.index.BtreeCursor.show String  s  )  [static, package]
 

Definition at line 855 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.show().

Referenced by com.quadcap.sql.index.BtreeCursor.doLine(), and com.quadcap.sql.index.BtreeCursor.show().

long com.quadcap.sql.index.BtreeCursor.size  )  throws IOException
 

Return the total number of entries in this index.

Implements com.quadcap.sql.index.BCursor.

Definition at line 549 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.fileLock, com.quadcap.sql.index.Bnode.getBlock(), com.quadcap.sql.index.BtreeCursor.root, and com.quadcap.sql.index.BtreeCursor.subtreeSize().

Referenced by com.quadcap.sql.index.BtreeCursor.position().

long com.quadcap.sql.index.BtreeCursor.subtreeSize Bnode  root,
Block  b
throws IOException [static, package]
 

Definition at line 705 of file BtreeCursor.java.

References com.quadcap.sql.index.Bnode.getBlock(), com.quadcap.sql.index.BtreeCursor.root, and com.quadcap.sql.index.BtreeCursor.subtreeSize().

Referenced by com.quadcap.sql.index.BtreeCursor.position(), com.quadcap.sql.index.BtreeCursor.size(), and com.quadcap.sql.index.BtreeCursor.subtreeSize().

String com.quadcap.sql.index.BtreeCursor.t  )  [package]
 

Definition at line 732 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.blocks, com.quadcap.sql.index.BtreeCursor.depth, and com.quadcap.sql.index.BtreeCursor.pointers.

Referenced by com.quadcap.sql.index.BtreeCursor.itest().

final long com.quadcap.sql.index.BtreeCursor.tick  )  [static, package]
 

Definition at line 859 of file BtreeCursor.java.

Referenced by com.quadcap.sql.index.BtreeCursor.kshow(), and com.quadcap.sql.index.BtreeCursor.ktest().

String com.quadcap.sql.index.BtreeCursor.toString  ) 
 

Definition at line 724 of file BtreeCursor.java.

References com.quadcap.sql.index.BtreeCursor.tree.

Referenced by com.quadcap.sql.index.BtreeCursor.absolute(), com.quadcap.sql.index.BtreeCursor.afterLast(), com.quadcap.sql.index.BtreeCursor.beforeFirst(), com.quadcap.sql.index.BtreeCursor.delete(), com.quadcap.sql.index.BtreeCursor.insert(), com.quadcap.sql.index.BtreeCursor.next(), com.quadcap.sql.index.BtreeCursor.prev(), com.quadcap.sql.index.BtreeCursor.replace(), and com.quadcap.sql.index.BtreeCursor.seek().

void com.quadcap.sql.index.BtreeCursor.unsetup