Package org.restheart.mongodb.db
Class CursorPool
- java.lang.Object
-
- org.restheart.mongodb.db.CursorPool
-
public class CursorPool extends Object
- Author:
- Andrea Di Cesare <andrea@softinstigate.com>
-
-
Field Summary
Fields Modifier and Type Field Description static doubleMIN_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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SkippedFindIterableget(CursorPoolEntryKey key, ExchangeKeys.EAGER_CURSOR_ALLOCATION_POLICY allocationPolicy)static CursorPoolgetInstance()
-
-
-
Field Detail
-
MIN_SKIP_DISTANCE_PERCENTAGE
public static final double MIN_SKIP_DISTANCE_PERCENTAGE
Cursor 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 Detail
-
getInstance
public static CursorPool getInstance()
- Returns:
-
get
public SkippedFindIterable get(CursorPoolEntryKey key, ExchangeKeys.EAGER_CURSOR_ALLOCATION_POLICY allocationPolicy)
- Parameters:
key-allocationPolicy-- Returns:
-
-