From 700fad0167e1c63ffd63e7045340ebc2973a8584 Mon Sep 17 00:00:00 2001 From: jackjeyis Date: Tue, 4 Jun 2024 11:36:09 +0800 Subject: [PATCH] [close #774] Add TwoPhaseCommitter new Constructor contains executorService(#774) (#775) * add TwoPhaseCommitter new Constructor contains executorService(#774) Signed-off-by: b.tian * [close #671] remove shadowing of netty && grpc (#781) Signed-off-by: b.tian * [close #782] bump grpc to 1.60.0 (#783) Signed-off-by: b.tian * [close #774]remove redundant code --------- Signed-off-by: b.tian Co-authored-by: b.tian Co-authored-by: iosmanthus Co-authored-by: shi yuhang <52435083+shiyuhang0@users.noreply.github.com> --- src/main/java/org/tikv/txn/TwoPhaseCommitter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/tikv/txn/TwoPhaseCommitter.java b/src/main/java/org/tikv/txn/TwoPhaseCommitter.java index 550b7de47ac..d602cd5261f 100644 --- a/src/main/java/org/tikv/txn/TwoPhaseCommitter.java +++ b/src/main/java/org/tikv/txn/TwoPhaseCommitter.java @@ -88,6 +88,11 @@ public TwoPhaseCommitter(TiSession session, long startTime) { } public TwoPhaseCommitter(TiSession session, long startTime, long lockTTL) { + this(session, startTime, lockTTL, createExecutorService(WRITE_BUFFER_SIZE)); + } + + public TwoPhaseCommitter( + TiSession session, long startTime, long lockTTL, ExecutorService executorService) { this( session, startTime, @@ -98,7 +103,7 @@ public TwoPhaseCommitter(TiSession session, long startTime, long lockTTL) { 1, true, 3, - createExecutorService(WRITE_BUFFER_SIZE)); + executorService); } TwoPhaseCommitter(