internal TransactionToRecordStateVisitor(TransactionRecordState recordState, SchemaState schemaState, SchemaStorage schemaStorage, ConstraintSemantics constraintSemantics)
 {
     this._recordState         = recordState;
     this._schemaState         = schemaState;
     this._schemaStorage       = schemaStorage;
     this._constraintSemantics = constraintSemantics;
 }
Example #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private org.neo4j.kernel.impl.transaction.log.PhysicalTransactionRepresentation transactionRepresentationOf(TransactionRecordState tx) throws org.neo4j.internal.kernel.api.exceptions.TransactionFailureException
        private PhysicalTransactionRepresentation TransactionRepresentationOf(TransactionRecordState tx)
        {
            IList <StorageCommand> commands = new List <StorageCommand>();

            tx.ExtractCommands(commands);
            return(new PhysicalTransactionRepresentation(commands));
        }
Example #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("resource") @Override public void createCommands(java.util.Collection<org.neo4j.storageengine.api.StorageCommand> commands, org.neo4j.storageengine.api.txstate.ReadableTransactionState txState, org.neo4j.storageengine.api.StorageReader storageReader, org.neo4j.storageengine.api.lock.ResourceLocker locks, long lastTransactionIdWhenStarted, org.neo4j.storageengine.api.txstate.TxStateVisitor_Decorator additionalTxStateVisitor) throws org.neo4j.internal.kernel.api.exceptions.TransactionFailureException, org.neo4j.internal.kernel.api.exceptions.schema.CreateConstraintFailureException, org.neo4j.internal.kernel.api.exceptions.schema.ConstraintValidationException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public override void CreateCommands(ICollection <StorageCommand> commands, ReadableTransactionState txState, StorageReader storageReader, ResourceLocker locks, long lastTransactionIdWhenStarted, Org.Neo4j.Storageengine.Api.txstate.TxStateVisitor_Decorator additionalTxStateVisitor)
        {
            if (txState != null)
            {
                // We can make this cast here because we expected that the storageReader passed in here comes from
                // this storage engine itself, anything else is considered a bug. And we do know the inner workings
                // of the storage statements that we create.
                RecordStorageCommandCreationContext creationContext = (( RecordStorageReader )storageReader).CommandCreationContext;
                TransactionRecordState recordState = creationContext.CreateTransactionRecordState(_integrityValidator, lastTransactionIdWhenStarted, locks);

                // Visit transaction state and populate these record state objects
                TxStateVisitor    txStateVisitor    = new TransactionToRecordStateVisitor(recordState, _schemaState, _schemaStorage, _constraintSemantics);
                CountsRecordState countsRecordState = new CountsRecordState();
                txStateVisitor = additionalTxStateVisitor.apply(txStateVisitor);
                txStateVisitor = new TransactionCountingStateVisitor(txStateVisitor, storageReader, txState, countsRecordState);
                using (TxStateVisitor visitor = txStateVisitor)
                {
                    txState.Accept(visitor);
                }

                // Convert record state into commands
                recordState.ExtractCommands(commands);
                countsRecordState.ExtractCommands(commands);
            }
        }
Example #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldExecuteCommandsInTheSameOrderRegardlessOfItBeingRecoveredOrNot() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldExecuteCommandsInTheSameOrderRegardlessOfItBeingRecoveredOrNot()
        {
            // Given
            TransactionRecordState tx = InjectAllPossibleCommands();

            // When
            PhysicalTransactionRepresentation commands = TransactionRepresentationOf(tx);

            // Then
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final OrderVerifyingCommandHandler orderVerifyingCommandHandler = new OrderVerifyingCommandHandler();
            OrderVerifyingCommandHandler orderVerifyingCommandHandler = new OrderVerifyingCommandHandler();

            commands.Accept(element => (( Command )element).handle(orderVerifyingCommandHandler));
        }
 public LoaderAnonymousInnerClass(TransactionRecordState outerInstance)
 {
     this.outerInstance = outerInstance;
 }