diff options
Diffstat (limited to 'src/main/java/com/amazon/carbonado/repo/indexed')
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/indexed/IndexedCursor.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/com/amazon/carbonado/repo/indexed/IndexedCursor.java b/src/main/java/com/amazon/carbonado/repo/indexed/IndexedCursor.java index bce6975..04eb478 100644 --- a/src/main/java/com/amazon/carbonado/repo/indexed/IndexedCursor.java +++ b/src/main/java/com/amazon/carbonado/repo/indexed/IndexedCursor.java @@ -32,6 +32,7 @@ import com.amazon.carbonado.Storage; import com.amazon.carbonado.Transaction;
import com.amazon.carbonado.cursor.AbstractCursor;
+import com.amazon.carbonado.cursor.FetchAheadCursor;
import com.amazon.carbonado.spi.RepairExecutor;
@@ -44,6 +45,13 @@ import com.amazon.carbonado.synthetic.SyntheticStorableReferenceAccess; * @author Brian S O'Neill
*/
class IndexedCursor<S extends Storable> extends AbstractCursor<S> {
+ private static final int FETCH_AHEAD;
+
+ static {
+ String prefix = IndexedCursor.class.getName() + '.';
+ FETCH_AHEAD = Integer.getInteger(prefix + "fetchAhead", 0);
+ }
+
private final Cursor<? extends Storable> mCursor;
private final IndexedStorage<S> mStorage;
private final SyntheticStorableReferenceAccess<S> mAccessor;
@@ -52,7 +60,11 @@ class IndexedCursor<S extends Storable> extends AbstractCursor<S> { IndexedCursor(Cursor<? extends Storable> indexEntryCursor,
IndexedStorage<S> storage,
- SyntheticStorableReferenceAccess<S> indexAccessor) {
+ SyntheticStorableReferenceAccess<S> indexAccessor)
+ {
+ if (FETCH_AHEAD > 0) {
+ indexEntryCursor = new FetchAheadCursor(indexEntryCursor, FETCH_AHEAD);
+ }
mCursor = indexEntryCursor;
mStorage = storage;
mAccessor = indexAccessor;
|