JingsongLi commented on code in PR #1823:
URL: https://github.com/apache/incubator-paimon/pull/1823#discussion_r1296887103
##########
paimon-core/src/main/java/org/apache/paimon/AbstractFileStore.java:
##########
@@ -230,4 +234,10 @@ public TagAutoCreation newTagCreationManager() {
return TagAutoCreation.create(
options, snapshotManager(), newTagManager(), newTagDeletion());
}
+
+ protected ExecutorService createIoExecutor() {
+ return Executors.newFixedThreadPool(
+ options.snapshotExpireIoThreadPoolSize(),
+ new ExecutorThreadFactory("expire-thread"));
Review Comment:
`Thread.currentThread().getName() + "-expire-thread"`
##########
paimon-core/src/main/java/org/apache/paimon/utils/DirectExecutorService.java:
##########
@@ -0,0 +1,268 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.utils;
+
+import javax.annotation.Nonnull;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.Callable;
+import java.util.concurrent.CancellationException;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+/**
+ * The direct executor service directly executes the runnables and the
callables in the calling
+ * thread.
+ *
+ * <p>Copy from Flink.
+ */
+public class DirectExecutorService implements ExecutorService {
Review Comment:
Just use `MoreExecutors.directExecutor()`?
##########
paimon-core/src/main/java/org/apache/paimon/operation/FileDeletionBase.java:
##########
@@ -64,6 +67,7 @@ public abstract class FileDeletionBase {
protected final ManifestList manifestList;
protected final IndexFileHandler indexFileHandler;
protected final Map<BinaryRow, Set<Integer>> deletionBuckets;
+ protected final DirectExecutorService directIoExecutor;
Review Comment:
If you use `MoreExecutors.directExecutor()`, it don't need to be a class
field.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]