Skip to content

Commit

Permalink
update log
Browse files Browse the repository at this point in the history
  • Loading branch information
Hisoka-X committed Apr 20, 2023
1 parent aa04f9e commit 93c2b9c
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,14 @@ public SeaTunnelServer(@NonNull SeaTunnelConfig seaTunnelConfig) {
/** Lazy load for Slot Service */
public SlotService getSlotService() {
if (slotService == null) {
LOGGER.info("prepare init slotService");
synchronized (this) {
if (slotService == null) {
LOGGER.info("start init slotService");
SlotService service =
new DefaultSlotService(
nodeEngine,
taskExecutionService,
seaTunnelConfig.getEngineConfig().getSlotServiceConfig());
service.init();
LOGGER.info("init slotService finished");
slotService = service;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,8 @@ public class SyncWorkerProfileOperation extends Operation implements IdentifiedD

@Override
public void run() throws Exception {
log.info("start SyncWorkerProfileOperation run");
SeaTunnelServer server = getService();
log.info("SyncWorkerProfileOperation get server success");
result = server.getSlotService().getWorkerProfile();
log.info("end SyncWorkerProfileOperation run");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public DefaultSlotService(

@Override
public void init() {
LOGGER.info("start init defaultSlotService 1");
initStatus = true;
slotServiceSequence = UUID.randomUUID().toString();
contexts = new ConcurrentHashMap<>();
Expand All @@ -96,7 +95,6 @@ public void init() {
if (!config.isDynamicSlot()) {
initFixedSlots();
}
LOGGER.info("start init defaultSlotService 2");
unassignedResource.set(getNodeResource());
scheduledExecutorService.scheduleAtFixedRate(
() -> {
Expand All @@ -114,7 +112,6 @@ public void init() {
0,
DEFAULT_HEARTBEAT_TIMEOUT,
TimeUnit.MILLISECONDS);
LOGGER.info("init defaultSlotService end");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
package org.apache.seatunnel.engine.server;

import org.apache.seatunnel.common.utils.ExceptionUtils;
import org.apache.seatunnel.engine.common.config.ConfigProvider;
import org.apache.seatunnel.engine.common.config.SeaTunnelConfig;

import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.TestInstance;

import com.hazelcast.config.Config;
import com.hazelcast.instance.impl.HazelcastInstanceImpl;
import com.hazelcast.logging.ILogger;
import com.hazelcast.spi.impl.NodeEngine;
Expand All @@ -43,9 +46,38 @@ public abstract class AbstractSeaTunnelServerTest<T extends AbstractSeaTunnelSer
@BeforeAll
public void before() {
String name = ((T) this).getClass().getName();
instance =
SeaTunnelServerStarter.createHazelcastInstance(
TestUtils.getClusterName("AbstractSeaTunnelServerTest_" + name));
String yaml =
"hazelcast:\n"
+ " cluster-name: seatunnel\n"
+ " network:\n"
+ " rest-api:\n"
+ " enabled: true\n"
+ " endpoint-groups:\n"
+ " CLUSTER_WRITE:\n"
+ " enabled: true\n"
+ " join:\n"
+ " tcp-ip:\n"
+ " enabled: true\n"
+ " member-list:\n"
+ " - localhost\n"
+ " port:\n"
+ " auto-increment: true\n"
+ " port-count: 100\n"
+ " port: 5801\n"
+ "\n"
+ " properties:\n"
+ " hazelcast.invocation.max.retry.count: 200\n"
+ " hazelcast.tcp.join.port.try.count: 30\n"
+ " hazelcast.invocation.retry.pause.millis: 2000\n"
+ " hazelcast.slow.operation.detector.stacktrace.logging.enabled: true\n"
+ " hazelcast.logging.type: log4j2\n"
+ " hazelcast.operation.generic.thread.count: 200\n";
Config hazelcastConfig = Config.loadFromString(yaml);
hazelcastConfig.setClusterName(
TestUtils.getClusterName("AbstractSeaTunnelServerTest_" + name));
SeaTunnelConfig seaTunnelConfig = ConfigProvider.locateAndGetSeaTunnelConfig();
seaTunnelConfig.setHazelcastConfig(hazelcastConfig);
instance = SeaTunnelServerStarter.createHazelcastInstance(seaTunnelConfig);
nodeEngine = instance.node.nodeEngine;
server = nodeEngine.getService(SeaTunnelServer.SERVICE_NAME);
LOGGER = nodeEngine.getLogger(AbstractSeaTunnelServerTest.class);
Expand Down

0 comments on commit 93c2b9c

Please sign in to comment.