Package io.oxia.client.api.options
Interface GetOption
public interface GetOption
Options for getting a record.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final GetOptionComparisonCeiling option will make the get operation to search for the record whose key is the lowest key ≥ to the supplied key.static final GetOptionComparisonEqual sets the Get() operation to compare the stored key for equality.static final GetOptionComparisonFloor option will make the get operation to search for the record whose key is the highest key ≤ to the supplied key.static final GetOptionComparisonHigher option will make the get operation to search for the record whose key is strictly > to the supplied key.static final GetOptionComparisonLower option will make the get operation to search for the record whose key is strictly < to the supplied key.static final GetOptionThe specified value will be excluded from the result.static final GetOptionThe specified value will be included in the result. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic GetOptionIncludeValue(boolean includeValue) Creates and returns a GetOption that specifies whether to include a value.static GetOptionPartitionKey(String partitionKey) PartitionKey overrides the partition routing with the specified `partitionKey` instead of the regular record key.static GetOptionUseIndex lets the users look up the record by a secondary index: the key of the get is a secondary key.
-
Field Details
-
ComparisonEqual
ComparisonEqual sets the Get() operation to compare the stored key for equality. -
ComparisonFloor
ComparisonFloor option will make the get operation to search for the record whose key is the highest key ≤ to the supplied key. -
ComparisonCeiling
ComparisonCeiling option will make the get operation to search for the record whose key is the lowest key ≥ to the supplied key. -
ComparisonLower
ComparisonLower option will make the get operation to search for the record whose key is strictly < to the supplied key. -
ComparisonHigher
ComparisonHigher option will make the get operation to search for the record whose key is strictly > to the supplied key. -
IncludeValue
The specified value will be included in the result. -
ExcludeValue
The specified value will be excluded from the result.
-
-
Method Details
-
PartitionKey
PartitionKey overrides the partition routing with the specified `partitionKey` instead of the regular record key.Records with the same partitionKey will always be guaranteed to be co-located in the same Oxia shard.
- Parameters:
partitionKey- the partition key to use- Returns:
- the GetOption.
-
IncludeValue
Creates and returns a GetOption that specifies whether to include a value. This method is used to configure whether a value should be included in the operation.- Parameters:
includeValue- A boolean flag indicating whether the value should be included. - true: The value will be included. - false: The value will not be included.- Returns:
- A GetOption instance representing the include value setting.
-
UseIndex
UseIndex lets the users look up the record by a secondary index: the key of the get is a secondary key. The result still has the record's primary key as its key, and the secondary key it was found by as itsGetResult.secondaryIndexKey().Note: if the secondary index is not unique, which primary record is returned is undefined.
- Parameters:
secondaryIndexName- the name of the secondary index to use for the get operation- Returns:
- the GetOption.
-