public interface DataStore extends Component
A DataStore
component abstracts the access to a storage system for resources, mentions,
entities and contexts (the types listed in SUPPORTED_TYPES
). Access to such a storage
system can occur only in the scope of a transaction, which can either be read-only or
read/write, identifies a unit of work and provides atomicity, isolation and durability
guarantees. Note that a DataStore
obeys the general contract and lifecycle of
Component
. In particular, note that a DataStore
must be thread safe, even if
the produced DataTransaction
are not required to be so.
Modifier and Type | Field and Description |
---|---|
static Set<org.openrdf.model.URI> |
SUPPORTED_TYPES
The types of records that can be stored in a
DataStore . |
Modifier and Type | Method and Description |
---|---|
DataTransaction |
begin(boolean readOnly)
Begins a new read-only / read-write
DataStore transaction. |
static final Set<org.openrdf.model.URI> SUPPORTED_TYPES
DataStore
.DataTransaction begin(boolean readOnly) throws DataCorruptedException, IOException, IllegalStateException
DataStore
transaction. All the accesses to a
DataStore
must occur in the scope of a transaction, that must be ended (possibly
committing the modifications done) as soon as possible to allow improving throughput.readOnly
- true if the transaction is not allowed to modify the contents of the
DataStore
(this allows for optimizing accesses).DataCorruptedException
- in case a transaction cannot be started due to the DataStore
persistent
data being damaged or non-existing (this may trigger some external recovery
procedure)IOException
- if another IO error occurs while starting the transactionIllegalStateException
- if the DataStore
object has been already closedCopyright © 2015–2016 FBK-irst. All rights reserved.