use of org.neo4j.kernel.api.txstate.TransactionCountingStateVisitor in project neo4j by neo4j.
the class RecordStorageEngine method createCommands.
@SuppressWarnings("resource")
@Override
public void createCommands(Collection<StorageCommand> commands, ReadableTransactionState txState, StorageStatement storageStatement, ResourceLocker locks, long lastTransactionIdWhenStarted) throws TransactionFailureException, CreateConstraintFailureException, ConstraintValidationException {
if (txState != null) {
RecordChangeSet recordChangeSet = new RecordChangeSet(loaders);
TransactionRecordState recordState = new TransactionRecordState(neoStores, integrityValidator, recordChangeSet, lastTransactionIdWhenStarted, locks, relationshipCreator, relationshipDeleter, propertyCreator, propertyDeleter);
// Visit transaction state and populate these record state objects
TxStateVisitor txStateVisitor = new TransactionToRecordStateVisitor(recordState, schemaStateChangeCallback, schemaStorage, constraintSemantics, schemaIndexProviderMap);
CountsRecordState countsRecordState = new CountsRecordState();
txStateVisitor = constraintSemantics.decorateTxStateVisitor(storeLayer, txState, txStateVisitor);
txStateVisitor = new TransactionCountingStateVisitor(txStateVisitor, storeLayer, storageStatement, txState, countsRecordState);
try (TxStateVisitor visitor = txStateVisitor) {
txState.accept(txStateVisitor);
}
// Convert record state into commands
recordState.extractCommands(commands);
countsRecordState.extractCommands(commands);
}
}
Aggregations