public static final class Kvrpcpb.PessimisticLockRequest extends com.google.protobuf.GeneratedMessageV3 implements Kvrpcpb.PessimisticLockRequestOrBuilder
Lock a set of keys to prepare to write to them.Protobuf type
kvrpcpb.PessimisticLockRequest| Modifier and Type | Class and Description |
|---|---|
static class |
Kvrpcpb.PessimisticLockRequest.Builder
Lock a set of keys to prepare to write to them.
|
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter| Modifier and Type | Field and Description |
|---|---|
static int |
CHECK_EXISTENCE_FIELD_NUMBER |
static int |
CONTEXT_FIELD_NUMBER |
static int |
FOR_UPDATE_TS_FIELD_NUMBER |
static int |
FORCE_FIELD_NUMBER |
static int |
IS_FIRST_LOCK_FIELD_NUMBER |
static int |
LOCK_TTL_FIELD_NUMBER |
static int |
MIN_COMMIT_TS_FIELD_NUMBER |
static int |
MUTATIONS_FIELD_NUMBER |
static int |
PRIMARY_LOCK_FIELD_NUMBER |
static int |
RETURN_VALUES_FIELD_NUMBER |
static int |
START_VERSION_FIELD_NUMBER |
static int |
WAIT_TIMEOUT_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
boolean |
getCheckExistence()
If set to true, it means TiKV need to check if the key exists, and return the result in
the `not_founds` feild in the response.
|
Kvrpcpb.Context |
getContext()
.kvrpcpb.Context context = 1; |
Kvrpcpb.ContextOrBuilder |
getContextOrBuilder()
.kvrpcpb.Context context = 1; |
static Kvrpcpb.PessimisticLockRequest |
getDefaultInstance() |
Kvrpcpb.PessimisticLockRequest |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
boolean |
getForce()
Deprecated.
|
long |
getForUpdateTs()
Each locking command in a pessimistic transaction has its own timestamp.
|
boolean |
getIsFirstLock()
If the request is the first lock request, we don't need to detect deadlock.
|
long |
getLockTtl()
uint64 lock_ttl = 5; |
long |
getMinCommitTs()
If min_commit_ts > 0, this is large transaction proto, the final commit_ts
would be infered from min_commit_ts.
|
Kvrpcpb.Mutation |
getMutations(int index)
In this case every `Op` of the mutations must be `PessimisticLock`.
|
int |
getMutationsCount()
In this case every `Op` of the mutations must be `PessimisticLock`.
|
List<Kvrpcpb.Mutation> |
getMutationsList()
In this case every `Op` of the mutations must be `PessimisticLock`.
|
Kvrpcpb.MutationOrBuilder |
getMutationsOrBuilder(int index)
In this case every `Op` of the mutations must be `PessimisticLock`.
|
List<? extends Kvrpcpb.MutationOrBuilder> |
getMutationsOrBuilderList()
In this case every `Op` of the mutations must be `PessimisticLock`.
|
com.google.protobuf.Parser<Kvrpcpb.PessimisticLockRequest> |
getParserForType() |
com.google.protobuf.ByteString |
getPrimaryLock()
bytes primary_lock = 3; |
boolean |
getReturnValues()
If it is true, TiKV will return values of the keys if no error, so TiDB can cache the values for
later read in the same transaction.
|
int |
getSerializedSize() |
long |
getStartVersion()
uint64 start_version = 4; |
com.google.protobuf.UnknownFieldSet |
getUnknownFields() |
long |
getWaitTimeout()
Time to wait for lock released in milliseconds when encountering locks.
|
boolean |
hasContext()
.kvrpcpb.Context context = 1; |
int |
hashCode() |
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static Kvrpcpb.PessimisticLockRequest.Builder |
newBuilder() |
static Kvrpcpb.PessimisticLockRequest.Builder |
newBuilder(Kvrpcpb.PessimisticLockRequest prototype) |
Kvrpcpb.PessimisticLockRequest.Builder |
newBuilderForType() |
protected Kvrpcpb.PessimisticLockRequest.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
protected Object |
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) |
static Kvrpcpb.PessimisticLockRequest |
parseDelimitedFrom(InputStream input) |
static Kvrpcpb.PessimisticLockRequest |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Kvrpcpb.PessimisticLockRequest |
parseFrom(byte[] data) |
static Kvrpcpb.PessimisticLockRequest |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Kvrpcpb.PessimisticLockRequest |
parseFrom(ByteBuffer data) |
static Kvrpcpb.PessimisticLockRequest |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Kvrpcpb.PessimisticLockRequest |
parseFrom(com.google.protobuf.ByteString data) |
static Kvrpcpb.PessimisticLockRequest |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Kvrpcpb.PessimisticLockRequest |
parseFrom(com.google.protobuf.CodedInputStream input) |
static Kvrpcpb.PessimisticLockRequest |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Kvrpcpb.PessimisticLockRequest |
parseFrom(InputStream input) |
static Kvrpcpb.PessimisticLockRequest |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<Kvrpcpb.PessimisticLockRequest> |
parser() |
Kvrpcpb.PessimisticLockRequest.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int CONTEXT_FIELD_NUMBER
public static final int MUTATIONS_FIELD_NUMBER
public static final int PRIMARY_LOCK_FIELD_NUMBER
public static final int START_VERSION_FIELD_NUMBER
public static final int LOCK_TTL_FIELD_NUMBER
public static final int FOR_UPDATE_TS_FIELD_NUMBER
public static final int IS_FIRST_LOCK_FIELD_NUMBER
public static final int WAIT_TIMEOUT_FIELD_NUMBER
public static final int FORCE_FIELD_NUMBER
public static final int RETURN_VALUES_FIELD_NUMBER
public static final int MIN_COMMIT_TS_FIELD_NUMBER
public static final int CHECK_EXISTENCE_FIELD_NUMBER
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance in class com.google.protobuf.GeneratedMessageV3public final com.google.protobuf.UnknownFieldSet getUnknownFields()
getUnknownFields in interface com.google.protobuf.MessageOrBuildergetUnknownFields in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public boolean hasContext()
.kvrpcpb.Context context = 1;hasContext in interface Kvrpcpb.PessimisticLockRequestOrBuilderpublic Kvrpcpb.Context getContext()
.kvrpcpb.Context context = 1;getContext in interface Kvrpcpb.PessimisticLockRequestOrBuilderpublic Kvrpcpb.ContextOrBuilder getContextOrBuilder()
.kvrpcpb.Context context = 1;getContextOrBuilder in interface Kvrpcpb.PessimisticLockRequestOrBuilderpublic List<Kvrpcpb.Mutation> getMutationsList()
In this case every `Op` of the mutations must be `PessimisticLock`.
repeated .kvrpcpb.Mutation mutations = 2;getMutationsList in interface Kvrpcpb.PessimisticLockRequestOrBuilderpublic List<? extends Kvrpcpb.MutationOrBuilder> getMutationsOrBuilderList()
In this case every `Op` of the mutations must be `PessimisticLock`.
repeated .kvrpcpb.Mutation mutations = 2;getMutationsOrBuilderList in interface Kvrpcpb.PessimisticLockRequestOrBuilderpublic int getMutationsCount()
In this case every `Op` of the mutations must be `PessimisticLock`.
repeated .kvrpcpb.Mutation mutations = 2;getMutationsCount in interface Kvrpcpb.PessimisticLockRequestOrBuilderpublic Kvrpcpb.Mutation getMutations(int index)
In this case every `Op` of the mutations must be `PessimisticLock`.
repeated .kvrpcpb.Mutation mutations = 2;getMutations in interface Kvrpcpb.PessimisticLockRequestOrBuilderpublic Kvrpcpb.MutationOrBuilder getMutationsOrBuilder(int index)
In this case every `Op` of the mutations must be `PessimisticLock`.
repeated .kvrpcpb.Mutation mutations = 2;getMutationsOrBuilder in interface Kvrpcpb.PessimisticLockRequestOrBuilderpublic com.google.protobuf.ByteString getPrimaryLock()
bytes primary_lock = 3;getPrimaryLock in interface Kvrpcpb.PessimisticLockRequestOrBuilderpublic long getStartVersion()
uint64 start_version = 4;getStartVersion in interface Kvrpcpb.PessimisticLockRequestOrBuilderpublic long getLockTtl()
uint64 lock_ttl = 5;getLockTtl in interface Kvrpcpb.PessimisticLockRequestOrBuilderpublic long getForUpdateTs()
Each locking command in a pessimistic transaction has its own timestamp. If locking fails, then the corresponding SQL statement can be retried with a later timestamp, TiDB does not need to retry the whole transaction. The name comes from the `SELECT ... FOR UPDATE` SQL statement which is a locking read. Each `SELECT ... FOR UPDATE` in a transaction will be assigned its own timestamp.
uint64 for_update_ts = 6;getForUpdateTs in interface Kvrpcpb.PessimisticLockRequestOrBuilderpublic boolean getIsFirstLock()
If the request is the first lock request, we don't need to detect deadlock.
bool is_first_lock = 7;getIsFirstLock in interface Kvrpcpb.PessimisticLockRequestOrBuilderpublic long getWaitTimeout()
Time to wait for lock released in milliseconds when encountering locks. 0 means using default timeout in TiKV. Negative means no wait.
int64 wait_timeout = 8;getWaitTimeout in interface Kvrpcpb.PessimisticLockRequestOrBuilder@Deprecated public boolean getForce()
If it is true, TiKV will acquire the pessimistic lock regardless of write conflict and return the latest value. It's only supported for single mutation.
bool force = 9 [deprecated = true];getForce in interface Kvrpcpb.PessimisticLockRequestOrBuilderpublic boolean getReturnValues()
If it is true, TiKV will return values of the keys if no error, so TiDB can cache the values for later read in the same transaction. When 'force' is set to true, this field is ignored.
bool return_values = 10;getReturnValues in interface Kvrpcpb.PessimisticLockRequestOrBuilderpublic long getMinCommitTs()
If min_commit_ts > 0, this is large transaction proto, the final commit_ts would be infered from min_commit_ts.
uint64 min_commit_ts = 11;getMinCommitTs in interface Kvrpcpb.PessimisticLockRequestOrBuilderpublic boolean getCheckExistence()
If set to true, it means TiKV need to check if the key exists, and return the result in the `not_founds` feild in the response. This works no matter if `return_values` is set. If `return_values` is set, it simply makes no difference; otherwise, the `value` field of the repsonse will be empty while the `not_founds` field still indicates the keys' existence.
bool check_existence = 12;getCheckExistence in interface Kvrpcpb.PessimisticLockRequestOrBuilderpublic final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static Kvrpcpb.PessimisticLockRequest parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Kvrpcpb.PessimisticLockRequest parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Kvrpcpb.PessimisticLockRequest parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Kvrpcpb.PessimisticLockRequest parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Kvrpcpb.PessimisticLockRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Kvrpcpb.PessimisticLockRequest parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Kvrpcpb.PessimisticLockRequest parseFrom(InputStream input) throws IOException
IOExceptionpublic static Kvrpcpb.PessimisticLockRequest parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static Kvrpcpb.PessimisticLockRequest parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static Kvrpcpb.PessimisticLockRequest parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static Kvrpcpb.PessimisticLockRequest parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static Kvrpcpb.PessimisticLockRequest parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic Kvrpcpb.PessimisticLockRequest.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static Kvrpcpb.PessimisticLockRequest.Builder newBuilder()
public static Kvrpcpb.PessimisticLockRequest.Builder newBuilder(Kvrpcpb.PessimisticLockRequest prototype)
public Kvrpcpb.PessimisticLockRequest.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected Kvrpcpb.PessimisticLockRequest.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static Kvrpcpb.PessimisticLockRequest getDefaultInstance()
public static com.google.protobuf.Parser<Kvrpcpb.PessimisticLockRequest> parser()
public com.google.protobuf.Parser<Kvrpcpb.PessimisticLockRequest> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public Kvrpcpb.PessimisticLockRequest getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderCopyright © 2025 PingCAP. All rights reserved.