public static enum Kvrpcpb.APIVersion extends Enum<Kvrpcpb.APIVersion> implements com.google.protobuf.ProtocolMessageEnum
The API version the server and the client is using. See more details in https://github.com/tikv/rfcs/blob/master/text/0069-api-v2.md.Protobuf enum
kvrpcpb.APIVersion| 枚举常量和说明 |
|---|
UNRECOGNIZED |
V1
Mainly for TxnKV and not safe to use RawKV along with TxnKV.
|
V1TTL
Only RawKV is available, and then 8 bytes representing the unix timestamp in
seconds for expiring time will be append to the value of all RawKV kv pairs.
------------------------------------------------------------
| User value | Expire Ts |
------------------------------------------------------------
| 0x12 0x34 0x56 | 0x00 0x00 0x00 0x00 0x00 0x00 0xff 0xff |
------------------------------------------------------------
V1TTL server only accepts V1 raw requests.
|
V2
TxnKV keys start with `x{keyspace id}`, `m`, or `t`.
|
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
V1_VALUE
Mainly for TxnKV and not safe to use RawKV along with TxnKV.
|
static int |
V1TTL_VALUE
Only RawKV is available, and then 8 bytes representing the unix timestamp in
seconds for expiring time will be append to the value of all RawKV kv pairs.
------------------------------------------------------------
| User value | Expire Ts |
------------------------------------------------------------
| 0x12 0x34 0x56 | 0x00 0x00 0x00 0x00 0x00 0x00 0xff 0xff |
------------------------------------------------------------
V1TTL server only accepts V1 raw requests.
|
static int |
V2_VALUE
TxnKV keys start with `x{keyspace id}`, `m`, or `t`.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static Kvrpcpb.APIVersion |
forNumber(int value) |
static com.google.protobuf.Descriptors.EnumDescriptor |
getDescriptor() |
com.google.protobuf.Descriptors.EnumDescriptor |
getDescriptorForType() |
int |
getNumber() |
com.google.protobuf.Descriptors.EnumValueDescriptor |
getValueDescriptor() |
static com.google.protobuf.Internal.EnumLiteMap<Kvrpcpb.APIVersion> |
internalGetValueMap() |
static Kvrpcpb.APIVersion |
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) |
static Kvrpcpb.APIVersion |
valueOf(int value)
已过时。
Use
forNumber(int) instead. |
static Kvrpcpb.APIVersion |
valueOf(String name)
返回带有指定名称的该类型的枚举常量。
|
static Kvrpcpb.APIVersion[] |
values()
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。
|
public static final Kvrpcpb.APIVersion V1
Mainly for TxnKV and not safe to use RawKV along with TxnKV. V1 server only accepts V1 requests. Except that the V1 raw requests with TTL will be rejected.
V1 = 0;public static final Kvrpcpb.APIVersion V1TTL
Only RawKV is available, and then 8 bytes representing the unix timestamp in seconds for expiring time will be append to the value of all RawKV kv pairs. ------------------------------------------------------------ | User value | Expire Ts | ------------------------------------------------------------ | 0x12 0x34 0x56 | 0x00 0x00 0x00 0x00 0x00 0x00 0xff 0xff | ------------------------------------------------------------ V1TTL server only accepts V1 raw requests. V1 client should not use `V1TTL` in request. V1 client should always send `V1`.
V1TTL = 1;public static final Kvrpcpb.APIVersion V2
TxnKV keys start with `x{keyspace id}`, `m`, or `t`.
RawKV keys must be in `default` CF and all start with `r{keyspace id}` prefix,
where the keyspace id is in varint format (little endian), whose bytes expect
the last one always sets the most significant bit to 1.
The last byte in the raw value must be a meta flag. For example:
--------------------------------------
| User value | Meta flags |
--------------------------------------
| 0x12 0x34 0x56 | 0x00 (0b00000000) |
--------------------------------------
As shown in the example below, the least significant bit of the meta flag
indicates whether the value contains 8 bytes expire ts at the very left to the
meta flags.
--------------------------------------------------------------------------------
| User value | Expire Ts | Meta flags |
--------------------------------------------------------------------------------
| 0x12 0x34 0x56 | 0x00 0x00 0x00 0x00 0x00 0x00 0xff 0xff | 0x01 (0b00000001) |
--------------------------------------------------------------------------------
V2 server accpets V2 requests and V1 txn requests that statrts with TiDB key
prefix (`m` and `t`).
V2 = 2;public static final Kvrpcpb.APIVersion UNRECOGNIZED
public static final int V1_VALUE
Mainly for TxnKV and not safe to use RawKV along with TxnKV. V1 server only accepts V1 requests. Except that the V1 raw requests with TTL will be rejected.
V1 = 0;public static final int V1TTL_VALUE
Only RawKV is available, and then 8 bytes representing the unix timestamp in seconds for expiring time will be append to the value of all RawKV kv pairs. ------------------------------------------------------------ | User value | Expire Ts | ------------------------------------------------------------ | 0x12 0x34 0x56 | 0x00 0x00 0x00 0x00 0x00 0x00 0xff 0xff | ------------------------------------------------------------ V1TTL server only accepts V1 raw requests. V1 client should not use `V1TTL` in request. V1 client should always send `V1`.
V1TTL = 1;public static final int V2_VALUE
TxnKV keys start with `x{keyspace id}`, `m`, or `t`.
RawKV keys must be in `default` CF and all start with `r{keyspace id}` prefix,
where the keyspace id is in varint format (little endian), whose bytes expect
the last one always sets the most significant bit to 1.
The last byte in the raw value must be a meta flag. For example:
--------------------------------------
| User value | Meta flags |
--------------------------------------
| 0x12 0x34 0x56 | 0x00 (0b00000000) |
--------------------------------------
As shown in the example below, the least significant bit of the meta flag
indicates whether the value contains 8 bytes expire ts at the very left to the
meta flags.
--------------------------------------------------------------------------------
| User value | Expire Ts | Meta flags |
--------------------------------------------------------------------------------
| 0x12 0x34 0x56 | 0x00 0x00 0x00 0x00 0x00 0x00 0xff 0xff | 0x01 (0b00000001) |
--------------------------------------------------------------------------------
V2 server accpets V2 requests and V1 txn requests that statrts with TiDB key
prefix (`m` and `t`).
V2 = 2;public static Kvrpcpb.APIVersion[] values()
for (Kvrpcpb.APIVersion c : Kvrpcpb.APIVersion.values()) System.out.println(c);
public static Kvrpcpb.APIVersion valueOf(String name)
name - 要返回的枚举常量的名称。IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量NullPointerException - 如果参数为空值public final int getNumber()
getNumber 在接口中 com.google.protobuf.Internal.EnumLitegetNumber 在接口中 com.google.protobuf.ProtocolMessageEnum@Deprecated public static Kvrpcpb.APIVersion valueOf(int value)
forNumber(int) instead.public static Kvrpcpb.APIVersion forNumber(int value)
public static com.google.protobuf.Internal.EnumLiteMap<Kvrpcpb.APIVersion> internalGetValueMap()
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor()
getValueDescriptor 在接口中 com.google.protobuf.ProtocolMessageEnumpublic final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()
getDescriptorForType 在接口中 com.google.protobuf.ProtocolMessageEnumpublic static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor()
public static Kvrpcpb.APIVersion valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)
Copyright © 2023 PingCAP. All rights reserved.