com.bigdata.journal
Interface IAtomicStore

All Superinterfaces:
IAddressManager, IRawStore, IStoreSerializer
All Known Subinterfaces:
IJournal
All Known Implementing Classes:
AbstractJournal, Journal, StoreManager.ManagedJournal

public interface IAtomicStore
extends IRawStore

Interface for low-level operations on a store supporting an atomic commit. Persistent implementations of this interface are restart-safe.

Version:
$Id: IAtomicStore.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Field Summary
 
Fields inherited from interface com.bigdata.rawstore.IAddressManager
NULL
 
Method Summary
 void abort()
          Abandon the current write set (synchronous).
 long commit()
          Atomic commit (synchronous).
 ICommitRecord getCommitRecord(long timestamp)
          Return the ICommitRecord for the most recent committed state whose commit timestamp is less than or equal to timestamp.
 long getRootAddr(int index)
          The last address stored in the specified root slot as of the last committed state of the store.
 IRootBlockView getRootBlockView()
          Return a read-only view of the current root block.
 void setCommitter(int index, ICommitter committer)
          Set a persistence capable data structure for callback during the commit protocol.
 
Methods inherited from interface com.bigdata.rawstore.IRawStore
close, deleteResources, destroy, force, getCounters, getFile, getResourceMetadata, getUUID, isFullyBuffered, isOpen, isReadOnly, isStable, read, size, write
 
Methods inherited from interface com.bigdata.rawstore.IAddressManager
getByteCount, getOffset, packAddr, toAddr, toString, unpackAddr
 
Methods inherited from interface com.bigdata.rawstore.IStoreSerializer
deserialize, deserialize, deserialize, serialize
 

Method Detail

abort

void abort()
Abandon the current write set (synchronous).


commit

long commit()
Atomic commit (synchronous).

Note: if the commit fails (by throwing any kind of exception) then you MUST invoke abort() to abandon the current write set.

Returns:
The timestamp assigned to the ICommitRecord -or- 0L if there were no data to commit.
Throws:
IllegalStateException - if the store is not open.
IllegalStateException - if the store is not writable.

setCommitter

void setCommitter(int index,
                  ICommitter committer)
Set a persistence capable data structure for callback during the commit protocol.

Note: the committers must be reset after restart or whenever

Parameters:
index - The slot in the root block where the address of the ICommitter will be recorded.
committer - The committer.

getRootAddr

long getRootAddr(int index)
The last address stored in the specified root slot as of the last committed state of the store.

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

getRootBlockView

IRootBlockView getRootBlockView()
Return a read-only view of the current root block.

Returns:
The current root block.

getCommitRecord

ICommitRecord getCommitRecord(long timestamp)
Return the ICommitRecord for the most recent committed state whose commit timestamp is less than or equal to timestamp. This is used by a transaction to locate the committed state that is the basis for its operations.

Parameters:
timestamp - The timestamp of interest.
Returns:
The ICommitRecord for the most recent committed state whose commit timestamp is less than or equal to timestamp -or- null iff there are no ICommitRecords that satisfy the probe.


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