public interface PersistentEntityStore extends EntityStore, Backupable
PersistentEntityStore is an EntityStore operating above Environment instance.
PersistentEntityStore uses BlobVault to store blobs that have size greater than
PersistentEntityStoreConfig.getMaxInPlaceBlobSize() value which is by default equal to 10000.
Default BlobVault stores blobs as separate files in the blobs subdirectory of
PersistentEntityStore's location (EntityStore.getLocation()). PersistentEntityStore's
location is equal to underlying Environment's location. So on storage device, the database for
PersistentEntityStore consists of underlying Environment's database files plus
the blobs subdirectory.EntityStore,
Environment,
BlobVault| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears all the data in the
PersistentEntityStore. |
<T> T |
computeInExclusiveTransaction(@NotNull StoreTransactionalComputable<T> computable)
Computes and returns a value by calling specified computable in a new exclusive
transaction.
|
<T> T |
computeInReadonlyTransaction(@NotNull StoreTransactionalComputable<T> computable)
Computes and returns a value by calling specified computable in a new read-only transaction.
|
<T> T |
computeInTransaction(@NotNull StoreTransactionalComputable<T> computable)
Computes and returns a value by calling specified computable in a new transaction.
|
void |
executeInExclusiveTransaction(@NotNull StoreTransactionalExecutable executable)
Executes specified executable in a new exclusive transaction.
|
void |
executeInReadonlyTransaction(@NotNull StoreTransactionalExecutable executable)
Executes specified executable in a new read-only transaction.
|
void |
executeInTransaction(@NotNull StoreTransactionalExecutable executable)
Executes specified executable in a new transaction.
|
@NotNull jetbrains.exodus.core.execution.MultiThreadDelegatingJobProcessor |
getAsyncProcessor()
Job processor used by the
PersistentEntityStore for
background caching activities. |
@NotNull BlobVault |
getBlobVault() |
@NotNull PersistentEntityStoreConfig |
getConfig()
Returns PersistentEntityStoreConfig instance used during creation of the
PersistentEntityStore. |
Entity |
getEntity(@NotNull EntityId id)
|
@NotNull java.lang.String |
getEntityType(int entityTypeId)
Returns entity type of specified entity type id.
|
int |
getEntityTypeId(@NotNull java.lang.String entityType)
Returns integer id of specified entity type.
|
@NotNull Environment |
getEnvironment() |
@NotNull Statistics |
getStatistics() |
long |
getUsableSpace() |
void |
registerCustomPropertyType(@NotNull StoreTransaction txn,
@NotNull java.lang.Class<? extends java.lang.Comparable> clazz,
@NotNull ComparableBinding binding)
Registers custom property type extending Comparable.
|
void |
renameEntityType(@NotNull java.lang.String oldEntityTypeName,
@NotNull java.lang.String newEntityTypeName)
Renames entity type.
|
beginExclusiveTransaction, beginReadonlyTransaction, beginTransaction, close, getCurrentTransaction, getLocation, getNamegetBackupStrategy@NotNull @NotNull Environment getEnvironment()
void clear()
PersistentEntityStore. It is safe to clear PersistentEntityStore
with lots of parallel transactions. Make sure all InputStream instances got from
the blob vault are closed.void executeInTransaction(@NotNull
@NotNull StoreTransactionalExecutable executable)
executable - transactional executableStoreTransactionalExecutablevoid executeInExclusiveTransaction(@NotNull
@NotNull StoreTransactionalExecutable executable)
executable - transactional executableStoreTransactionalExecutablevoid executeInReadonlyTransaction(@NotNull
@NotNull StoreTransactionalExecutable executable)
executable - transactional executableStoreTransactionalExecutable,
StoreTransaction.isReadonly()<T> T computeInTransaction(@NotNull
@NotNull StoreTransactionalComputable<T> computable)
computable - transactional computableStoreTransactionalComputable<T> T computeInExclusiveTransaction(@NotNull
@NotNull StoreTransactionalComputable<T> computable)
computable - transactional computableStoreTransactionalComputable<T> T computeInReadonlyTransaction(@NotNull
@NotNull StoreTransactionalComputable<T> computable)
computable - transactional computableStoreTransactionalComputable,
StoreTransaction.isReadonly()@NotNull @NotNull BlobVault getBlobVault()
void registerCustomPropertyType(@NotNull
@NotNull StoreTransaction txn,
@NotNull
@NotNull java.lang.Class<? extends java.lang.Comparable> clazz,
@NotNull
@NotNull ComparableBinding binding)
clazz can be
passed then to Entity.setProperty(String, Comparable). ComparableBinding describes the
way property values are serialized/deserialized to/from raw presentation as
ByteIterable instances.txn - StoreTransaction instanceclazz - class of property values extending Comparablebinding - ComparableBindingEntity.setProperty(String, Comparable),
ComparableBinding,
ByteIterableEntity getEntity(@NotNull @NotNull EntityId id)
id - entity idEntityRemovedInDatabaseException - entity by specified if doesn't exist in the databaseEntity.getId()int getEntityTypeId(@NotNull
@NotNull java.lang.String entityType)
entityType - entity typeEntityId.getTypeId()@NotNull @NotNull java.lang.String getEntityType(int entityTypeId)
entityTypeId - entity type idEntityId.getTypeId()void renameEntityType(@NotNull
@NotNull java.lang.String oldEntityTypeName,
@NotNull
@NotNull java.lang.String newEntityTypeName)
oldEntityTypeName - old entity type namenewEntityTypeName - new entity type namelong getUsableSpace()
@NotNull @NotNull PersistentEntityStoreConfig getConfig()
PersistentEntityStore. If no config was specified and no setting was mutated, then returned config has
the same settings as PersistentEntityStoreConfig.DEFAULT.@NotNull @NotNull jetbrains.exodus.core.execution.MultiThreadDelegatingJobProcessor getAsyncProcessor()
PersistentEntityStore for
background caching activities. Allows to indirectly estimate load of the PersistentEntityStore. E.g.,
if it has numerous pending caching jobs (say, thousands) then most
likely caching doesn't work well and the PersistentEntityStore looks overloaded.@NotNull @NotNull Statistics getStatistics()
PersistentEntityStore instancePersistentEntityStoreConfig.GATHER_STATISTICS