/** * Creates a cursor on top of the given journal * * @param partitionTxn The Transaction to use * @param journal the log journal * @param consumerCsn the consumer's CSN taken from cookie * @throws Exception If the cursor creation failed */ public ReplicaJournalCursor( PartitionTxn partitionTxn, JdbmTable<String, ReplicaEventMessage> journal, String consumerCsn ) throws Exception { if ( IS_DEBUG ) { LOG_CURSOR.debug( "Creating ReplicaJournalCursor {}", this ); } this.journal = journal; this.tupleCursor = journal.cursor(); this.consumerCsn = consumerCsn; this.partitionTxn = partitionTxn; }
@SuppressWarnings("unchecked") public Cursor<IndexEntry<K, String>> forwardCursor( PartitionTxn partitionTxn ) throws LdapException { return new IndexCursorAdaptor<>( partitionTxn, ( Cursor ) forward.cursor(), true ); }
public Cursor<IndexEntry<K, String>> forwardCursor( PartitionTxn partitionTxn, K key ) throws LdapException { return new IndexCursorAdaptor<>( partitionTxn, ( Cursor ) forward.cursor( partitionTxn, key ), true ); }
/** * {@inheritDoc} */ @Override public Cursor<IndexEntry<K, String>> reverseCursor( PartitionTxn partitionTxn, String id ) throws LdapException { if ( withReverse ) { return new IndexCursorAdaptor<>( partitionTxn, ( Cursor ) reverse.cursor( partitionTxn, id ), false ); } else { return new EmptyIndexCursor<>( partitionTxn ); } }
/** * {@inheritDoc} */ @Override public Cursor<IndexEntry<K, String>> reverseCursor( PartitionTxn partitionTxn ) { if ( withReverse ) { return new IndexCursorAdaptor<>( partitionTxn, ( Cursor ) reverse.cursor(), false ); } else { return new EmptyIndexCursor<>( partitionTxn ); } }
Cursor<Tuple<String, K>> values = reverse.cursor( partitionTxn, entryId );