Package com.couchbase.client.java.kv
Enum ScanSort
- java.lang.Object
-
- java.lang.Enum<ScanSort>
-
- com.couchbase.client.java.kv.ScanSort
-
- All Implemented Interfaces:
Serializable
,Comparable<ScanSort>
@Volatile public enum ScanSort extends Enum<ScanSort>
The sorting used for the scan operation.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.couchbase.client.core.kv.CoreRangeScanSort
intoCore()
static ScanSort
valueOf(String name)
Returns the enum constant of this type with the specified name.static ScanSort[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final ScanSort NONE
Do not sort the results.Fast and efficient. Results are emitted in the order they arrive from each partition.
-
ASCENDING
public static final ScanSort ASCENDING
Sort the results by document ID in lexicographic order.Reasonably efficient. Suitable for large range scans, since it *does not* require buffering the entire result set in memory.
CAVEAT: When used with a
ScanType.samplingScan(long)
scan, the behavior is unspecified and may change in a future version. Likely outcomes include:- Skewing the results towards "low" document IDs.
- Not actually sorting.
NONE
, then collect the results into a list and sort the list.
-
-
Method Detail
-
values
public static ScanSort[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ScanSort c : ScanSort.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ScanSort valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
intoCore
@Internal public com.couchbase.client.core.kv.CoreRangeScanSort intoCore()
-
-