public static final class Kvrpcpb.PrewriteRequest extends com.google.protobuf.GeneratedMessageV3 implements Kvrpcpb.PrewriteRequestOrBuilder
A prewrite is the first phase of writing to TiKV. It contains all data to be written in a transaction. TiKV will write the data in a preliminary state. Data cannot be read until it has been committed. The client should only commit a transaction once all prewrites succeed.Protobuf type
kvrpcpb.PrewriteRequest
Modifier and Type | Class and Description |
---|---|
static class |
Kvrpcpb.PrewriteRequest.Builder
A prewrite is the first phase of writing to TiKV.
|
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 |
ASSERTION_LEVEL_FIELD_NUMBER |
static int |
CONTEXT_FIELD_NUMBER |
static int |
FOR_UPDATE_TS_FIELD_NUMBER |
static int |
IS_PESSIMISTIC_LOCK_FIELD_NUMBER |
static int |
LOCK_TTL_FIELD_NUMBER |
static int |
MAX_COMMIT_TS_FIELD_NUMBER |
static int |
MIN_COMMIT_TS_FIELD_NUMBER |
static int |
MUTATIONS_FIELD_NUMBER |
static int |
PRIMARY_LOCK_FIELD_NUMBER |
static int |
SECONDARIES_FIELD_NUMBER |
static int |
SKIP_CONSTRAINT_CHECK_FIELD_NUMBER |
static int |
START_VERSION_FIELD_NUMBER |
static int |
TRY_ONE_PC_FIELD_NUMBER |
static int |
TXN_SIZE_FIELD_NUMBER |
static int |
USE_ASYNC_COMMIT_FIELD_NUMBER |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Kvrpcpb.AssertionLevel |
getAssertionLevel()
The level of assertion to use on this prewrte request.
|
int |
getAssertionLevelValue()
The level of assertion to use on this prewrte request.
|
Kvrpcpb.Context |
getContext()
.kvrpcpb.Context context = 1; |
Kvrpcpb.ContextOrBuilder |
getContextOrBuilder()
.kvrpcpb.Context context = 1; |
static Kvrpcpb.PrewriteRequest |
getDefaultInstance() |
Kvrpcpb.PrewriteRequest |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
long |
getForUpdateTs()
For pessimistic transactions only; used to check if a conflict lock is already committed.
|
boolean |
getIsPessimisticLock(int index)
For pessimistic transaction, some mutations don't need to be locked, for example, non-unique index key.
|
int |
getIsPessimisticLockCount()
For pessimistic transaction, some mutations don't need to be locked, for example, non-unique index key.
|
List<Boolean> |
getIsPessimisticLockList()
For pessimistic transaction, some mutations don't need to be locked, for example, non-unique index key.
|
long |
getLockTtl()
uint64 lock_ttl = 5; |
long |
getMaxCommitTs()
The max commit ts is reserved for limiting the commit ts of 1PC or async commit, which can be used to avoid
inconsistency with schema change.
|
long |
getMinCommitTs()
If min_commit_ts > 0, this is a large transaction request, the final commit_ts
will be inferred from `min_commit_ts`.
|
Kvrpcpb.Mutation |
getMutations(int index)
The data to be written to the database.
|
int |
getMutationsCount()
The data to be written to the database.
|
List<Kvrpcpb.Mutation> |
getMutationsList()
The data to be written to the database.
|
Kvrpcpb.MutationOrBuilder |
getMutationsOrBuilder(int index)
The data to be written to the database.
|
List<? extends Kvrpcpb.MutationOrBuilder> |
getMutationsOrBuilderList()
The data to be written to the database.
|
com.google.protobuf.Parser<Kvrpcpb.PrewriteRequest> |
getParserForType() |
com.google.protobuf.ByteString |
getPrimaryLock()
The client picks one key to be primary (unrelated to the primary key concept in SQL).
|
com.google.protobuf.ByteString |
getSecondaries(int index)
repeated bytes secondaries = 12; |
int |
getSecondariesCount()
repeated bytes secondaries = 12; |
List<com.google.protobuf.ByteString> |
getSecondariesList()
repeated bytes secondaries = 12; |
int |
getSerializedSize() |
boolean |
getSkipConstraintCheck()
TiKV can skip some checks, used for speeding up data migration.
|
long |
getStartVersion()
Identifies the transaction being written.
|
boolean |
getTryOnePc()
When the transaction involves only one region, it's possible to commit the transaction
directly with 1PC protocol.
|
long |
getTxnSize()
How many keys this transaction involves in this region.
|
com.google.protobuf.UnknownFieldSet |
getUnknownFields() |
boolean |
getUseAsyncCommit()
When async commit is enabled, `secondaries` should be set as the key list of all secondary
locks if the request prewrites the primary lock.
|
boolean |
hasContext()
.kvrpcpb.Context context = 1; |
int |
hashCode() |
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static Kvrpcpb.PrewriteRequest.Builder |
newBuilder() |
static Kvrpcpb.PrewriteRequest.Builder |
newBuilder(Kvrpcpb.PrewriteRequest prototype) |
Kvrpcpb.PrewriteRequest.Builder |
newBuilderForType() |
protected Kvrpcpb.PrewriteRequest.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
protected Object |
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) |
static Kvrpcpb.PrewriteRequest |
parseDelimitedFrom(InputStream input) |
static Kvrpcpb.PrewriteRequest |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Kvrpcpb.PrewriteRequest |
parseFrom(byte[] data) |
static Kvrpcpb.PrewriteRequest |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Kvrpcpb.PrewriteRequest |
parseFrom(ByteBuffer data) |
static Kvrpcpb.PrewriteRequest |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Kvrpcpb.PrewriteRequest |
parseFrom(com.google.protobuf.ByteString data) |
static Kvrpcpb.PrewriteRequest |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Kvrpcpb.PrewriteRequest |
parseFrom(com.google.protobuf.CodedInputStream input) |
static Kvrpcpb.PrewriteRequest |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Kvrpcpb.PrewriteRequest |
parseFrom(InputStream input) |
static Kvrpcpb.PrewriteRequest |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<Kvrpcpb.PrewriteRequest> |
parser() |
Kvrpcpb.PrewriteRequest.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, writeStringNoTag
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public 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 SKIP_CONSTRAINT_CHECK_FIELD_NUMBER
public static final int IS_PESSIMISTIC_LOCK_FIELD_NUMBER
public static final int TXN_SIZE_FIELD_NUMBER
public static final int FOR_UPDATE_TS_FIELD_NUMBER
public static final int MIN_COMMIT_TS_FIELD_NUMBER
public static final int USE_ASYNC_COMMIT_FIELD_NUMBER
public static final int SECONDARIES_FIELD_NUMBER
public static final int TRY_ONE_PC_FIELD_NUMBER
public static final int MAX_COMMIT_TS_FIELD_NUMBER
public static final int ASSERTION_LEVEL_FIELD_NUMBER
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance
in class com.google.protobuf.GeneratedMessageV3
public final com.google.protobuf.UnknownFieldSet getUnknownFields()
getUnknownFields
in interface com.google.protobuf.MessageOrBuilder
getUnknownFields
in class com.google.protobuf.GeneratedMessageV3
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class com.google.protobuf.GeneratedMessageV3
public boolean hasContext()
.kvrpcpb.Context context = 1;
hasContext
in interface Kvrpcpb.PrewriteRequestOrBuilder
public Kvrpcpb.Context getContext()
.kvrpcpb.Context context = 1;
getContext
in interface Kvrpcpb.PrewriteRequestOrBuilder
public Kvrpcpb.ContextOrBuilder getContextOrBuilder()
.kvrpcpb.Context context = 1;
getContextOrBuilder
in interface Kvrpcpb.PrewriteRequestOrBuilder
public List<Kvrpcpb.Mutation> getMutationsList()
The data to be written to the database.
repeated .kvrpcpb.Mutation mutations = 2;
getMutationsList
in interface Kvrpcpb.PrewriteRequestOrBuilder
public List<? extends Kvrpcpb.MutationOrBuilder> getMutationsOrBuilderList()
The data to be written to the database.
repeated .kvrpcpb.Mutation mutations = 2;
getMutationsOrBuilderList
in interface Kvrpcpb.PrewriteRequestOrBuilder
public int getMutationsCount()
The data to be written to the database.
repeated .kvrpcpb.Mutation mutations = 2;
getMutationsCount
in interface Kvrpcpb.PrewriteRequestOrBuilder
public Kvrpcpb.Mutation getMutations(int index)
The data to be written to the database.
repeated .kvrpcpb.Mutation mutations = 2;
getMutations
in interface Kvrpcpb.PrewriteRequestOrBuilder
public Kvrpcpb.MutationOrBuilder getMutationsOrBuilder(int index)
The data to be written to the database.
repeated .kvrpcpb.Mutation mutations = 2;
getMutationsOrBuilder
in interface Kvrpcpb.PrewriteRequestOrBuilder
public com.google.protobuf.ByteString getPrimaryLock()
The client picks one key to be primary (unrelated to the primary key concept in SQL). This key's lock is the source of truth for the state of a transaction. All other locks due to a transaction will point to the primary lock.
bytes primary_lock = 3;
getPrimaryLock
in interface Kvrpcpb.PrewriteRequestOrBuilder
public long getStartVersion()
Identifies the transaction being written.
uint64 start_version = 4;
getStartVersion
in interface Kvrpcpb.PrewriteRequestOrBuilder
public long getLockTtl()
uint64 lock_ttl = 5;
getLockTtl
in interface Kvrpcpb.PrewriteRequestOrBuilder
public boolean getSkipConstraintCheck()
TiKV can skip some checks, used for speeding up data migration.
bool skip_constraint_check = 6;
getSkipConstraintCheck
in interface Kvrpcpb.PrewriteRequestOrBuilder
public List<Boolean> getIsPessimisticLockList()
For pessimistic transaction, some mutations don't need to be locked, for example, non-unique index key.
repeated bool is_pessimistic_lock = 7;
getIsPessimisticLockList
in interface Kvrpcpb.PrewriteRequestOrBuilder
public int getIsPessimisticLockCount()
For pessimistic transaction, some mutations don't need to be locked, for example, non-unique index key.
repeated bool is_pessimistic_lock = 7;
getIsPessimisticLockCount
in interface Kvrpcpb.PrewriteRequestOrBuilder
public boolean getIsPessimisticLock(int index)
For pessimistic transaction, some mutations don't need to be locked, for example, non-unique index key.
repeated bool is_pessimistic_lock = 7;
getIsPessimisticLock
in interface Kvrpcpb.PrewriteRequestOrBuilder
index
- The index of the element to return.public long getTxnSize()
How many keys this transaction involves in this region.
uint64 txn_size = 8;
getTxnSize
in interface Kvrpcpb.PrewriteRequestOrBuilder
public long getForUpdateTs()
For pessimistic transactions only; used to check if a conflict lock is already committed.
uint64 for_update_ts = 9;
getForUpdateTs
in interface Kvrpcpb.PrewriteRequestOrBuilder
public long getMinCommitTs()
If min_commit_ts > 0, this is a large transaction request, the final commit_ts will be inferred from `min_commit_ts`.
uint64 min_commit_ts = 10;
getMinCommitTs
in interface Kvrpcpb.PrewriteRequestOrBuilder
public boolean getUseAsyncCommit()
When async commit is enabled, `secondaries` should be set as the key list of all secondary locks if the request prewrites the primary lock.
bool use_async_commit = 11;
getUseAsyncCommit
in interface Kvrpcpb.PrewriteRequestOrBuilder
public List<com.google.protobuf.ByteString> getSecondariesList()
repeated bytes secondaries = 12;
getSecondariesList
in interface Kvrpcpb.PrewriteRequestOrBuilder
public int getSecondariesCount()
repeated bytes secondaries = 12;
getSecondariesCount
in interface Kvrpcpb.PrewriteRequestOrBuilder
public com.google.protobuf.ByteString getSecondaries(int index)
repeated bytes secondaries = 12;
getSecondaries
in interface Kvrpcpb.PrewriteRequestOrBuilder
index
- The index of the element to return.public boolean getTryOnePc()
When the transaction involves only one region, it's possible to commit the transaction directly with 1PC protocol.
bool try_one_pc = 13;
getTryOnePc
in interface Kvrpcpb.PrewriteRequestOrBuilder
public long getMaxCommitTs()
The max commit ts is reserved for limiting the commit ts of 1PC or async commit, which can be used to avoid inconsistency with schema change.
uint64 max_commit_ts = 14;
getMaxCommitTs
in interface Kvrpcpb.PrewriteRequestOrBuilder
public int getAssertionLevelValue()
The level of assertion to use on this prewrte request.
.kvrpcpb.AssertionLevel assertion_level = 15;
getAssertionLevelValue
in interface Kvrpcpb.PrewriteRequestOrBuilder
public Kvrpcpb.AssertionLevel getAssertionLevel()
The level of assertion to use on this prewrte request.
.kvrpcpb.AssertionLevel assertion_level = 15;
getAssertionLevel
in interface Kvrpcpb.PrewriteRequestOrBuilder
public final boolean isInitialized()
isInitialized
in interface com.google.protobuf.MessageLiteOrBuilder
isInitialized
in class com.google.protobuf.GeneratedMessageV3
public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
writeTo
in interface com.google.protobuf.MessageLite
writeTo
in class com.google.protobuf.GeneratedMessageV3
IOException
public int getSerializedSize()
getSerializedSize
in interface com.google.protobuf.MessageLite
getSerializedSize
in class com.google.protobuf.GeneratedMessageV3
public boolean equals(Object obj)
equals
in interface com.google.protobuf.Message
equals
in class com.google.protobuf.AbstractMessage
public int hashCode()
hashCode
in interface com.google.protobuf.Message
hashCode
in class com.google.protobuf.AbstractMessage
public static Kvrpcpb.PrewriteRequest parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static Kvrpcpb.PrewriteRequest parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static Kvrpcpb.PrewriteRequest parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static Kvrpcpb.PrewriteRequest parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static Kvrpcpb.PrewriteRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static Kvrpcpb.PrewriteRequest parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static Kvrpcpb.PrewriteRequest parseFrom(InputStream input) throws IOException
IOException
public static Kvrpcpb.PrewriteRequest parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public static Kvrpcpb.PrewriteRequest parseDelimitedFrom(InputStream input) throws IOException
IOException
public static Kvrpcpb.PrewriteRequest parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public static Kvrpcpb.PrewriteRequest parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOException
public static Kvrpcpb.PrewriteRequest parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public Kvrpcpb.PrewriteRequest.Builder newBuilderForType()
newBuilderForType
in interface com.google.protobuf.Message
newBuilderForType
in interface com.google.protobuf.MessageLite
public static Kvrpcpb.PrewriteRequest.Builder newBuilder()
public static Kvrpcpb.PrewriteRequest.Builder newBuilder(Kvrpcpb.PrewriteRequest prototype)
public Kvrpcpb.PrewriteRequest.Builder toBuilder()
toBuilder
in interface com.google.protobuf.Message
toBuilder
in interface com.google.protobuf.MessageLite
protected Kvrpcpb.PrewriteRequest.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType
in class com.google.protobuf.GeneratedMessageV3
public static Kvrpcpb.PrewriteRequest getDefaultInstance()
public static com.google.protobuf.Parser<Kvrpcpb.PrewriteRequest> parser()
public com.google.protobuf.Parser<Kvrpcpb.PrewriteRequest> getParserForType()
getParserForType
in interface com.google.protobuf.Message
getParserForType
in interface com.google.protobuf.MessageLite
getParserForType
in class com.google.protobuf.GeneratedMessageV3
public Kvrpcpb.PrewriteRequest getDefaultInstanceForType()
getDefaultInstanceForType
in interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType
in interface com.google.protobuf.MessageOrBuilder
Copyright © 2024 PingCAP. All rights reserved.