Package io.streamnative.oxia.client.api
Interface PutOption
- All Known Subinterfaces:
OptionVersionId
- All Known Implementing Classes:
OptionEphemeral,OptionPartitionKey,OptionSecondaryIndex,OptionSequenceKeysDeltas,OptionVersionId.OptionRecordDoesNotExist,OptionVersionId.OptionVersionIdEqual
public sealed interface PutOption
permits OptionEphemeral, OptionPartitionKey, OptionSecondaryIndex, OptionSequenceKeysDeltas, OptionVersionId
-
Field Summary
Fields -
Method Summary
Static MethodsModifier and TypeMethodDescriptionIfVersionIdEquals(long versionId) static PutOptionPartitionKey(@NonNull String partitionKey) PartitionKey overrides the partition routing with the specified `partitionKey` instead of the regular record key.static PutOptionSecondaryIndex(@NonNull String indexName, String secondaryKey) SecondaryIndex let the users specify additional keys to index the record Index names are arbitrary strings and can be used inSyncOxiaClient.list(String, String, Set)andSyncOxiaClient.rangeScan(String, String, Set)requests.static PutOptionSequenceKeysDeltas(@NonNull List<Long> sequenceKeysDeltas) SequenceKeysDeltas will request that the final record key to be assigned by the server, based on the prefix record key and appending one or more sequences.
-
Field Details
-
IfRecordDoesNotExist
-
AsEphemeralRecord
-
-
Method Details
-
IfVersionIdEquals
-
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
-
SequenceKeysDeltas
SequenceKeysDeltas will request that the final record key to be assigned by the server, based on the prefix record key and appending one or more sequences.The sequence numbers will be atomically added based on the deltas. Deltas must be >= 0 and the first one strictly > 0. SequenceKeysDeltas also requires that a [PartitionKey] option is provided.
- Parameters:
sequenceKeysDeltas-- Returns:
-
SecondaryIndex
SecondaryIndex let the users specify additional keys to index the record Index names are arbitrary strings and can be used inSyncOxiaClient.list(String, String, Set)andSyncOxiaClient.rangeScan(String, String, Set)requests.Secondary keys are not required to be unique.
Multiple secondary indexes can be passed on the same record, even reusing multiple times the same indexName.
- Parameters:
indexName- the name of the secondary indexsecondaryKey- the secondary key for this record- Returns:
-