com.bigdata.resources
Class StoreManager.ManagedJournal

java.lang.Object
  extended by com.bigdata.journal.AbstractJournal
      extended by com.bigdata.resources.StoreManager.ManagedJournal
All Implemented Interfaces:
ICounterSetAccess, IAtomicStore, IBTreeManager, IIndexManager, IIndexStore, IJournal, IAddressManager, IMRMW, IMROW, IRawStore, IAllocationManager
Enclosing class:
StoreManager

public class StoreManager.ManagedJournal
extends AbstractJournal

The StoreManager.ManagedJournal provides the backing store used to absorb writes and retain history for the scale-out architecture.

Note: This implementation is designed to use a shared ConcurrencyManager across all open journal instances for a DataService.

Version:
$Id: StoreManager.java 6271 2012-04-11 14:34:58Z thompsonbry $
Author:
Bryan Thompson

Nested Class Summary
 
Nested classes/interfaces inherited from class com.bigdata.journal.AbstractJournal
AbstractJournal.BasicHA
 
Field Summary
 
Fields inherited from class com.bigdata.journal.AbstractJournal
DELETEBLOCK, deleteOnClose, doubleSync, forceOnCommit, PREV_ROOTBLOCK, properties, ROOT_ICUVERSION, ROOT_NAME2ADDR, tmpDir
 
Fields inherited from interface com.bigdata.rawstore.IAddressManager
NULL
 
Constructor Summary
protected StoreManager.ManagedJournal(Properties properties)
           
 
Method Summary
 ScheduledFuture<?> addScheduledTask(Runnable task, long initialDelay, long delay, TimeUnit unit)
          Adds a task which will run until canceled, until it throws an exception, or until the service is shutdown.
 long commitNow(long commitTime)
          Note: Exposed for the DataService which needs this for its 2-phase commit protocol.
 boolean getCollectPlatformStatistics()
          true iff performance counters will be collected for the platform on which the client is running.
 boolean getCollectQueueStatistics()
          true iff statistics will be collected for work queues.
 CommitRecordIndex getCommitRecordIndex(long addr)
          Exposed for StoreManger#getResourcesForTimestamp(long) which requires access to the CommitRecordIndex for the lastCommitTime on the historical journals.
 ExecutorService getExecutorService()
          Service for running arbitrary tasks in support of IResourceLocator.
 BigdataFileSystem getGlobalFileSystem()
          Return the global file system used to store block-structured files and their metadata and as a source and sink for map/reduce processing.
 SparseRowStore getGlobalRowStore()
          Return an unisolated view of the global SparseRowStore used to store named property sets.
 SparseRowStore getGlobalRowStore(long timestamp)
          Return a view of the global SparseRowStore used to store named property sets as of the specified timestamp.
 int getHttpdPort()
          The port on which the optional httpd service will be run.
 AbstractLocalTransactionManager getLocalTransactionManager()
          Return the object providing the local transaction manager for this journal.
 DefaultResourceLocator getResourceLocator()
          Return the default locator for resources that are logical index containers (relations and relation containers).
 IResourceLockService getResourceLockService()
          The service that may be used to acquire synchronous distributed locks without deadlock detection.
 TemporaryStore getTempStore()
          A factory for TemporaryStores.
 String toString()
           
protected  void validateIndexMetadata(String name, IndexMetadata metadata)
          Extended to set the IResourceMetadata to this journal if it is null since a remote caller can not have the correct metadata on hand when they formulate the request.
 
Methods inherited from class com.bigdata.journal.AbstractJournal
_close, _getName2Addr, abort, abortContext, assertCanRead, assertCanWrite, assertCommitTimeAdvances, assertOpen, assertPriorCommitTimeAdvances, close, closeForWrites, commit, delete, delete, deleteResources, destroy, detachContext, discardCommitters, dropIndex, ensureMinFree, finalize, force, getBufferStrategy, getByteCount, getCommitRecord, getCommitRecord, getCommitRecordIndex, getCommitRecordStrictlyGreaterThan, getCounters, getFile, getHistoricalIndexCacheSize, getHTree, getHTree, getIndex, getIndex, getIndex, getIndex, getIndexCacheSize, getLastCommitTime, getMaximumExtent, getMaxRecordSize, getName2Addr, getName2Addr, getOffset, getOffsetBits, getPhysicalAddress, getPort, getProperties, getProperty, getProperty, getProperty, getQuorum, getReadOnlyCommitRecordIndex, getResourceMetadata, getRootAddr, getRootBlock, getRootBlocks, getRootBlockView, getUUID, isChecked, isDoubleSync, isFullyBuffered, isHighlyAvailable, isOpen, isReadOnly, isStable, newHAGlue, read, register, registerContext, registerIndex, registerIndex, registerIndex, registerIndex, removeCommitRecordEntries, rollback, setCommitter, setupCommitters, shutdown, shutdownNow, size, toAddr, toString, truncate, write, write
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StoreManager.ManagedJournal

protected StoreManager.ManagedJournal(Properties properties)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

commitNow

public long commitNow(long commitTime)
Note: Exposed for the DataService which needs this for its 2-phase commit protocol.

Overrides:
commitNow in class AbstractJournal
Parameters:
commitTime - The commit time either of a transaction or of an unisolated commit. Note that when mixing isolated and unisolated commits you MUST use the same ITimestampService for both purposes.
Returns:
The timestamp assigned to the commit record -or- 0L if there were no data to commit.

getCommitRecordIndex

public CommitRecordIndex getCommitRecordIndex(long addr)
Exposed for StoreManger#getResourcesForTimestamp(long) which requires access to the CommitRecordIndex for the lastCommitTime on the historical journals.

Note: This always returns a distinct index object. The code relies on this fact to avoid contention with the live CommitRecordIndex for the live journal.

Overrides:
getCommitRecordIndex in class AbstractJournal
Parameters:
addr - The root address of the index -or- 0L if the index has not been created yet.
Returns:
The CommitRecordIndex for that address or a new index if 0L was specified as the address.
See Also:
AbstractJournal._commitRecordIndex

getLocalTransactionManager

public AbstractLocalTransactionManager getLocalTransactionManager()
Description copied from interface: IJournal
Return the object providing the local transaction manager for this journal.


getGlobalRowStore

public SparseRowStore getGlobalRowStore()
Description copied from interface: IIndexStore
Return an unisolated view of the global SparseRowStore used to store named property sets.

See Also:
GlobalRowStoreSchema

getGlobalRowStore

public SparseRowStore getGlobalRowStore(long timestamp)
Description copied from interface: IIndexStore
Return a view of the global SparseRowStore used to store named property sets as of the specified timestamp.

The SparseRowStore only permits ITx.UNISOLATED writes, so you MUST specify ITx.UNISOLATED as the timestamp if you intend to write on the global row store!

You can request the most recent committed state of the global row store by specifying ITx.READ_COMMITTED.

Parameters:
timestamp - The timestamp of the view.
Returns:
The global row store view -or- null if no view exists as of that timestamp.

getGlobalFileSystem

public BigdataFileSystem getGlobalFileSystem()
Description copied from interface: IIndexStore
Return the global file system used to store block-structured files and their metadata and as a source and sink for map/reduce processing.

See Also:
BigdataFileSystem

getResourceLocator

public DefaultResourceLocator getResourceLocator()
Description copied from interface: IIndexStore
Return the default locator for resources that are logical index containers (relations and relation containers).


getExecutorService

public ExecutorService getExecutorService()
Description copied from class: AbstractJournal
Service for running arbitrary tasks in support of IResourceLocator. There is no concurrency control associated with this service, but tasks run here may submit tasks to the ConcurrencyManager.

Specified by:
getExecutorService in interface IIndexStore
Specified by:
getExecutorService in class AbstractJournal

getResourceLockService

public IResourceLockService getResourceLockService()
Description copied from interface: IIndexStore
The service that may be used to acquire synchronous distributed locks without deadlock detection.


getTempStore

public TemporaryStore getTempStore()
Description copied from interface: IIndexStore
A factory for TemporaryStores. TemporaryStores are thread-safe and may be used by multiple processes at once. Old TemporaryStores are eventually retired by the factory and their storage is reclaimed once they are finalized (after they are no longer in use by any process). The decision to retire a TemporaryStore is either made implicitly, when it is no longer weakly reachable, or explicitly, when it has grown large enough that no new processes should begin using that TemporaryStore. In the latter case, the TemporaryStore will remain available to the process(es) using it and a new TemporaryStore will be allocated and made available to the caller.

It is important that processes do not hold a hard reference to a TemporaryStore beyond the end of the process as that will prevent the TemporaryStore from being finalized. Holding reference to an AbstractBTree created on a TemporaryStore is equivalent to holding a hard reference to the TemporaryStore itself since the AbstractBTree holds onto the backing IRawStore using a hard reference.

Returns:
A TemporaryStore.

validateIndexMetadata

protected void validateIndexMetadata(String name,
                                     IndexMetadata metadata)
Extended to set the IResourceMetadata to this journal if it is null since a remote caller can not have the correct metadata on hand when they formulate the request.

Overrides:
validateIndexMetadata in class AbstractJournal

addScheduledTask

public ScheduledFuture<?> addScheduledTask(Runnable task,
                                           long initialDelay,
                                           long delay,
                                           TimeUnit unit)
Description copied from interface: IIndexStore
Adds a task which will run until canceled, until it throws an exception, or until the service is shutdown.

Parameters:
task - The task.
initialDelay - The initial delay.
delay - The delay between invocations.
unit - The units for the delay parameters.
Returns:
The ScheduledFuture for that task.

getCollectPlatformStatistics

public boolean getCollectPlatformStatistics()
Description copied from interface: IIndexStore
true iff performance counters will be collected for the platform on which the client is running.


getCollectQueueStatistics

public boolean getCollectQueueStatistics()
Description copied from interface: IIndexStore
true iff statistics will be collected for work queues.


getHttpdPort

public int getHttpdPort()
Description copied from interface: IIndexStore
The port on which the optional httpd service will be run. The httpd service exposes statistics about the client, its work queues, the platform on which it is running, etc. If this is ZERO (0), then the port will be chosen randomly.



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