public class StoreManager.ManagedJournal extends AbstractJournal
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
.
AbstractJournal.BasicHA, AbstractJournal.ISnapshotData, AbstractJournal.ISnapshotEntry, AbstractJournal.SnapshotData
DELETEBLOCK, deleteOnClose, doubleSync, forceOnCommit, haLog, PREV_ROOTBLOCK, properties, ROOT_ICUVERSION, ROOT_NAME2ADDR, tmpDir
NULL
Modifier | Constructor and Description |
---|---|
protected |
StoreManager.ManagedJournal(Properties properties) |
Modifier and Type | Method and Description |
---|---|
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,
boolean readOnly)
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
TemporaryStore s. |
boolean |
isGroupCommit()
The data services support group commit.
|
boolean |
isHAJournal()
Convenience method created in BLZG-1370 to factor out bigdata-jini
artifact dependencies.
|
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. |
_close, _getName2Addr, abort, abortContext, assertBefore, assertCanRead, assertCanWrite, assertCommitTimeAdvances, assertHAReady, assertOpen, assertPriorCommitTimeAdvances, awaitHAReady, clearQuorumToken, close, closeForWrites, commit, delete, delete, deleteResources, destroy, detachContext, discardCommitters, doLocalAbort, doLocalCommit, doLocalCommit, dropIndex, ensureMinFree, finalize, force, getBufferStrategy, getByteCount, getCommitRecord, getCommitRecord, getCommitRecordStrictlyGreaterThan, getCounters, getEarliestVisibleCommitRecordForHA, getFile, getHAPrepareTimeout, getHAReady, getHAReleaseTimeConsensusTimeout, getHAStatus, getHistoricalIndexCacheSize, getIndex, getIndex, getIndexCacheSize, getIndexCounters, getIndexLocal, getIndexWithCheckpointAddr, getIndexWithCommitRecord, getInputStream, getLastCommitTime, getMaximumClockSkewMillis, getMaximumExtent, getMaxRecordSize, getName2Addr, getName2Addr, getOffset, getOffsetBits, getOutputStream, getOutputStream, getPhysicalAddress, getProperties, getProperty, getProperty, getProperty, getQuorum, getQuorumToken, getReadOnlyCommitRecordIndex, getResourceMetadata, getRootAddr, getRootBlocks, getRootBlockView, getRootBlockViewWithLock, getUnisolatedIndex, getUUID, indexNameScan, installRootBlocks, invalidateCommitters, isChecked, isDirty, isDoubleSync, isFullyBuffered, isOpen, isReadOnly, isStable, newAllocationContext, newHAGlue, read, register, registerIndex, registerIndex, registerIndex, registerIndex, removeCommitRecordEntries, rollback, setCommitter, setQuorumToken, setupCommitters, shutdown, shutdownNow, size, snapshotAllocationData, toAddr, toString, truncate, write, write
protected StoreManager.ManagedJournal(Properties properties)
public long commitNow(long commitTime)
DataService
which needs this for its
2-phase commit protocol.commitNow
in class AbstractJournal
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.public CommitRecordIndex getCommitRecordIndex(long addr, boolean readOnly)
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.
getCommitRecordIndex
in class AbstractJournal
addr
- The root address of the index -or- 0L if the index has not
been created yet. When addr is non-IAddressManager.NULL
, each
invocation will return a distinct CommitRecordIndex
object.readOnly
- When false
the returned is NOT cached.CommitRecordIndex
for that address or a new index if
0L
was specified as the address.AbstractJournal._commitRecordIndex
public AbstractLocalTransactionManager getLocalTransactionManager()
IJournal
public boolean isGroupCommit()
(NSS GROUP COMMIT)
public SparseRowStore getGlobalRowStore()
IIndexStore
SparseRowStore
used to
store named property sets.GlobalRowStoreSchema
public SparseRowStore getGlobalRowStore(long timestamp)
IIndexStore
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
.
timestamp
- The timestamp of the view.null
if no view
exists as of that timestamp.public BigdataFileSystem getGlobalFileSystem()
IIndexStore
BigdataFileSystem
public DefaultResourceLocator getResourceLocator()
IIndexStore
public ExecutorService getExecutorService()
AbstractJournal
IResourceLocator
. There is no concurrency control associated with
this service, but tasks run here may submit tasks to the
ConcurrencyManager
.getExecutorService
in interface IIndexStore
getExecutorService
in class AbstractJournal
public IResourceLockService getResourceLockService()
IIndexStore
public TemporaryStore getTempStore()
IIndexStore
TemporaryStore
s. TemporaryStore
s are
thread-safe and may be used by multiple processes at once. Old
TemporaryStore
s 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.
TemporaryStore
.protected void validateIndexMetadata(String name, IndexMetadata metadata)
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.validateIndexMetadata
in class AbstractJournal
public ScheduledFuture<?> addScheduledTask(Runnable task, long initialDelay, long delay, TimeUnit unit)
IIndexStore
task
- The task.initialDelay
- The initial delay.delay
- The delay between invocations.unit
- The units for the delay parameters.ScheduledFuture
for that task.public boolean getCollectPlatformStatistics()
IIndexStore
true
iff performance counters will be collected for the
platform on which the client is running.public boolean getCollectQueueStatistics()
IIndexStore
true
iff statistics will be collected for work queues.public int getHttpdPort()
IIndexStore
public boolean isHAJournal()
IJournal
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.