public class TwoPhaseCommitter extends Object implements AutoCloseable
Constructor and Description |
---|
TwoPhaseCommitter(TiSession session,
long startTime) |
TwoPhaseCommitter(TiSession session,
long startTime,
long lockTTL) |
TwoPhaseCommitter(TiSession session,
long startTime,
long lockTTL,
ExecutorService executorService) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
commitPrimaryKey(BackOffer backOffer,
byte[] key,
long commitTs)
2pc - commit primary key
|
void |
commitSecondaryKeys(Iterator<ByteWrapper> keys,
long commitTs,
int commitBackOfferMS)
2pc - commit secondary keys
|
void |
prewritePrimaryKey(BackOffer backOffer,
byte[] primaryKey,
byte[] value)
2pc - prewrite primary key
|
void |
prewriteSecondaryKeys(byte[] primaryKey,
Iterator<BytePairWrapper> pairs,
int maxBackOfferMS)
2pc - prewrite secondary keys
|
public TwoPhaseCommitter(TiSession session, long startTime)
public TwoPhaseCommitter(TiSession session, long startTime, long lockTTL)
public TwoPhaseCommitter(TiSession session, long startTime, long lockTTL, ExecutorService executorService)
public void close() throws Exception
close
in interface AutoCloseable
Exception
public void prewritePrimaryKey(BackOffer backOffer, byte[] primaryKey, byte[] value) throws TiBatchWriteException
backOffer
- primaryKey
- value
- TiBatchWriteException
public void commitPrimaryKey(BackOffer backOffer, byte[] key, long commitTs) throws TiBatchWriteException
backOffer
- key
- TiBatchWriteException
public void prewriteSecondaryKeys(byte[] primaryKey, Iterator<BytePairWrapper> pairs, int maxBackOfferMS) throws TiBatchWriteException
primaryKey
- pairs
- TiBatchWriteException
public void commitSecondaryKeys(Iterator<ByteWrapper> keys, long commitTs, int commitBackOfferMS) throws TiBatchWriteException
keys
- commitTs
- TiBatchWriteException
Copyright © 2024 PingCAP. All rights reserved.