use of com.navercorp.pinpoint.common.server.cluster.zookeeper.CuratorZookeeperClient in project pinpoint by naver.
the class FlinkServerRegister method start.
@PostConstruct
public void start() throws Exception {
if (clusterEnable == false) {
logger.info("pinpoint flink cluster disable.");
return;
}
this.timer = createTimer();
this.client = new CuratorZookeeperClient(connectAddress, sessionTimeout, this);
this.client.connect();
registerFlinkNode();
}
use of com.navercorp.pinpoint.common.server.cluster.zookeeper.CuratorZookeeperClient in project pinpoint by naver.
the class ZookeeperClusterService method setUp.
@Override
public void setUp() {
logger.info("pinpoint-collector cluster setUp");
switch(this.serviceState.getCurrentState()) {
case NEW:
if (this.serviceState.changeStateInitializing()) {
logger.info("{} initialization started.", this.getClass().getSimpleName());
ClusterManagerWatcher watcher = new ClusterManagerWatcher();
this.client = new CuratorZookeeperClient(config.getClusterAddress(), config.getClusterSessionTimeout(), watcher);
try {
this.client.connect();
} catch (PinpointZookeeperException e) {
throw new RuntimeException("ZookeeperClient connect failed", e);
}
final String connectedAgentZNodePath = ZKPaths.makePath(config.getCollectorZNodePath(), serverIdentifier);
this.profilerClusterManager = new ZookeeperProfilerClusterManager(client, connectedAgentZNodePath, clusterPointRouter.getTargetClusterPointRepository());
this.profilerClusterManager.start();
this.webClusterManager = new ZookeeperClusterManager(client, webZNodePath, clusterConnectionManager);
this.webClusterManager.start();
this.serviceState.changeStateStarted();
logger.info("{} initialization completed.", this.getClass().getSimpleName());
if (client.isConnected()) {
watcher.handleConnected();
}
}
break;
case INITIALIZING:
logger.info("{} already initializing.", this.getClass().getSimpleName());
break;
case STARTED:
logger.info("{} already started.", this.getClass().getSimpleName());
break;
case DESTROYING:
throw new IllegalStateException("Already destroying.");
case STOPPED:
throw new IllegalStateException("Already stopped.");
case ILLEGAL_STATE:
throw new IllegalStateException("Invalid State.");
}
}
use of com.navercorp.pinpoint.common.server.cluster.zookeeper.CuratorZookeeperClient in project pinpoint by naver.
the class FlinkClusterService method setUp.
@PostConstruct
public void setUp() {
if (!config.isFlinkClusterEnable()) {
logger.info("flink cluster disable.");
return;
}
switch(this.serviceState.getCurrentState()) {
case NEW:
if (this.serviceState.changeStateInitializing()) {
logger.info("{} initialization started.", this.getClass().getSimpleName());
ClusterManagerWatcher watcher = new ClusterManagerWatcher(pinpointFlinkClusterPath);
this.client = new CuratorZookeeperClient(config.getFlinkClusterZookeeperAddress(), config.getFlinkClusterSessionTimeout(), watcher);
try {
this.client.connect();
} catch (PinpointZookeeperException e) {
throw new RuntimeException("ZookeeperClient connect failed", e);
}
this.zookeeperClusterManager = new ZookeeperClusterManager(client, pinpointFlinkClusterPath, clusterConnectionManager);
this.zookeeperClusterManager.start();
this.serviceState.changeStateStarted();
logger.info("{} initialization completed.", this.getClass().getSimpleName());
if (client.isConnected()) {
watcher.handleConnected();
}
}
break;
case INITIALIZING:
logger.info("{} already initializing.", this.getClass().getSimpleName());
break;
case STARTED:
logger.info("{} already started.", this.getClass().getSimpleName());
break;
case DESTROYING:
throw new IllegalStateException("Already destroying.");
case STOPPED:
throw new IllegalStateException("Already stopped.");
case ILLEGAL_STATE:
throw new IllegalStateException("Invalid State.");
}
}
use of com.navercorp.pinpoint.common.server.cluster.zookeeper.CuratorZookeeperClient in project pinpoint by naver.
the class ZookeeperClusterDataManager method start.
@Override
public void start() {
this.timer = createTimer();
this.client = new CuratorZookeeperClient(connectAddress, sessionTimeout, this);
try {
this.client.connect();
} catch (PinpointZookeeperException e) {
throw new RuntimeException("ZookeeperClient connect failed", e);
}
if (periodicSyncTask != null) {
this.timer.newTimeout(periodicSyncTask, periodicSyncTask.getIntervalMillis(), TimeUnit.MILLISECONDS);
}
}
Aggregations