com.bigdata.journal
Interface ICommitRecord

All Known Implementing Classes:
CommitRecord

public interface ICommitRecord

An interface providing a read-only view of a commit record. A commit record is written on each commit. The basic metadata in the commit record are the root addresses from which various critical resources may be loaded, e.g., data structures for mapping index names to their addresses on the Journal, etc. The Journal maintains an AbstractJournal.getCommitRecord() index over the commits records so that transactions can rapidly recover the commit record corresponding to their historical, read-only ground state.

Version:
$Id: ICommitRecord.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson
TODO:
consider modifying to allow named root addresses for a small #of root names. E.g., an set of {name,addr} pairs that is either scanned as an array list or lookup using a hash table.

Field Summary
static int FIRST_USER_ROOT
          The first root address that may be used for a user-defined object.
static int MAX_ROOT_ADDRS
          The #of root ids.
 
Method Summary
 long getCommitCounter()
          The commit counter associated with the commit record.
 long getRootAddr(int index)
          The last address stored in the specified root address in this commit record.
 int getRootAddrCount()
          The #of allowed root addresses.
 long getTimestamp()
          The timestamp assigned to this commit record -or- 0L iff there is no ICommitRecord written on the Journal.
 

Field Detail

MAX_ROOT_ADDRS

static final int MAX_ROOT_ADDRS
The #of root ids. Their indices are [0:N-1].

See Also:
Constant Field Values

FIRST_USER_ROOT

static final int FIRST_USER_ROOT
The first root address that may be used for a user-defined object. User defined root addresses begin at index 10. The first 10 root addresses are reserved for use by the bigdata architecture.

See Also:
Constant Field Values
Method Detail

getTimestamp

long getTimestamp()
The timestamp assigned to this commit record -or- 0L iff there is no ICommitRecord written on the Journal.


getCommitCounter

long getCommitCounter()
The commit counter associated with the commit record. This is used by transactions in order to determine whether or not intervening commits have occurred since the transaction start time.

TODO:
The IResourceManager introduced overflow of journals. The commitCounter always starts out at zero on a new journal, so the tx should probably examine the IRootBlockView to figure out if this is the same journal on which it started and then the commitCounter to see if there has been an intervening commit.

getRootAddrCount

int getRootAddrCount()
The #of allowed root addresses.


getRootAddr

long getRootAddr(int index)
The last address stored in the specified root address in this commit record.

Parameters:
index - The index of the root address.
Returns:
The address stored at that index.
Throws:
IndexOutOfBoundsException - if the index is negative or too large.


Copyright © 2006-2012 SYSTAP, LLC. All Rights Reserved.