public class AsyncResolveData extends Object
| 构造器和说明 |
|---|
AsyncResolveData(long commitTs,
List<com.google.protobuf.ByteString> keys,
boolean missingLock) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addKeys(List<Kvrpcpb.LockInfo> locks,
int expected,
long startTs,
long commitTs)
addKeys adds the keys from locks to data, keeping other fields up to date. startTS and commitTS
are for the transaction being resolved.
|
void |
appendKey(com.google.protobuf.ByteString key) |
long |
getCommitTs() |
List<com.google.protobuf.ByteString> |
getKeys() |
public AsyncResolveData(long commitTs,
List<com.google.protobuf.ByteString> keys,
boolean missingLock)
public long getCommitTs()
public List<com.google.protobuf.ByteString> getKeys()
public void appendKey(com.google.protobuf.ByteString key)
public void addKeys(List<Kvrpcpb.LockInfo> locks, int expected, long startTs, long commitTs) throws ResolveLockException
In the async commit protocol when checking locks, we send a list of keys to check and get back a list of locks. There will be a lock for every key which is locked. If there are fewer locks than keys, then a lock is missing because it has been committed, rolled back, or was never locked.
In this function, locks is the list of locks, and expected is the number of keys. asyncResolveData.missingLock will be set to true if the lengths don't match. If the lengths do match, then the locks are added to asyncResolveData.locks and will need to be resolved by the caller.
Copyright © 2022 PingCAP. All rights reserved.