public class TemporaryStore extends TemporaryRawStore implements IBTreeManager
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.
am
NULL
Constructor and Description |
---|
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. |
Modifier and Type | Method and Description |
---|---|
ScheduledFuture<?> |
addScheduledTask(Runnable task,
long initialDelay,
long delay,
TimeUnit unit)
Not supported, returns
null . |
void |
close()
Close the store and delete the associated file, if any.
|
void |
dropIndex(String name)
Drops the named index.
|
boolean |
getCollectPlatformStatistics()
Not supported, returns
false . |
boolean |
getCollectQueueStatistics()
Not supported, returns
false . |
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 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()
Not supported, returns
false . |
BTree |
getIndex(String name)
Return the unisolated view of the named index (the mutable view of the
live index object).
|
BTree |
getIndex(String name,
long timestamp)
Return a view of the named index as of the specified timestamp.
|
ICheckpointProtocol |
getIndexLocal(String name,
long commitTime)
Core implementation for access to historical index views.
|
long |
getLastCommitTime()
The database wide timestamp of the most recent commit on the store or 0L
iff there have been no 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 . |
ICheckpointProtocol |
getUnisolatedIndex(String name)
Return the mutable view of the named persistence capable data structure
(aka the "live" or
ITx.UNISOLATED view). |
Iterator<String> |
indexNameScan(String prefix,
long timestampIsIgnored)
Iterator visits the names of all indices spanned by the given prefix.
|
boolean |
isGroupCommit()
The
TemporaryStore does not support group commit. |
ICheckpointProtocol |
register(String name,
IndexMetadata metadata)
Variant method creates and registered a named persistence capable data
structure but does not assume that the data structure will be a
BTree . |
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.
|
assertOpen, delete, deleteResources, destroy, finalize, force, getBufferStrategy, getCounters, getFile, getMaxRecordSize, getResourceMetadata, getTempFile, getTempFile, getUUID, isFullyBuffered, isOpen, isReadOnly, isStable, read, size, toString, write
getAddressManager, getByteCount, getOffset, getOffsetBits, getPhysicalAddress, toAddr, toString
getInputStream, getOutputStream
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
destroy
getCounters
public TemporaryStore()
TemporaryStore
that can scale-up. The backing file will be
created using the Java temporary file mechanism.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).public void registerIndex(IndexMetadata metadata)
IGISTManager
Note: The name property MUST be set on the IndexMetadata
and the index will be registered under that name.
registerIndex
in interface IGISTManager
metadata
- The metadata describing the index.IGISTLocalManager.getIndexLocal(String, long)
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 IGISTManager.registerIndex(IndexMetadata)
instead. The same method signature is also declared by
IDataService.registerIndex(String, IndexMetadata)
in order to
support registration of index partitions.
Note: Due to the method signature, this method CAN NOT be used to create
and register persistence capable data structures other than an
IIndex
(aka B+Tree).
registerIndex
in interface IBTreeManager
name
- The name that can be used to recover the index.metadata
- The metadata describing the index.IBTreeManager.getIndex(String)
.IIndexManager.getIndex(String, long)
,
FIXME GIST Due to the method signature, this method CAN NOT be used
to create and register persistence capable data structures other
than an {@link IIndex} (aka B+Tree). It is difficult to reconcile
this method with other method signatures since this method is
designed for scale-out and relies on {@link IIndex}. However, only
the B+Tree is an {@link IIndex}. Therefore, this method signature
can not be readily reconciled with the {@link HTree}. The only
interface which the {@link BTree} and {@link HTree} share is the
{@link ICheckpointProtocol} interface, but that is a purely local
(not remote) interface and is therefore not suitable to scale-out.
Also, it is only in scale-out where the returned object can be a
different type than the simple {@link BTree} class, e.g., a
{@link FusedView} or even an {@link IClientIndex}.
public ICheckpointProtocol register(String name, IndexMetadata metadata)
BTree
.register
in interface IGISTLocalManager
store
- The backing store.metadata
- The metadata that describes the data structure to be created.Checkpoint.create(IRawStore, IndexMetadata)
public final BTree registerIndex(String name, BTree btree)
IBTreeManager
registerIndex
in interface IBTreeManager
name
- The name that can be used to recover the index.btree
- The btree.IBTreeManager.getIndex(String)
.IGISTManager.registerIndex(IndexMetadata)
,
IIndexManager.getIndex(String, long)
,
IGISTLocalManager.getIndexLocal(String, long)
public void dropIndex(String name)
IGISTManager
Note: 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 IGISTManager
name
- The name of the index to be dropped.public Iterator<String> indexNameScan(String prefix, long timestampIsIgnored)
IGISTManager
indexNameScan
in interface IGISTManager
prefix
- The prefix (optional). When given, this MUST include a
.
if you want to restrict the scan to only those
indices in a given namespace. Otherwise you can find indices
in kb2
if you provide the prefix kb
where both kb and kb2 are namespaces since the indices spanned
by kb
would include both kb.xyz
and
kb2.xyx
.timestampIsIgnored
- A timestamp which represents either a possible commit time on
the store or a read-only transaction identifier.public ICheckpointProtocol getUnisolatedIndex(String name)
IGISTLocalManager
ITx.UNISOLATED
view).
Note: IIndexManager#getIndex(String)
delegates to this method and
then casts the result to an IIndex
. This is the core
implementation to access an existing named index.
getUnisolatedIndex
in interface IGISTLocalManager
IIndexManager#getIndex(String)
,
GIST public BTree getIndex(String name)
IBTreeManager
getIndex
in interface IBTreeManager
name
- The name of the index.null
iff there
is no index registered with that name.public BTree getIndex(String name, long timestamp)
IIndexManager
getIndex
in interface IIndexManager
name
- The index name.timestamp
- A timestamp which represents either a possible commit time on
the store or a read-only transaction identifier.null
iff there is no index registered
with that name for that timestamp.IGISTLocalManager.getIndexLocal(String, long)
public ICheckpointProtocol getIndexLocal(String name, long commitTime)
Note: Transactions should pass in the timestamp against which they are reading rather than the transaction identifier (aka startTime). By providing the timestamp of the commit point, the transaction will hit the index cache on the journal. If the transaction passes the startTime instead, then all startTimes will be different and the cache will be defeated.
Note: Requests for historical reads or read-only tx views will result
return the ITx.UNISOLATED
index view.
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. When there is not a
checkpoint available, the ITx.UNISOLATED
index view will be
returned.
getIndexLocal
in interface IGISTLocalManager
IIndexStore#getIndex(String, long)
,
Add
cache for access to historical index views on the Journal by name
and commitTime. ,
GIST
FIXME GIST : Reconcile with
{@link IResourceManager#getIndex(String, long)}. They are returning
types that do not overlap ({@link ICheckpointProtocol} and
{@link ILocalBTreeView}). This is blocking the support of GIST in
{@link AbstractTask}.public SparseRowStore getGlobalRowStore()
IIndexStore
SparseRowStore
used to
store named property sets.getGlobalRowStore
in interface IIndexStore
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
.
getGlobalRowStore
in interface IIndexStore
timestamp
- The timestamp of the view.null
if no view
exists as of that timestamp.public BigdataFileSystem getGlobalFileSystem()
IIndexStore
getGlobalFileSystem
in interface IIndexStore
BigdataFileSystem
public DefaultResourceLocator<?> getResourceLocator()
IIndexStore
getResourceLocator
in interface IIndexStore
public ExecutorService getExecutorService()
IIndexStore
ExecutorService
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 IIndexStore
public final IResourceLockService getResourceLockService()
IIndexStore
getResourceLockService
in interface IIndexStore
public void close()
TemporaryRawStore
close
in interface IRawStore
close
in class TemporaryRawStore
public long getLastCommitTime()
This method is useful if you plan to issue a series of read-consistent requests against the most current commit point of the database.
This implementation always returns ZERO (0L) since you can not perform a
commit on a TemporaryRawStore
(it supports checkpoints but not
commits).
getLastCommitTime
in interface IIndexStore
IRootBlockView.getLastCommitTime()
public boolean isGroupCommit()
TemporaryStore
does not support group commit.isGroupCommit
in interface IIndexManager
(NSS GROUP COMMIT)
public TemporaryStore getTempStore()
TemporaryStore
.getTempStore
in interface IIndexStore
TemporaryStore
.public ScheduledFuture<?> addScheduledTask(Runnable task, long initialDelay, long delay, TimeUnit unit)
null
.addScheduledTask
in interface 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()
false
.getCollectPlatformStatistics
in interface IIndexStore
public boolean getCollectQueueStatistics()
false
.getCollectQueueStatistics
in interface IIndexStore
public int getHttpdPort()
false
.getHttpdPort
in interface IIndexStore
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.