use of org.apache.servicecomb.foundation.common.concurrency.SuppressedRunnableWrapper in project java-chassis by ServiceComb.
the class RemoteServiceRegistry method run.
@Override
public void run() {
super.run();
taskPool.scheduleAtFixedRate(serviceCenterTask, serviceRegistryConfig.getHeartbeatInterval(), serviceRegistryConfig.getHeartbeatInterval(), TimeUnit.SECONDS);
taskPool.scheduleAtFixedRate(new SuppressedRunnableWrapper(() -> {
if (!heartBeatStatus.get()) {
LOGGER.warn("heart beat currently not success, pause for pulling instance.");
return;
}
serviceRegistryCache.refreshCache();
}), serviceRegistryConfig.getInstancePullInterval(), serviceRegistryConfig.getInstancePullInterval(), TimeUnit.SECONDS);
for (ServiceRegistryTaskInitializer initializer : taskInitializers) {
initializer.init(this);
}
}
use of org.apache.servicecomb.foundation.common.concurrency.SuppressedRunnableWrapper in project java-chassis by ServiceComb.
the class ServiceCenterRegistration method updateMicroserviceInstanceStatus.
@Override
public boolean updateMicroserviceInstanceStatus(MicroserviceInstanceStatus status) {
RegistryUtils.executeOnEachServiceRegistry(sr -> new SuppressedRunnableWrapper(() -> {
MicroserviceInstance selfInstance = sr.getMicroserviceInstance();
sr.getServiceRegistryClient().updateMicroserviceInstanceStatus(selfInstance.getServiceId(), selfInstance.getInstanceId(), status);
}).run());
return true;
}
use of org.apache.servicecomb.foundation.common.concurrency.SuppressedRunnableWrapper in project incubator-servicecomb-java-chassis by apache.
the class RemoteServiceRegistry method run.
@Override
public void run() {
super.run();
taskPool.scheduleAtFixedRate(serviceCenterTask, serviceRegistryConfig.getHeartbeatInterval(), serviceRegistryConfig.getHeartbeatInterval(), TimeUnit.SECONDS);
taskPool.scheduleAtFixedRate(new SuppressedRunnableWrapper(() -> {
if (!heartBeatStatus.get()) {
LOGGER.warn("heart beat currently not success, pause for pulling instance.");
return;
}
serviceRegistryCache.refreshCache();
}), serviceRegistryConfig.getInstancePullInterval(), serviceRegistryConfig.getInstancePullInterval(), TimeUnit.SECONDS);
for (ServiceRegistryTaskInitializer initializer : taskInitializers) {
initializer.init(this);
}
}
use of org.apache.servicecomb.foundation.common.concurrency.SuppressedRunnableWrapper in project incubator-servicecomb-java-chassis by apache.
the class ServiceCenterRegistration method updateMicroserviceInstanceStatus.
@Override
public boolean updateMicroserviceInstanceStatus(MicroserviceInstanceStatus status) {
RegistryUtils.executeOnEachServiceRegistry(sr -> new SuppressedRunnableWrapper(() -> {
MicroserviceInstance selfInstance = sr.getMicroserviceInstance();
sr.getServiceRegistryClient().updateMicroserviceInstanceStatus(selfInstance.getServiceId(), selfInstance.getInstanceId(), status);
}).run());
return true;
}
Aggregations