Class KVExtensions
Inheritance
Inherited Members
Namespace: ETCD.V3
Assembly: cs.temp.dll.dll
Syntax
public static class KVExtensions
Methods
Compact(Client, Int64, Boolean, Boolean)
Compact compacts the event history in the etcd key-value store. The key-value store should be periodically compacted or the event history will continue to grow indefinitely.
Declaration
public static CompactionResponse Compact(this Client client, long revision, bool physical = false, bool prevKv = false)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
System.Int64 | revision | The request to send to the server. |
System.Boolean | physical | The initial metadata to send with the call. This parameter is optional. |
System.Boolean | prevKv |
Returns
Type | Description |
---|---|
CompactionResponse | The response received from the server. |
CompactAsync(Client, Int64, Boolean, Boolean)
Compact compacts the event history in the etcd key-value store. The key-value store should be periodically compacted or the event history will continue to grow indefinitely.
Declaration
public static AsyncUnaryCall<CompactionResponse> CompactAsync(this Client client, long revision, bool physical = false, bool prevKv = false)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
System.Int64 | revision | The request to send to the server. |
System.Boolean | physical | The initial metadata to send with the call. This parameter is optional. |
System.Boolean | prevKv |
Returns
Type | Description |
---|---|
AsyncUnaryCall<CompactionResponse> | The call object. |
CreateCompactionRequest(Client, Int64, Boolean)
Create CompactionRequest
Declaration
public static CompactionRequest CreateCompactionRequest(this Client client, long revision, bool physical = false)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
System.Int64 | revision | The request to send to the server. |
System.Boolean | physical | The initial metadata to send with the call. This parameter is optional. |
Returns
Type | Description |
---|---|
CompactionRequest | The response received from the server. |
CreateDeleteRangeRequest(Client, ByteString, ByteString, Boolean)
Declaration
public static DeleteRangeRequest CreateDeleteRangeRequest(this Client client, ByteString key, ByteString rangeEnd = null, bool prevKv = false)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
ByteString | key | |
ByteString | rangeEnd | |
System.Boolean | prevKv |
Returns
Type | Description |
---|---|
DeleteRangeRequest |
CreatePutRequest(Client, ByteString, ByteString, Int64, Boolean, Boolean, Boolean)
Create Put Request.
Declaration
public static PutRequest CreatePutRequest(this Client client, ByteString key, ByteString value, long lease = 0L, bool prevKv = false, bool ignoreLease = false, bool ignoreValue = false)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
ByteString | key | key is the key, in bytes, to put into the key-value store. |
ByteString | value | value is the value, in bytes, to associate with the key in the key-value store. |
System.Int64 | lease | Defualt value is 0. lease is the lease ID to associate with the key in the key-value store. A lease value of 0 indicates no lease. |
System.Boolean | prevKv | Defualt value is false. If prev_kv is set, etcd gets the previous key-value pair before changing it. The previous key-value pair will be returned in the put response. |
System.Boolean | ignoreLease | Defualt value is false. If ignore_lease is set, etcd updates the key using its current lease. Returns an error if the key does not exist. |
System.Boolean | ignoreValue | Defualt value is false. If ignore_value is set, etcd updates the key using its current value. Returns an error if the key does not exist. |
Returns
Type | Description |
---|---|
PutRequest | PutRequest |
CreateRangeRequest(Client, ByteString, ByteString, Int64, Int64, SortOrder, SortTarget, Boolean, Boolean, Boolean, Int64, Int64, Int64, Int64)
Create Range Request.
Declaration
public static RangeRequest CreateRangeRequest(this Client client, ByteString key, ByteString rangeEnd = null, long limit = 0L, long revision = 0L, SortOrder sortOrder = null, SortTarget sortTarget = null, bool serializable = false, bool keysOnly = false, bool countOnly = false, long minModRevision = 0L, long maxModRevision = 0L, long minCreateRevision = 0L, long maxCreateRevision = 0L)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
ByteString | key | key is the first key for the range. If range_end is not given, the request only looks up key. |
ByteString | rangeEnd | range_end is the upper bound on the requested range [key, range_end). If range_end is '\0', the range is all keys >= key. If range_end is key plus one (e.g., "aa"+1 == "ab", "a\xff"+1 == "b"), then the range request gets all keys prefixed with key. If both key and range_end are '\0', then the range request returns all keys. |
System.Int64 | limit | Defualt value is 0. limit is a limit on the number of keys returned for the request. When limit is set to 0, it is treated as no limit. |
System.Int64 | revision | Defualt value is 0. revision is the point-in-time of the key-value store to use for the range. If revision is less or equal to zero, the range is over the newest key-value store. If the revision has been compacted, ErrCompacted is returned as a response. |
SortOrder | sortOrder | Defualt value is SortOrder.None. sort_order is the order for returned sorted results. |
SortTarget | sortTarget | Defualt value is SortTarget.Key. sort_target is the key-value field to use for sorting. |
System.Boolean | serializable | Defualt value is false. serializable sets the range request to use serializable member-local reads. Range requests are linearizable by default; linearizable requests have higher latency and lower throughput than serializable requests but reflect the current consensus of the cluster. For better performance, in exchange for possible stale reads, a serializable range request is served locally without needing to reach consensus with other nodes in the cluster. |
System.Boolean | keysOnly | Defualt value is false. keys_only when set returns only the keys and not the values. |
System.Boolean | countOnly | Defualt value is false. count_only when set returns only the count of the keys in the range. |
System.Int64 | minModRevision | Defualt value is 0. min_mod_revision is the lower bound for returned key mod revisions; all keys with lesser mod revisions will be filtered away. |
System.Int64 | maxModRevision | Defualt value is 0. max_mod_revision is the upper bound for returned key mod revisions; all keys with greater mod revisions will be filtered away. |
System.Int64 | minCreateRevision | Defualt value is 0. min_create_revision is the lower bound for returned key create revisions; all keys with lesser create trevisions will be filtered away. |
System.Int64 | maxCreateRevision | Defualt value is 0. max_create_revision is the upper bound for returned key create revisions; all keys with greater create revisions will be filtered away. |
Returns
Type | Description |
---|---|
RangeRequest | RangeRequest |
DeleteAll(Client, ByteString, Boolean)
Declaration
public static DeleteRangeResponse DeleteAll(this Client client, ByteString key, bool prevKv = false)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
ByteString | key | |
System.Boolean | prevKv |
Returns
Type | Description |
---|---|
DeleteRangeResponse |
DeleteAll(Client, String, Boolean)
Declaration
public static DeleteRangeResponse DeleteAll(this Client client, string key, bool prevKv = false)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
System.String | key | |
System.Boolean | prevKv |
Returns
Type | Description |
---|---|
DeleteRangeResponse |
DeleteAllAsync(Client, ByteString, Boolean)
Declaration
public static AsyncUnaryCall<DeleteRangeResponse> DeleteAllAsync(this Client client, ByteString key, bool prevKv = false)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
ByteString | key | |
System.Boolean | prevKv |
Returns
Type | Description |
---|---|
AsyncUnaryCall<DeleteRangeResponse> |
DeleteAllAsync(Client, String, Boolean)
Declaration
public static AsyncUnaryCall<DeleteRangeResponse> DeleteAllAsync(this Client client, string key, bool prevKv = false)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
System.String | key | |
System.Boolean | prevKv |
Returns
Type | Description |
---|---|
AsyncUnaryCall<DeleteRangeResponse> |
DeleteRange(Client, ByteString, ByteString, Boolean)
Declaration
public static DeleteRangeResponse DeleteRange(this Client client, ByteString key, ByteString rangeEnd = null, bool prevKv = false)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
ByteString | key | |
ByteString | rangeEnd | |
System.Boolean | prevKv |
Returns
Type | Description |
---|---|
DeleteRangeResponse |
DeleteRange(Client, String, String, Boolean)
Declaration
public static DeleteRangeResponse DeleteRange(this Client client, string key, string rangeEnd = null, bool prevKv = false)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
System.String | key | |
System.String | rangeEnd | |
System.Boolean | prevKv |
Returns
Type | Description |
---|---|
DeleteRangeResponse |
DeleteRangeAsync(Client, ByteString, ByteString, Boolean)
Declaration
public static AsyncUnaryCall<DeleteRangeResponse> DeleteRangeAsync(this Client client, ByteString key, ByteString rangeEnd = null, bool prevKv = false)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
ByteString | key | |
ByteString | rangeEnd | |
System.Boolean | prevKv |
Returns
Type | Description |
---|---|
AsyncUnaryCall<DeleteRangeResponse> |
DeleteRangeAsync(Client, String, String, Boolean)
Declaration
public static AsyncUnaryCall<DeleteRangeResponse> DeleteRangeAsync(this Client client, string key, string rangeEnd = null, bool prevKv = false)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
System.String | key | |
System.String | rangeEnd | |
System.Boolean | prevKv |
Returns
Type | Description |
---|---|
AsyncUnaryCall<DeleteRangeResponse> |
GetAll(Client, ByteString, Int64, Int64, SortOrder, SortTarget, Boolean, Boolean, Boolean, Int64, Int64, Int64, Int64)
Range gets the keys in the range from the key-value store.
Declaration
public static RangeResponse GetAll(this Client client, ByteString key, long limit = 0L, long revision = 0L, SortOrder sortOrder = null, SortTarget sortTarget = null, bool serializable = false, bool keysOnly = false, bool countOnly = false, long minModRevision = 0L, long maxModRevision = 0L, long minCreateRevision = 0L, long maxCreateRevision = 0L)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
ByteString | key | key is the first key for the range. If range_end is not given, the request only looks up key. |
System.Int64 | limit | Defualt value is 0. limit is a limit on the number of keys returned for the request. When limit is set to 0, it is treated as no limit. |
System.Int64 | revision | Defualt value is 0. revision is the point-in-time of the key-value store to use for the range. If revision is less or equal to zero, the range is over the newest key-value store. If the revision has been compacted, ErrCompacted is returned as a response. |
SortOrder | sortOrder | Defualt value is SortOrder.None. sort_order is the order for returned sorted results. |
SortTarget | sortTarget | Defualt value is SortTarget.Key. sort_target is the key-value field to use for sorting. |
System.Boolean | serializable | Defualt value is false. serializable sets the range request to use serializable member-local reads. Range requests are linearizable by default; linearizable requests have higher latency and lower throughput than serializable requests but reflect the current consensus of the cluster. For better performance, in exchange for possible stale reads, a serializable range request is served locally without needing to reach consensus with other nodes in the cluster. |
System.Boolean | keysOnly | Defualt value is false. keys_only when set returns only the keys and not the values. |
System.Boolean | countOnly | Defualt value is false. count_only when set returns only the count of the keys in the range. |
System.Int64 | minModRevision | Defualt value is 0. min_mod_revision is the lower bound for returned key mod revisions; all keys with lesser mod revisions will be filtered away. |
System.Int64 | maxModRevision | Defualt value is 0. max_mod_revision is the upper bound for returned key mod revisions; all keys with greater mod revisions will be filtered away. |
System.Int64 | minCreateRevision | Defualt value is 0. min_create_revision is the lower bound for returned key create revisions; all keys with lesser create trevisions will be filtered away. |
System.Int64 | maxCreateRevision | Defualt value is 0. max_create_revision is the upper bound for returned key create revisions; all keys with greater create revisions will be filtered away. |
Returns
Type | Description |
---|---|
RangeResponse | The response received from the server. |
GetAll(Client, String, Int64, Int64, SortOrder, SortTarget, Boolean, Boolean, Boolean, Int64, Int64, Int64, Int64)
Range gets the keys in the range from the key-value store.
Declaration
public static RangeResponse GetAll(this Client client, string key, long limit = 0L, long revision = 0L, SortOrder sortOrder = null, SortTarget sortTarget = null, bool serializable = false, bool keysOnly = false, bool countOnly = false, long minModRevision = 0L, long maxModRevision = 0L, long minCreateRevision = 0L, long maxCreateRevision = 0L)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
System.String | key | key is the first key for the range. If range_end is not given, the request only looks up key. |
System.Int64 | limit | Defualt value is 0. limit is a limit on the number of keys returned for the request. When limit is set to 0, it is treated as no limit. |
System.Int64 | revision | Defualt value is 0. revision is the point-in-time of the key-value store to use for the range. If revision is less or equal to zero, the range is over the newest key-value store. If the revision has been compacted, ErrCompacted is returned as a response. |
SortOrder | sortOrder | Defualt value is SortOrder.None. sort_order is the order for returned sorted results. |
SortTarget | sortTarget | Defualt value is SortTarget.Key. sort_target is the key-value field to use for sorting. |
System.Boolean | serializable | Defualt value is false. serializable sets the range request to use serializable member-local reads. Range requests are linearizable by default; linearizable requests have higher latency and lower throughput than serializable requests but reflect the current consensus of the cluster. For better performance, in exchange for possible stale reads, a serializable range request is served locally without needing to reach consensus with other nodes in the cluster. |
System.Boolean | keysOnly | Defualt value is false. keys_only when set returns only the keys and not the values. |
System.Boolean | countOnly | Defualt value is false. count_only when set returns only the count of the keys in the range. |
System.Int64 | minModRevision | Defualt value is 0. min_mod_revision is the lower bound for returned key mod revisions; all keys with lesser mod revisions will be filtered away. |
System.Int64 | maxModRevision | Defualt value is 0. max_mod_revision is the upper bound for returned key mod revisions; all keys with greater mod revisions will be filtered away. |
System.Int64 | minCreateRevision | Defualt value is 0. min_create_revision is the lower bound for returned key create revisions; all keys with lesser create trevisions will be filtered away. |
System.Int64 | maxCreateRevision | Defualt value is 0. max_create_revision is the upper bound for returned key create revisions; all keys with greater create revisions will be filtered away. |
Returns
Type | Description |
---|---|
RangeResponse | The response received from the server. |
GetAllAsync(Client, ByteString, Int64, Int64, SortOrder, SortTarget, Boolean, Boolean, Boolean, Int64, Int64, Int64, Int64)
Range gets the keys in the range from the key-value store.
Declaration
public static AsyncUnaryCall<RangeResponse> GetAllAsync(this Client client, ByteString key, long limit = 0L, long revision = 0L, SortOrder sortOrder = null, SortTarget sortTarget = null, bool serializable = false, bool keysOnly = false, bool countOnly = false, long minModRevision = 0L, long maxModRevision = 0L, long minCreateRevision = 0L, long maxCreateRevision = 0L)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
ByteString | key | key is the first key for the range. If range_end is not given, the request only looks up key. |
System.Int64 | limit | Defualt value is 0. limit is a limit on the number of keys returned for the request. When limit is set to 0, it is treated as no limit. |
System.Int64 | revision | Defualt value is 0. revision is the point-in-time of the key-value store to use for the range. If revision is less or equal to zero, the range is over the newest key-value store. If the revision has been compacted, ErrCompacted is returned as a response. |
SortOrder | sortOrder | Defualt value is SortOrder.None. sort_order is the order for returned sorted results. |
SortTarget | sortTarget | Defualt value is SortTarget.Key. sort_target is the key-value field to use for sorting. |
System.Boolean | serializable | Defualt value is false. serializable sets the range request to use serializable member-local reads. Range requests are linearizable by default; linearizable requests have higher latency and lower throughput than serializable requests but reflect the current consensus of the cluster. For better performance, in exchange for possible stale reads, a serializable range request is served locally without needing to reach consensus with other nodes in the cluster. |
System.Boolean | keysOnly | Defualt value is false. keys_only when set returns only the keys and not the values. |
System.Boolean | countOnly | Defualt value is false. count_only when set returns only the count of the keys in the range. |
System.Int64 | minModRevision | Defualt value is 0. min_mod_revision is the lower bound for returned key mod revisions; all keys with lesser mod revisions will be filtered away. |
System.Int64 | maxModRevision | Defualt value is 0. max_mod_revision is the upper bound for returned key mod revisions; all keys with greater mod revisions will be filtered away. |
System.Int64 | minCreateRevision | Defualt value is 0. min_create_revision is the lower bound for returned key create revisions; all keys with lesser create trevisions will be filtered away. |
System.Int64 | maxCreateRevision | Defualt value is 0. max_create_revision is the upper bound for returned key create revisions; all keys with greater create revisions will be filtered away. |
Returns
Type | Description |
---|---|
AsyncUnaryCall<RangeResponse> | The call object. |
GetAllAsync(Client, String, Int64, Int64, SortOrder, SortTarget, Boolean, Boolean, Boolean, Int64, Int64, Int64, Int64)
Range gets the keys in the range from the key-value store.
Declaration
public static AsyncUnaryCall<RangeResponse> GetAllAsync(this Client client, string key, long limit = 0L, long revision = 0L, SortOrder sortOrder = null, SortTarget sortTarget = null, bool serializable = false, bool keysOnly = false, bool countOnly = false, long minModRevision = 0L, long maxModRevision = 0L, long minCreateRevision = 0L, long maxCreateRevision = 0L)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
System.String | key | key is the first key for the range. If range_end is not given, the request only looks up key. |
System.Int64 | limit | Defualt value is 0. limit is a limit on the number of keys returned for the request. When limit is set to 0, it is treated as no limit. |
System.Int64 | revision | Defualt value is 0. revision is the point-in-time of the key-value store to use for the range. If revision is less or equal to zero, the range is over the newest key-value store. If the revision has been compacted, ErrCompacted is returned as a response. |
SortOrder | sortOrder | Defualt value is SortOrder.None. sort_order is the order for returned sorted results. |
SortTarget | sortTarget | Defualt value is SortTarget.Key. sort_target is the key-value field to use for sorting. |
System.Boolean | serializable | Defualt value is false. serializable sets the range request to use serializable member-local reads. Range requests are linearizable by default; linearizable requests have higher latency and lower throughput than serializable requests but reflect the current consensus of the cluster. For better performance, in exchange for possible stale reads, a serializable range request is served locally without needing to reach consensus with other nodes in the cluster. |
System.Boolean | keysOnly | Defualt value is false. keys_only when set returns only the keys and not the values. |
System.Boolean | countOnly | Defualt value is false. count_only when set returns only the count of the keys in the range. |
System.Int64 | minModRevision | Defualt value is 0. min_mod_revision is the lower bound for returned key mod revisions; all keys with lesser mod revisions will be filtered away. |
System.Int64 | maxModRevision | Defualt value is 0. max_mod_revision is the upper bound for returned key mod revisions; all keys with greater mod revisions will be filtered away. |
System.Int64 | minCreateRevision | Defualt value is 0. min_create_revision is the lower bound for returned key create revisions; all keys with lesser create trevisions will be filtered away. |
System.Int64 | maxCreateRevision | Defualt value is 0. max_create_revision is the upper bound for returned key create revisions; all keys with greater create revisions will be filtered away. |
Returns
Type | Description |
---|---|
AsyncUnaryCall<RangeResponse> | The call object. |
Put(Client, ByteString, ByteString, Int64, Boolean, Boolean, Boolean)
Put puts the given key into the key-value store. A put request increments the revision of the key-value store and generates one event in the event history.
Declaration
public static PutResponse Put(this Client client, ByteString key, ByteString value, long lease = 0L, bool prevKv = false, bool ignoreLease = false, bool ignoreValue = false)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
ByteString | key | key is the key, in bytes, to put into the key-value store. |
ByteString | value | value is the value, in bytes, to associate with the key in the key-value store. |
System.Int64 | lease | Defualt value is 0. lease is the lease ID to associate with the key in the key-value store. A lease value of 0 indicates no lease. |
System.Boolean | prevKv | Defualt value is false. If prev_kv is set, etcd gets the previous key-value pair before changing it. The previous key-value pair will be returned in the put response. |
System.Boolean | ignoreLease | Defualt value is false. If ignore_lease is set, etcd updates the key using its current lease. Returns an error if the key does not exist. |
System.Boolean | ignoreValue | Defualt value is false. If ignore_value is set, etcd updates the key using its current value. Returns an error if the key does not exist. |
Returns
Type | Description |
---|---|
PutResponse | The response received from the server. |
Put(Client, String, String, Int64, Boolean, Boolean, Boolean)
Put puts the given key into the key-value store. A put request increments the revision of the key-value store and generates one event in the event history.
Declaration
public static PutResponse Put(this Client client, string key, string value, long lease = 0L, bool prevKv = false, bool ignoreLease = false, bool ignoreValue = false)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
System.String | key | key is the key, in Utf8 string, will, to put into the key-value store. |
System.String | value | value is the value, in Utf8 string, to associate with the key in the key-value store. |
System.Int64 | lease | Defualt value is 0. lease is the lease ID to associate with the key in the key-value store. A lease value of 0 indicates no lease. |
System.Boolean | prevKv | Defualt value is false. If prev_kv is set, etcd gets the previous key-value pair before changing it. The previous key-value pair will be returned in the put response. |
System.Boolean | ignoreLease | Defualt value is false. If ignore_lease is set, etcd updates the key using its current lease. Returns an error if the key does not exist. |
System.Boolean | ignoreValue | Defualt value is false. If ignore_value is set, etcd updates the key using its current value. Returns an error if the key does not exist. |
Returns
Type | Description |
---|---|
PutResponse | The response received from the server. |
PutAsync(Client, ByteString, ByteString, Int64, Boolean, Boolean, Boolean)
Put puts the given key into the key-value store. A put request increments the revision of the key-value store and generates one event in the event history.
Declaration
public static AsyncUnaryCall<PutResponse> PutAsync(this Client client, ByteString key, ByteString value, long lease = 0L, bool prevKv = false, bool ignoreLease = false, bool ignoreValue = false)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
ByteString | key | key is the key, in bytes, to put into the key-value store. |
ByteString | value | value is the value, in bytes, to associate with the key in the key-value store. |
System.Int64 | lease | Defualt value is 0. lease is the lease ID to associate with the key in the key-value store. A lease value of 0 indicates no lease. |
System.Boolean | prevKv | Defualt value is false. If prev_kv is set, etcd gets the previous key-value pair before changing it. The previous key-value pair will be returned in the put response. |
System.Boolean | ignoreLease | Defualt value is false. If ignore_lease is set, etcd updates the key using its current lease. Returns an error if the key does not exist. |
System.Boolean | ignoreValue | Defualt value is false. If ignore_value is set, etcd updates the key using its current value. Returns an error if the key does not exist. |
Returns
Type | Description |
---|---|
AsyncUnaryCall<PutResponse> | The call object. |
PutAsync(Client, String, String, Int64, Boolean, Boolean, Boolean)
Put puts the given key into the key-value store. A put request increments the revision of the key-value store and generates one event in the event history.
Declaration
public static AsyncUnaryCall<PutResponse> PutAsync(this Client client, string key, string value, long lease = 0L, bool prevKv = false, bool ignoreLease = false, bool ignoreValue = false)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
System.String | key | key is the key, in Utf8 string, will, to put into the key-value store. |
System.String | value | value is the value, in Utf8 string, to associate with the key in the key-value store. |
System.Int64 | lease | Defualt value is 0. lease is the lease ID to associate with the key in the key-value store. A lease value of 0 indicates no lease. |
System.Boolean | prevKv | Defualt value is false. If prev_kv is set, etcd gets the previous key-value pair before changing it. The previous key-value pair will be returned in the put response. |
System.Boolean | ignoreLease | Defualt value is false. If ignore_lease is set, etcd updates the key using its current lease. Returns an error if the key does not exist. |
System.Boolean | ignoreValue | Defualt value is false. If ignore_value is set, etcd updates the key using its current value. Returns an error if the key does not exist. |
Returns
Type | Description |
---|---|
AsyncUnaryCall<PutResponse> | The call object. |
Range(Client, ByteString, ByteString, Int64, Int64, SortOrder, SortTarget, Boolean, Boolean, Boolean, Int64, Int64, Int64, Int64)
Range gets the keys in the range from the key-value store.
Declaration
public static RangeResponse Range(this Client client, ByteString key, ByteString rangeEnd = null, long limit = 0L, long revision = 0L, SortOrder sortOrder = null, SortTarget sortTarget = null, bool serializable = false, bool keysOnly = false, bool countOnly = false, long minModRevision = 0L, long maxModRevision = 0L, long minCreateRevision = 0L, long maxCreateRevision = 0L)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
ByteString | key | key is the first key for the range. If range_end is not given, the request only looks up key. |
ByteString | rangeEnd | range_end is the upper bound on the requested range [key, range_end). If range_end is '\0', the range is all keys >= key. If range_end is key plus one (e.g., "aa"+1 == "ab", "a\xff"+1 == "b"), then the range request gets all keys prefixed with key. If both key and range_end are '\0', then the range request returns all keys. |
System.Int64 | limit | Defualt value is 0. limit is a limit on the number of keys returned for the request. When limit is set to 0, it is treated as no limit. |
System.Int64 | revision | Defualt value is 0. revision is the point-in-time of the key-value store to use for the range. If revision is less or equal to zero, the range is over the newest key-value store. If the revision has been compacted, ErrCompacted is returned as a response. |
SortOrder | sortOrder | Defualt value is SortOrder.None. sort_order is the order for returned sorted results. |
SortTarget | sortTarget | Defualt value is SortTarget.Key. sort_target is the key-value field to use for sorting. |
System.Boolean | serializable | Defualt value is false. serializable sets the range request to use serializable member-local reads. Range requests are linearizable by default; linearizable requests have higher latency and lower throughput than serializable requests but reflect the current consensus of the cluster. For better performance, in exchange for possible stale reads, a serializable range request is served locally without needing to reach consensus with other nodes in the cluster. |
System.Boolean | keysOnly | Defualt value is false. keys_only when set returns only the keys and not the values. |
System.Boolean | countOnly | Defualt value is false. count_only when set returns only the count of the keys in the range. |
System.Int64 | minModRevision | Defualt value is 0. min_mod_revision is the lower bound for returned key mod revisions; all keys with lesser mod revisions will be filtered away. |
System.Int64 | maxModRevision | Defualt value is 0. max_mod_revision is the upper bound for returned key mod revisions; all keys with greater mod revisions will be filtered away. |
System.Int64 | minCreateRevision | Defualt value is 0. min_create_revision is the lower bound for returned key create revisions; all keys with lesser create trevisions will be filtered away. |
System.Int64 | maxCreateRevision | Defualt value is 0. max_create_revision is the upper bound for returned key create revisions; all keys with greater create revisions will be filtered away. |
Returns
Type | Description |
---|---|
RangeResponse | The response received from the server. |
Range(Client, String, String, Int64, Int64, SortOrder, SortTarget, Boolean, Boolean, Boolean, Int64, Int64, Int64, Int64)
Range gets the keys in the range from the key-value store.
Declaration
public static RangeResponse Range(this Client client, string key, string rangeEnd = null, long limit = 0L, long revision = 0L, SortOrder sortOrder = null, SortTarget sortTarget = null, bool serializable = false, bool keysOnly = false, bool countOnly = false, long minModRevision = 0L, long maxModRevision = 0L, long minCreateRevision = 0L, long maxCreateRevision = 0L)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
System.String | key | key is the first key for the range. If range_end is not given, the request only looks up key. |
System.String | rangeEnd | range_end is the upper bound on the requested range [key, range_end). If range_end is '\0', the range is all keys >= key. If range_end is key plus one (e.g., "aa"+1 == "ab", "a\xff"+1 == "b"), then the range request gets all keys prefixed with key. If both key and range_end are '\0', then the range request returns all keys. |
System.Int64 | limit | Defualt value is 0. limit is a limit on the number of keys returned for the request. When limit is set to 0, it is treated as no limit. |
System.Int64 | revision | Defualt value is 0. revision is the point-in-time of the key-value store to use for the range. If revision is less or equal to zero, the range is over the newest key-value store. If the revision has been compacted, ErrCompacted is returned as a response. |
SortOrder | sortOrder | Defualt value is SortOrder.None. sort_order is the order for returned sorted results. |
SortTarget | sortTarget | Defualt value is SortTarget.Key. sort_target is the key-value field to use for sorting. |
System.Boolean | serializable | Defualt value is false. serializable sets the range request to use serializable member-local reads. Range requests are linearizable by default; linearizable requests have higher latency and lower throughput than serializable requests but reflect the current consensus of the cluster. For better performance, in exchange for possible stale reads, a serializable range request is served locally without needing to reach consensus with other nodes in the cluster. |
System.Boolean | keysOnly | Defualt value is false. keys_only when set returns only the keys and not the values. |
System.Boolean | countOnly | Defualt value is false. count_only when set returns only the count of the keys in the range. |
System.Int64 | minModRevision | Defualt value is 0. min_mod_revision is the lower bound for returned key mod revisions; all keys with lesser mod revisions will be filtered away. |
System.Int64 | maxModRevision | Defualt value is 0. max_mod_revision is the upper bound for returned key mod revisions; all keys with greater mod revisions will be filtered away. |
System.Int64 | minCreateRevision | Defualt value is 0. min_create_revision is the lower bound for returned key create revisions; all keys with lesser create trevisions will be filtered away. |
System.Int64 | maxCreateRevision | Defualt value is 0. max_create_revision is the upper bound for returned key create revisions; all keys with greater create revisions will be filtered away. |
Returns
Type | Description |
---|---|
RangeResponse | The response received from the server. |
RangeAsync(Client, ByteString, ByteString, Int64, Int64, SortOrder, SortTarget, Boolean, Boolean, Boolean, Int64, Int64, Int64, Int64)
Range gets the keys in the range from the key-value store.
Declaration
public static AsyncUnaryCall<RangeResponse> RangeAsync(this Client client, ByteString key, ByteString rangeEnd = null, long limit = 0L, long revision = 0L, SortOrder sortOrder = null, SortTarget sortTarget = null, bool serializable = false, bool keysOnly = false, bool countOnly = false, long minModRevision = 0L, long maxModRevision = 0L, long minCreateRevision = 0L, long maxCreateRevision = 0L)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
ByteString | key | key is the first key for the range. If range_end is not given, the request only looks up key. |
ByteString | rangeEnd | range_end is the upper bound on the requested range [key, range_end). If range_end is '\0', the range is all keys >= key. If range_end is key plus one (e.g., "aa"+1 == "ab", "a\xff"+1 == "b"), then the range request gets all keys prefixed with key. If both key and range_end are '\0', then the range request returns all keys. |
System.Int64 | limit | Defualt value is 0. limit is a limit on the number of keys returned for the request. When limit is set to 0, it is treated as no limit. |
System.Int64 | revision | Defualt value is 0. revision is the point-in-time of the key-value store to use for the range. If revision is less or equal to zero, the range is over the newest key-value store. If the revision has been compacted, ErrCompacted is returned as a response. |
SortOrder | sortOrder | Defualt value is SortOrder.None. sort_order is the order for returned sorted results. |
SortTarget | sortTarget | Defualt value is SortTarget.Key. sort_target is the key-value field to use for sorting. |
System.Boolean | serializable | Defualt value is false. serializable sets the range request to use serializable member-local reads. Range requests are linearizable by default; linearizable requests have higher latency and lower throughput than serializable requests but reflect the current consensus of the cluster. For better performance, in exchange for possible stale reads, a serializable range request is served locally without needing to reach consensus with other nodes in the cluster. |
System.Boolean | keysOnly | Defualt value is false. keys_only when set returns only the keys and not the values. |
System.Boolean | countOnly | Defualt value is false. count_only when set returns only the count of the keys in the range. |
System.Int64 | minModRevision | Defualt value is 0. min_mod_revision is the lower bound for returned key mod revisions; all keys with lesser mod revisions will be filtered away. |
System.Int64 | maxModRevision | Defualt value is 0. max_mod_revision is the upper bound for returned key mod revisions; all keys with greater mod revisions will be filtered away. |
System.Int64 | minCreateRevision | Defualt value is 0. min_create_revision is the lower bound for returned key create revisions; all keys with lesser create trevisions will be filtered away. |
System.Int64 | maxCreateRevision | Defualt value is 0. max_create_revision is the upper bound for returned key create revisions; all keys with greater create revisions will be filtered away. |
Returns
Type | Description |
---|---|
AsyncUnaryCall<RangeResponse> | The call object. |
RangeAsync(Client, String, String, Int64, Int64, SortOrder, SortTarget, Boolean, Boolean, Boolean, Int64, Int64, Int64, Int64)
Range gets the keys in the range from the key-value store.
Declaration
public static AsyncUnaryCall<RangeResponse> RangeAsync(this Client client, string key, string rangeEnd = null, long limit = 0L, long revision = 0L, SortOrder sortOrder = null, SortTarget sortTarget = null, bool serializable = false, bool keysOnly = false, bool countOnly = false, long minModRevision = 0L, long maxModRevision = 0L, long minCreateRevision = 0L, long maxCreateRevision = 0L)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
System.String | key | key is the first key for the range. If range_end is not given, the request only looks up key. |
System.String | rangeEnd | range_end is the upper bound on the requested range [key, range_end). If range_end is '\0', the range is all keys >= key. If range_end is key plus one (e.g., "aa"+1 == "ab", "a\xff"+1 == "b"), then the range request gets all keys prefixed with key. If both key and range_end are '\0', then the range request returns all keys. |
System.Int64 | limit | Defualt value is 0. limit is a limit on the number of keys returned for the request. When limit is set to 0, it is treated as no limit. |
System.Int64 | revision | Defualt value is 0. revision is the point-in-time of the key-value store to use for the range. If revision is less or equal to zero, the range is over the newest key-value store. If the revision has been compacted, ErrCompacted is returned as a response. |
SortOrder | sortOrder | Defualt value is SortOrder.None. sort_order is the order for returned sorted results. |
SortTarget | sortTarget | Defualt value is SortTarget.Key. sort_target is the key-value field to use for sorting. |
System.Boolean | serializable | Defualt value is false. serializable sets the range request to use serializable member-local reads. Range requests are linearizable by default; linearizable requests have higher latency and lower throughput than serializable requests but reflect the current consensus of the cluster. For better performance, in exchange for possible stale reads, a serializable range request is served locally without needing to reach consensus with other nodes in the cluster. |
System.Boolean | keysOnly | Defualt value is false. keys_only when set returns only the keys and not the values. |
System.Boolean | countOnly | Defualt value is false. count_only when set returns only the count of the keys in the range. |
System.Int64 | minModRevision | Defualt value is 0. min_mod_revision is the lower bound for returned key mod revisions; all keys with lesser mod revisions will be filtered away. |
System.Int64 | maxModRevision | Defualt value is 0. max_mod_revision is the upper bound for returned key mod revisions; all keys with greater mod revisions will be filtered away. |
System.Int64 | minCreateRevision | Defualt value is 0. min_create_revision is the lower bound for returned key create revisions; all keys with lesser create trevisions will be filtered away. |
System.Int64 | maxCreateRevision | Defualt value is 0. max_create_revision is the upper bound for returned key create revisions; all keys with greater create revisions will be filtered away. |
Returns
Type | Description |
---|---|
AsyncUnaryCall<RangeResponse> | The call object. |
ToPrefixEnd(ByteString)
range_end is the key following the last key to delete for the range [key, range_end). If range_end is not given, the range is defined to contain only the key argument. If range_end is one bit larger than the given key, then the range is all the keys with the prefix (the given key). If range_end is '\0', the range is all keys greater than or equal to the key argument.
Declaration
public static ByteString ToPrefixEnd(this ByteString byteString)
Parameters
Type | Name | Description |
---|---|---|
ByteString | byteString | ByteString to range_end. |
Returns
Type | Description |
---|---|
ByteString | range_end. |
Txn(Client, TxnRequest)
Txn processes multiple requests in a single transaction. A txn request increments the revision of the key-value store and generates events with the same revision for every completed request. It is not allowed to modify the same key several times within one txn.
Declaration
public static TxnResponse Txn(this Client client, TxnRequest request)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
TxnRequest | request | The request to send to the server. |
Returns
Type | Description |
---|---|
TxnResponse | The response received from the server. |
TxnAsync(Client, TxnRequest)
Txn processes multiple requests in a single transaction. A txn request increments the revision of the key-value store and generates events with the same revision for every completed request. It is not allowed to modify the same key several times within one txn.
Declaration
public static AsyncUnaryCall<TxnResponse> TxnAsync(this Client client, TxnRequest request)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
TxnRequest | request | The request to send to the server. |
Returns
Type | Description |
---|---|
AsyncUnaryCall<TxnResponse> | The call object. |