use of com.vip.saturn.job.internal.storage.JobNodeStorage in project Saturn by vipshop.
the class SaturnAutoBasic method updateJobConfig.
protected static void updateJobConfig(JobConfiguration jobConfiguration, String configKey, Object configValue) {
JobNodeStorage jobNodeStorage = new JobNodeStorage(regCenter, jobConfiguration);
jobNodeStorage.updateJobNode("config/" + configKey, configValue);
}
use of com.vip.saturn.job.internal.storage.JobNodeStorage in project Saturn by vipshop.
the class LeaderElectionService method shutdown.
@Override
public void shutdown() {
synchronized (isShutdown) {
if (isShutdown.compareAndSet(false, true)) {
try {
// Release my leader position
JobNodeStorage jobNodeStorage = getJobNodeStorage();
if (jobNodeStorage.isConnected() && executorName.equals(jobNodeStorage.getJobNodeDataDirectly(ElectionNode.LEADER_HOST))) {
jobNodeStorage.removeJobNodeIfExisted(ElectionNode.LEADER_HOST);
LogUtils.info(log, jobName, "{} that was {}'s leader, released itself", executorName, jobName);
}
} catch (Throwable t) {
LogUtils.error(log, jobName, t.getMessage(), t);
}
}
}
}
Aggregations