Package org.restheart.mongodb.db
Class CursorPool
java.lang.Object
org.restheart.mongodb.db.CursorPool
- Author:
- Andrea Di Cesare <andrea@softinstigate.com>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic doubleCursor in the pool won't be used if
REQUESTED_SKIPS - POOL_SKIPS > MIN_SKIP_DISTANCE_PERCENTAGE * REQUESTED_SKIPS.
The cursor from the pool need to be iterated via the next() method (REQUESTED_SKIPS - POOL_SKIPS) times to reach the requested page; since skip() is more efficient than next(), using the cursor in the pool is worthwhile only if next() has to be used less than MIN_SKIP_DISTANCE_PERCENTAGE * REQUESTED_SKIPS times. -
Method Summary
Modifier and TypeMethodDescriptionget(CursorPoolEntryKey key, ExchangeKeys.EAGER_CURSOR_ALLOCATION_POLICY allocationPolicy)static CursorPool
-
Field Details
-
MIN_SKIP_DISTANCE_PERCENTAGE
public static final double MIN_SKIP_DISTANCE_PERCENTAGECursor in the pool won't be used if
REQUESTED_SKIPS - POOL_SKIPS > MIN_SKIP_DISTANCE_PERCENTAGE * REQUESTED_SKIPS.
The cursor from the pool need to be iterated via the next() method (REQUESTED_SKIPS - POOL_SKIPS) times to reach the requested page; since skip() is more efficient than next(), using the cursor in the pool is worthwhile only if next() has to be used less than MIN_SKIP_DISTANCE_PERCENTAGE * REQUESTED_SKIPS times.- See Also:
- Constant Field Values
-
-
Method Details
-
getInstance
- Returns:
-
get
public SkippedFindIterable get(CursorPoolEntryKey key, ExchangeKeys.EAGER_CURSOR_ALLOCATION_POLICY allocationPolicy)- Parameters:
key-allocationPolicy-- Returns:
-