|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.rawstore.AbstractRawStore
com.bigdata.rawstore.AbstractRawWormStore
com.bigdata.journal.TemporaryRawStore
com.bigdata.journal.TemporaryStore
public class TemporaryStore
A temporary store that supports named indices but no concurrency controls.
checkpoint() may be used to checkpoint the indices and
restoreLastCheckpoint() may be used to revert to the last
checkpoint. If you note the checkpoint addresses from checkpoint()
then you can restore any checkpoint with restoreCheckpoint(long)
If you want a temporary store that supports named indices and concurrency
controls then choose a Journal with BufferMode.Temporary.
This has the advantage of full concurrency support, group commit, and
low-latency startup (since the file is not created until the store attempts
to write through to the disk). However, TemporaryStore is lighter
weight precisely because it does not provide concurrency control.
| Field Summary |
|---|
| Fields inherited from class com.bigdata.journal.TemporaryRawStore |
|---|
log |
| Fields inherited from class com.bigdata.rawstore.AbstractRawWormStore |
|---|
am |
| Fields inherited from class com.bigdata.rawstore.AbstractRawStore |
|---|
serializer |
| Fields inherited from interface com.bigdata.rawstore.IAddressManager |
|---|
NULL |
| Constructor Summary | |
|---|---|
TemporaryStore()
A TemporaryStore that can scale-up. |
|
TemporaryStore(int offsetBits)
A TemporaryStore provisioned with the specified offsetBits. |
|
TemporaryStore(int offsetBits,
File file)
A TemporaryStore provisioned with the specified offsetBits
and backed by the specified file. |
|
| Method Summary | |
|---|---|
long |
checkpoint()
Checkpoints the dirty indices and notes the new restoreLastCheckpoint() point. |
void |
close()
Close the store and delete the associated file, if any. |
void |
dropIndex(String name)
Drops the named index. |
ExecutorService |
getExecutorService()
A ExecutorService that may be used to parallelize operations. |
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 the global SparseRowStore used to store named property
sets. |
BTree |
getIndex(String name)
Return an ITx.UNISOLATED view of the named index -or-
null if there is no registered index by that name. |
BTree |
getIndex(String name,
long timestamp)
Historical reads and transactions are not supported. |
long |
getLastCommitTime()
Always returns ZERO (0L) since you can not perform a commit on a TemporaryRawStore (it supports checkpoints but not commits). |
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()
Always returns this TemporaryStore. |
void |
registerIndex(IndexMetadata metadata)
Register a named index. |
BTree |
registerIndex(String name,
BTree btree)
Register a named index. |
BTree |
registerIndex(String name,
IndexMetadata metadata)
Register a named index. |
void |
restoreCheckpoint(long checkpointAddr)
Reverts to the checkpoint associated with the given checkpointAddr. |
void |
restoreLastCheckpoint()
Reverts to the last checkpoint, if any. |
| Methods inherited from class com.bigdata.journal.TemporaryRawStore |
|---|
allocate, assertOpen, deleteResources, destroy, finalize, force, getBufferStrategy, getCounters, getFile, getMaxRecordSize, getResourceMetadata, getTempFile, getTempFile, getUUID, isFullyBuffered, isOpen, isReadOnly, isStable, read, size, toString, update, write |
| Methods inherited from class com.bigdata.rawstore.AbstractRawWormStore |
|---|
getAddressManager, getByteCount, getOffset, getOffsetBits, packAddr, toAddr, toString, unpackAddr |
| Methods inherited from class com.bigdata.rawstore.AbstractRawStore |
|---|
deserialize, deserialize, deserialize, serialize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.bigdata.journal.IIndexStore |
|---|
destroy |
| 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 |
| Constructor Detail |
|---|
public TemporaryStore()
TemporaryStore that can scale-up. The backing file will be
created using the Java temporary file mechanism.
WormAddressManager.SCALE_UP_OFFSET_BITS,
TemporaryRawStore.getTempFile()public TemporaryStore(int offsetBits)
TemporaryStore provisioned with the specified offsetBits.
The backing file will be created using the Java temporary file mechanism.
offsetBits - This determines the capacity of the store file and the maximum
length of a record. The value is passed through to
WormAddressManager.WormAddressManager(int).
public TemporaryStore(int offsetBits,
File file)
TemporaryStore provisioned with the specified offsetBits
and backed by the specified file.
offsetBits - This determines the capacity of the store file and the maximum
length of a record. The value is passed through to
WormAddressManager.WormAddressManager(int).file - The backing file (may exist, but must be empty if it exists).| Method Detail |
|---|
public void restoreLastCheckpoint()
public void restoreCheckpoint(long checkpointAddr)
restoreLastCheckpoint() point.
public long checkpoint()
restoreLastCheckpoint() point. You can revert to the last
written checkpoint using restoreLastCheckpoint() or to an
arbitrary checkpoint using restoreCheckpoint(long).
Note: ITx.READ_COMMITTED views of indices become available after
a checkpoint(). If the store has not been checkpointed, then
the read committed views are unavailable for an index. After a checkpoint
in which a given index was dirty, a new read-committed view is available
for that index and checkpoint.
Note: This is NOT an atomic commit protocol, but the restore point will be updated iff the checkpoint succeeds.
public void registerIndex(IndexMetadata metadata)
IIndexManager
Note: The name property MUST be set on the IndexMetadata
and the index will be registered under that name.
registerIndex in interface IIndexManagermetadata - The metadata describing the index.
public BTree registerIndex(String name,
IndexMetadata metadata)
IBTreeManager
This variant allows you to register an index under a name other than the
value returned by IndexMetadata.getName().
Note: This variant is generally by the IMetadataService when it
needs to register a index partition of some scale-out index on a
IDataService. In this case the name is the name of the
index partition while the value reported by
IndexMetadata.getName() is the name of the scale-out index. In
nearly all other cases you can use IIndexManager.registerIndex(IndexMetadata)
instead. The same method signature is also declared by
IDataService.registerIndex(String, IndexMetadata) in order to
support registration of index partitions.
registerIndex in interface IBTreeManagername - The name that can be used to recover the index.metadata - The metadata describing the index.
IBTreeManager.getIndex(String).
public BTree registerIndex(String name,
BTree btree)
IBTreeManager
registerIndex in interface IBTreeManagername - The name that can be used to recover the index.btree - The btree.
IBTreeManager.getIndex(String).public void dropIndex(String name)
IIndexManagerNote: Whether or not and when index resources are reclaimed is dependent on the store. For example, an immortal store will retain all historical states for all indices. Likewise, a store that uses index partitions may be able to delete index segments immediately.
dropIndex in interface IIndexManagername - The name of the index to be dropped.public BTree getIndex(String name)
ITx.UNISOLATED view of the named index -or-
null if there is no registered index by that name.
getIndex in interface IBTreeManagername - The name of the index.
null iff there
is no index registered with that name.
public BTree getIndex(String name,
long timestamp)
Note: If ITx.READ_COMMITTED is requested, then the returned
BTree will reflect the state of the named index as of the last
checkpoint(). This view will be read-only and is NOT updated by
checkpoint(). You must actually checkpoint() before an
ITx.READ_COMMITTED view will be available.
getIndex in interface IIndexStorename - timestamp -
null iff there is no index registered
with that name for that timestamp.
UnsupportedOperationException - unless the timestamp is either ITx.READ_COMMITTED or
ITx.UNISOLATED.public SparseRowStore getGlobalRowStore()
IIndexStoreSparseRowStore used to store named property
sets.
getGlobalRowStore in interface IIndexStoreGlobalRowStoreSchemapublic BigdataFileSystem getGlobalFileSystem()
IIndexStore
getGlobalFileSystem in interface IIndexStoreBigdataFileSystempublic DefaultResourceLocator getResourceLocator()
IIndexStore
getResourceLocator in interface IIndexStorepublic ExecutorService getExecutorService()
IIndexStoreExecutorService that may be used to parallelize operations.
This service is automatically used when materializing located resources.
While the service does not impose concurrency controls, tasks run on this
service may submit operations to a ConcurrencyManager.
getExecutorService in interface IIndexStorepublic final IResourceLockService getResourceLockService()
IIndexStore
getResourceLockService in interface IIndexStorepublic void close()
TemporaryRawStore
close in interface IRawStoreclose in class TemporaryRawStorepublic long getLastCommitTime()
TemporaryRawStore (it supports checkpoints but not commits).
getLastCommitTime in interface IIndexStoreIRootBlockView.getLastCommitTime()public TemporaryStore getTempStore()
TemporaryStore.
getTempStore in interface IIndexStoreTemporaryStore.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||