@Override public TransactionCursor getTransactions( long transactionIdToStartFrom ) throws IOException { return physicalStore.getTransactions( transactionIdToStartFrom ); }
@Override public TransactionCursor getTransactions( LogPosition position ) throws IOException { return physicalStore.getTransactions( position ); }
@Override public TransactionCursor getTransactions( LogPosition position ) throws IOException { return logicalTransactionStore.getTransactions( position ); }
@Override public TransactionCursor getTransactions( LogPosition position ) throws IOException { return txStore.getTransactions( position ); }
private static List<TransactionRepresentation> extractTransactions( GraphDatabaseAPI db ) throws IOException { LogicalTransactionStore txStore = db.getDependencyResolver().resolveDependency( LogicalTransactionStore.class ); List<TransactionRepresentation> transactions = new ArrayList<>(); try ( TransactionCursor cursor = txStore.getTransactions( TransactionIdStore.BASE_TX_ID + 1 ) ) { cursor.forAll( tx -> transactions.add( tx.getTransactionRepresentation() ) ); } return transactions; } }
private static CommittedTransactionRepresentation extractLastTransaction( GraphDatabaseAPI db ) throws IOException { LogicalTransactionStore txStore = db.getDependencyResolver().resolveDependency( LogicalTransactionStore.class ); CommittedTransactionRepresentation transaction = null; try ( TransactionCursor cursor = txStore.getTransactions( TransactionIdStore.BASE_TX_ID + 1 ) ) { while ( cursor.next() ) { transaction = cursor.get(); } } return transaction; }
txStore.getTransactions( 10 ); fail();
private static List<TransactionRepresentation> createConstraintCreatingTransactions() throws Exception { GraphDatabaseAPI db = (GraphDatabaseAPI) new TestGraphDatabaseFactory().newImpermanentDatabase(); try { try ( Transaction tx = db.beginTx() ) { db.schema().constraintFor( LABEL ).assertPropertyIsUnique( KEY ).create(); tx.success(); } LogicalTransactionStore txStore = db.getDependencyResolver().resolveDependency( LogicalTransactionStore.class ); List<TransactionRepresentation> result = new ArrayList<>(); try ( TransactionCursor cursor = txStore.getTransactions( TransactionIdStore.BASE_TX_ID + 1 ) ) { while ( cursor.next() ) { result.add( cursor.get().getTransactionRepresentation() ); } } return result; } finally { db.shutdown(); } } }
private void verifyTransaction( TransactionIdStore transactionIdStore, TransactionMetadataCache positionCache, byte[] additionalHeader, int masterId, int authorId, long timeStarted, long latestCommittedTxWhenStarted, long timeCommitted, LogicalTransactionStore store ) throws IOException { TransactionMetadata expectedMetadata; try ( TransactionCursor cursor = store.getTransactions( TransactionIdStore.BASE_TX_ID + 1 ) ) { boolean hasNext = cursor.next(); assertTrue( hasNext ); CommittedTransactionRepresentation tx = cursor.get(); TransactionRepresentation transaction = tx.getTransactionRepresentation(); assertArrayEquals( additionalHeader, transaction.additionalHeader() ); assertEquals( masterId, transaction.getMasterId() ); assertEquals( authorId, transaction.getAuthorId() ); assertEquals( timeStarted, transaction.getTimeStarted() ); assertEquals( timeCommitted, transaction.getTimeCommitted() ); assertEquals( latestCommittedTxWhenStarted, transaction.getLatestCommittedTxWhenStarted() ); expectedMetadata = new TransactionMetadata( masterId, authorId, tx.getStartEntry().getStartPosition(), tx.getStartEntry().checksum(), timeCommitted ); } positionCache.clear(); TransactionMetadata actualMetadata = store.getMetadataFor( transactionIdStore.getLastCommittedTransactionId() ); assertEquals( expectedMetadata, actualMetadata ); }
@Override public TransactionCursor getTransactions( LogPosition position ) throws IOException { return physicalStore.getTransactions( position ); }
@Override public TransactionCursor getTransactions( long transactionIdToStartFrom ) throws IOException { return physicalStore.getTransactions( transactionIdToStartFrom ); }
@Override public TransactionCursor getTransactions( LogPosition position ) throws IOException { return logicalTransactionStore.getTransactions( position ); }
protected void extractTransactions( long startingAtTransactionId, Visitor<CommittedTransactionRepresentation,Exception> visitor ) throws Exception { try ( IOCursor<CommittedTransactionRepresentation> cursor = transactionStore .getTransactions( startingAtTransactionId ) ) { while ( cursor.next() && !visitor.visit( cursor.get() ) ) { } } } }
logicalTransactionStore.getTransactions( firstTxId ) )
transactionStore.getTransactions( lastTxId ) )
return logicalTransactionStore.getTransactions( firstTxId );
transactionStore.getTransactions( lastTxId ) )