12
12
package kafka .log .streamaspect
13
13
14
14
import com .automq .stream .api .Client
15
- import com .automq .stream .utils .FutureUtil
15
+ import com .automq .stream .utils .{ FutureUtil , Threads }
16
16
import kafka .cluster .PartitionSnapshot
17
17
import kafka .log ._
18
18
import kafka .log .streamaspect .ElasticUnifiedLog .{CheckpointExecutor , MaxCheckpointIntervalBytes , MinCheckpointIntervalMs }
@@ -21,7 +21,7 @@ import kafka.utils.Logging
21
21
import org .apache .kafka .common .errors .OffsetOutOfRangeException
22
22
import org .apache .kafka .common .errors .s3 .StreamFencedException
23
23
import org .apache .kafka .common .record .{MemoryRecords , RecordVersion }
24
- import org .apache .kafka .common .utils .{ ThreadUtils , Time }
24
+ import org .apache .kafka .common .utils .Time
25
25
import org .apache .kafka .common .{TopicPartition , Uuid }
26
26
import org .apache .kafka .server .common .{MetadataVersion , OffsetAndEpoch }
27
27
import org .apache .kafka .server .util .Scheduler
@@ -33,7 +33,7 @@ import java.nio.ByteBuffer
33
33
import java .nio .file .Path
34
34
import java .util
35
35
import java .util .concurrent .atomic .LongAdder
36
- import java .util .concurrent .{CompletableFuture , ConcurrentHashMap , CopyOnWriteArrayList , Executors }
36
+ import java .util .concurrent .{CompletableFuture , ConcurrentHashMap , CopyOnWriteArrayList }
37
37
import scala .jdk .CollectionConverters .CollectionHasAsScala
38
38
import scala .util .{Failure , Success , Try }
39
39
@@ -291,8 +291,10 @@ class ElasticUnifiedLog(_logStartOffset: Long,
291
291
}
292
292
293
293
object ElasticUnifiedLog extends Logging {
294
- private val CheckpointExecutor = Executors .newSingleThreadScheduledExecutor(ThreadUtils .createThreadFactory(" checkpoint-executor" , true ))
295
- private val MaxCheckpointIntervalBytes = 50 * 1024 * 1024
294
+ private val CheckpointExecutor = {
295
+ Threads .newSingleThreadScheduledExecutor(" checkpoint-executor" , true , logger.underlying)
296
+ }
297
+ private val MaxCheckpointIntervalBytes = 50 * 1024 * 1024
296
298
private val MinCheckpointIntervalMs = 10 * 1000
297
299
private val Logs = new ConcurrentHashMap [TopicPartition , ElasticUnifiedLog ]()
298
300
// fuzzy dirty bytes for checkpoint, it's ok not thread safe
0 commit comments