|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.btree.Checkpoint
public class Checkpoint
A checkpoint record is written each time the btree is flushed to the store.
Note: In order to create a btree use
BTree.create(IRawStore, IndexMetadata) to write the initial
IndexMetadata record and the initial check point on the store. It
will then load the BTree from the Checkpoint record and
you can start using the index.
| Nested Class Summary | |
|---|---|
static class |
Checkpoint.IndexTypeEnum
Type safe enumeration of index types. |
| Constructor Summary | |
|---|---|
Checkpoint()
De-serialization ctor. |
|
Checkpoint(BTree btree)
Creates a Checkpoint record from a BTree. |
|
Checkpoint(HTree htree)
Creates a Checkpoint record from an HTree. |
|
Checkpoint(IndexMetadata metadata)
Create the first checkpoint record for a new BTree from a
IndexMetadata record. |
|
Checkpoint(IndexMetadata metadata,
Checkpoint oldCheckpoint)
Create the first checkpoint record for an existing BTree when it
is propagated on overflow onto a new backing IRawStore. |
|
| Method Summary | |
|---|---|
long |
getBloomFilterAddr()
Address of the IBloomFilter. |
long |
getCheckpointAddr()
The address used to read this Checkpoint record from the
store. |
long |
getCounter()
Return the value of the B+Tree local counter stored in the Checkpoint record. |
long |
getEntryCount()
The #of index entries (aka tuple count). |
int |
getGlobalDepth()
The global depth of the root directory (HTree only). |
int |
getHeight()
The height of a B+Tree. |
Checkpoint.IndexTypeEnum |
getIndexType()
The type of index for this checkpoint record. |
long |
getLeafCount()
The #of leaves (B+Tree) or hash buckets (HTree). |
long |
getMetadataAddr()
Address that can be used to read the IndexMetadata record for
the index from the store. |
long |
getNodeCount()
The #of non-leaf nodes (B+Tree) or directories (HTree). |
long |
getRecordVersion()
Return the value of the next record version number to be assigned that is stored in the Checkpoint record. |
long |
getRootAddr()
Address of the root node or leaf of the BTree. |
boolean |
hasCheckpointAddr()
Return true iff the checkpoint address is defined. |
static Checkpoint |
load(IRawStore store,
long addrCheckpoint)
Read a Checkpoint record from a store. |
void |
readExternal(ObjectInput in)
|
String |
toString()
A human readable representation of the state of the Checkpoint
record. |
void |
write(IRawStore store)
Write the Checkpoint record on the store, setting
addrCheckpoint as a side effect. |
void |
writeExternal(ObjectOutput out)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Checkpoint()
public Checkpoint(IndexMetadata metadata)
BTree from a
IndexMetadata record. The root of the BTree will NOT
exist (its address will be 0L). Once written on the store
the Checkpoint record may be used to obtain a corresponding
instance of a BTree object.
metadata - The index metadata record.
public Checkpoint(IndexMetadata metadata,
Checkpoint oldCheckpoint)
BTree when it
is propagated on overflow onto a new backing IRawStore. The
counter is propagated to the new Checkpoint but
otherwise the initialization is as if for an empty BTree.
metadata - The index metadata record.oldCheckpoint - The last Checkpoint for the index on the old backing
store. The counter is propagated to the new
Checkpoint record.public Checkpoint(BTree btree)
Checkpoint record from a BTree.
Pre-conditions:
null then the root is assumed to be
clean and the root address from the last Checkpoint record is
used. Otherwise the address of the root is used (in which case it MUST be
defined).
btree - The btree.public Checkpoint(HTree htree)
Checkpoint record from an HTree.
Pre-conditions:
null then the root is assumed to be
clean and the root address from the last Checkpoint record is
used. Otherwise the address of the root is used (in which case it MUST be
defined).
htree - The HTree.| Method Detail |
|---|
public final long getCheckpointAddr()
Checkpoint record from the
store.
Note: This is set as a side-effect by write(IRawStore).
IllegalStateException - if the Checkpoint record has not been written on
a store.public final boolean hasCheckpointAddr()
true iff the checkpoint address is defined.
public final long getMetadataAddr()
IndexMetadata record for
the index from the store.
public final long getRootAddr()
BTree.
0L iff the btree
does not have a root.public final long getBloomFilterAddr()
IBloomFilter.
0L iff the
btree does not have a bloom filter.public final int getHeight()
Checkpoint.IndexTypeEnum.BTreepublic final int getGlobalDepth()
Checkpoint.IndexTypeEnum.HTreepublic final long getNodeCount()
public final long getLeafCount()
public final long getEntryCount()
public final long getCounter()
Checkpoint record.
public final long getRecordVersion()
Checkpoint record. This number is incremented each
time a node or leaf is written onto the backing store. The initial value
is ZERO (0). The first value assigned to a node or leaf will be ZERO (0).
public Checkpoint.IndexTypeEnum getIndexType()
public final String toString()
Checkpoint
record.
toString in class Objectpublic final void write(IRawStore store)
Checkpoint record on the store, setting
addrCheckpoint as a side effect.
store -
IllegalStateException - if the Checkpoint record has already been
written.
public static Checkpoint load(IRawStore store,
long addrCheckpoint)
Checkpoint record from a store.
store - The store.addrCheckpoint - The address from which to read the Checkpoint
record. This address is set on the Checkpoint
record as a side-effect.
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface ExternalizableIOException
ClassNotFoundException
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface ExternalizableIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||