Exemplo n.º 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private org.neo4j.cursor.IOCursor<org.neo4j.kernel.impl.transaction.CommittedTransactionRepresentation> getCursor(long txIdPromise, io.netty.channel.ChannelHandlerContext ctx, long firstTxId, org.neo4j.causalclustering.identity.StoreId localStoreId, org.neo4j.causalclustering.identity.StoreId expectedStoreId) throws java.io.IOException
        private IOCursor <CommittedTransactionRepresentation> GetCursor(long txIdPromise, ChannelHandlerContext ctx, long firstTxId, StoreId localStoreId, StoreId expectedStoreId)
        {
            if (localStoreId == null || !localStoreId.Equals(expectedStoreId))
            {
                _log.info("Failed to serve TxPullRequest for tx %d and storeId %s because that storeId is different " + "from this machine with %s", firstTxId, expectedStoreId, localStoreId);
                EndInteraction(ctx, E_STORE_ID_MISMATCH, txIdPromise);
                return(null);
            }
            else if (!_databaseAvailable.AsBoolean)
            {
                _log.info("Failed to serve TxPullRequest for tx %d because the local database is unavailable.", firstTxId);
                EndInteraction(ctx, E_STORE_UNAVAILABLE, txIdPromise);
                return(null);
            }
            else if (txIdPromise < firstTxId)
            {
                EndInteraction(ctx, SUCCESS_END_OF_STREAM, txIdPromise);
                return(null);
            }

            try
            {
                return(_logicalTransactionStore.getTransactions(firstTxId));
            }
            catch (NoSuchTransactionException)
            {
                _log.info("Failed to serve TxPullRequest for tx %d because the transaction does not exist.", firstTxId);
                EndInteraction(ctx, E_TRANSACTION_PRUNED, txIdPromise);
                return(null);
            }
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public TransactionCursor getTransactions(LogPosition position) throws java.io.IOException
            public TransactionCursor getTransactions(LogPosition position)
            {
                return(_txStore.getTransactions(position));
            }