Skip to content

Commit

Permalink
[Improve][Zeta] Make sure the local mode CompletableFuture behavior s…
Browse files Browse the repository at this point in the history
…ame as server mode (#8476)
  • Loading branch information
Hisoka-X authored Jan 9, 2025
1 parent 55eebfa commit 39d7a40
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.apache.seatunnel.engine.common.config.SeaTunnelConfig;
import org.apache.seatunnel.engine.common.exception.SeaTunnelEngineException;
import org.apache.seatunnel.engine.common.runtime.ExecutionMode;
import org.apache.seatunnel.engine.common.utils.concurrent.CompletableFuture;
import org.apache.seatunnel.engine.core.job.JobResult;
import org.apache.seatunnel.engine.core.job.JobStatus;
import org.apache.seatunnel.engine.server.SeaTunnelNodeContext;
Expand All @@ -47,6 +48,7 @@
import com.hazelcast.client.config.ClientConfig;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.instance.impl.HazelcastInstanceFactory;
import com.hazelcast.internal.util.ConcurrencyUtil;
import lombok.extern.slf4j.Slf4j;

import java.nio.file.Path;
Expand All @@ -55,7 +57,6 @@
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -276,6 +277,10 @@ private HazelcastInstance createServerInLocal(
// set local mode
seaTunnelConfig.getEngineConfig().setMode(ExecutionMode.LOCAL);
seaTunnelConfig.getHazelcastConfig().getNetworkConfig().setPortAutoIncrement(true);

// set the default async executor for Hazelcast InvocationFuture
ConcurrencyUtil.setDefaultAsyncExecutor(CompletableFuture.EXECUTOR);

return HazelcastInstanceFactory.newHazelcastInstance(
seaTunnelConfig.getHazelcastConfig(),
Thread.currentThread().getName(),
Expand Down

0 comments on commit 39d7a40

Please sign in to comment.