public Cursor<StoreTxLogCursorEntry<K, V>> cursor(StoreTxLogPosition position) { long recordId = position.getRecordId(); if (storeTxLogs.size() == 0) { return new EmptyCursor<StoreTxLogCursorEntry<K, V>>(); } StoreTxLog targetTxLog = null; for (StoreTxLog txLog : storeTxLogs) { if (recordId >= txLog.getFirstRecordId() && recordId < txLog.getNextRecordId()) { targetTxLog = txLog; break; } } if (targetTxLog == null) { return new EmptyCursor<StoreTxLogCursorEntry<K, V>>(); } return new StoreTxLogCursor(targetTxLog, recordId - targetTxLog.getFirstRecordId()); }
public Cursor<StoreTxLogCursorEntry<K, V>> cursor(StoreTxLogPosition position) { long recordId = position.getRecordId(); if (storeTxLogs.size() == 0) { return new EmptyCursor<StoreTxLogCursorEntry<K, V>>(); } StoreTxLog targetTxLog = null; for (StoreTxLog txLog : storeTxLogs) { if (recordId >= txLog.getFirstRecordId() && recordId < txLog.getNextRecordId()) { targetTxLog = txLog; break; } } if (targetTxLog == null) { return new EmptyCursor<StoreTxLogCursorEntry<K, V>>(); } return new StoreTxLogCursor(targetTxLog, recordId - targetTxLog.getFirstRecordId()); }
public Cursor<StoreTxLogCursorEntry<K, V>> cursor(StoreTxLogPosition position) { long recordId = position.getRecordId(); if (storeTxLogs.size() == 0) { return new EmptyCursor<StoreTxLogCursorEntry<K, V>>(); } StoreTxLog targetTxLog = null; for (StoreTxLog txLog : storeTxLogs) { if (recordId >= txLog.getFirstRecordId() && recordId < txLog.getNextRecordId()) { targetTxLog = txLog; break; } } if (targetTxLog == null) { return new EmptyCursor<StoreTxLogCursorEntry<K, V>>(); } return new StoreTxLogCursor(targetTxLog, recordId - targetTxLog.getFirstRecordId()); }