public interface StorageEngine
| Modifier and Type | Method and Description |
|---|---|
CommandCreationContext |
allocateCommandCreationContext() |
void |
apply(CommandsToApply batch,
TransactionApplicationMode mode)
Apply a batch of groups of commands to this storage.
|
void |
clearBufferedIds()
Deprecated.
|
CommandReaderFactory |
commandReaderFactory() |
void |
createCommands(Collection<StorageCommand> target,
ReadableTransactionState state,
StorageStatement storageStatement,
ResourceLocker locks,
long lastTransactionIdWhenStarted)
Generates a list of
commands representing the changes in the given transaction state
(state and legacyIndexTransactionState. |
void |
flushAndForce(org.neo4j.io.pagecache.IOLimiter limiter)
Flushes and forces all changes down to underlying storage.
|
void |
forceClose()
Force close all opened resources.
|
Collection<StoreFileMetadata> |
listStorageFiles() |
void |
loadSchemaCache()
Deprecated.
|
void |
prepareForRecoveryRequired()
Startup process have reached the conclusion that recovery is required.
|
void |
registerDiagnostics(org.neo4j.kernel.info.DiagnosticsManager diagnosticsManager)
Registers diagnostics about the storage onto
DiagnosticsManager. |
StoreReadLayer |
storeReadLayer() |
StoreReadLayer storeReadLayer()
applied to this storage.CommandCreationContext allocateCommandCreationContext()
CommandCreationContext meant to be kept for multiple calls to
createCommands(Collection, ReadableTransactionState, StorageStatement, ResourceLocker,
long).
Must be closed after used, before being discarded.void createCommands(Collection<StorageCommand> target, ReadableTransactionState state, StorageStatement storageStatement, ResourceLocker locks, long lastTransactionIdWhenStarted) throws org.neo4j.kernel.api.exceptions.TransactionFailureException, org.neo4j.kernel.api.exceptions.schema.CreateConstraintFailureException, org.neo4j.kernel.api.exceptions.schema.ConstraintValidationException
commands representing the changes in the given transaction state
(state and legacyIndexTransactionState.
The returned commands can be used to form CommandsToApply batches, which can be applied to this
storage using apply(CommandsToApply, TransactionApplicationMode).
The reason this is separated like this is that the generated commands can be used for other things
than applying to storage, f.ex replicating to another storage engine.target - Collection to put commands into.state - ReadableTransactionState representing logical store changes to generate commands for.storageStatement - StorageStatement to use for reading store state during creation of commands.locks - ResourceLocker can grab additional locks.
This locks client still have the potential to acquire more locks at this point.
TODO we should try to get rid of this locking mechanism during creation of commands
The reason it's needed is that some relationship changes in the record storage engine
needs to lock prev/next relationships and these changes happens when creating commands
The EntityLocker interface is a subset of Locks.Client interface, just to fit in while it's here.lastTransactionIdWhenStarted - transaction id which was seen as last committed when this
transaction started, i.e. before any changes were made and before any data was read.
TODO Transitional (Collection), might be Stream or whatever.org.neo4j.kernel.api.exceptions.TransactionFailureException - if command generation fails or some prerequisite of some command
didn't validate, for example if trying to delete a node that still has relationships.org.neo4j.kernel.api.exceptions.schema.CreateConstraintFailureException - if this transaction was set to create a constraint and that failed.org.neo4j.kernel.api.exceptions.schema.ConstraintValidationException - if this transaction was set to create a constraint
and some data violates that constraint.void apply(CommandsToApply batch, TransactionApplicationMode mode) throws Exception
batch - batch of groups of commands to apply to storage.mode - TransactionApplicationMode when applying.Exception - if an error occurs during application.CommandReaderFactory commandReaderFactory()
CommandReaderFactory capable of returning commands readers
for specific log entry versions.void flushAndForce(org.neo4j.io.pagecache.IOLimiter limiter)
limiter - The IOLimiter used to moderate the rate of IO caused by the flush process.void registerDiagnostics(org.neo4j.kernel.info.DiagnosticsManager diagnosticsManager)
DiagnosticsManager.diagnosticsManager - DiagnosticsManager to register diagnostics at.void forceClose()
void prepareForRecoveryRequired()
Collection<StoreFileMetadata> listStorageFiles()
Collection of StoreFileMetadata containing metadata about all store files managed by
this StorageEngine.@Deprecated void loadSchemaCache()
@Deprecated void clearBufferedIds()
Copyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.