|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimpledb.index.btree.BTreeIndex
public class BTreeIndex
A B-tree implementation of the Index interface.
Constructor Summary | |
---|---|
BTreeIndex(String idxname,
Schema leafsch,
Transaction tx)
Opens a B-tree index for the specified index. |
Method Summary | |
---|---|
void |
beforeFirst(Constant searchkey)
Traverses the directory to find the leaf block corresponding to the specified search key. |
void |
close()
Closes the index by closing its open leaf page, if necessary. |
void |
delete(Constant dataval,
RID datarid)
Deletes the specified index record. |
RID |
getDataRid()
Returns the dataRID value from the current leaf record. |
void |
insert(Constant dataval,
RID datarid)
Inserts the specified record into the index. |
boolean |
next()
Moves to the next leaf record having the previously-specified search key. |
static int |
searchCost(int numblocks,
int rpb)
Estimates the number of block accesses required to find all index records having a particular search key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BTreeIndex(String idxname, Schema leafsch, Transaction tx)
idxname
- the name of the indexleafsch
- the schema of the leaf index recordstx
- the calling transactionMethod Detail |
---|
public void beforeFirst(Constant searchkey)
beforeFirst
in interface Index
searchkey
- the search key value.Index.beforeFirst(simpledb.query.Constant)
public boolean next()
next
in interface Index
Index.next()
public RID getDataRid()
getDataRid
in interface Index
Index.getDataRid()
public void insert(Constant dataval, RID datarid)
insert
in interface Index
dataval
- the dataval in the new index record.datarid
- the dataRID in the new index record.Index.insert(simpledb.query.Constant, simpledb.record.RID)
public void delete(Constant dataval, RID datarid)
delete
in interface Index
dataval
- the dataval of the deleted index recorddatarid
- the dataRID of the deleted index recordIndex.delete(simpledb.query.Constant, simpledb.record.RID)
public void close()
close
in interface Index
Index.close()
public static int searchCost(int numblocks, int rpb)
numblocks
- the number of blocks in the B-tree directoryrpb
- the number of index entries per block
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |