io.cattle.platform.core.model.Instance.getHealthUpdated()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(189)

本文整理了Java中io.cattle.platform.core.model.Instance.getHealthUpdated()方法的一些代码示例,展示了Instance.getHealthUpdated()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instance.getHealthUpdated()方法的具体详情如下:
包路径:io.cattle.platform.core.model.Instance
类名称:Instance
方法名:getHealthUpdated

Instance.getHealthUpdated介绍

[英]Getter for cattle.instance.health_updated.
[中]cattle.instance.health_updated的Getter。

代码示例

代码示例来源:origin: rancher/cattle

protected boolean needToRemove(Instance instance) {
  boolean remove = false;
  InstanceHealthCheck healthCheck = DataAccessor.field(instance,
      InstanceConstants.FIELD_HEALTH_CHECK, jsonMapper, InstanceHealthCheck.class);
  if(healthCheck.getStrategy() == Strategy.none) {
      return remove;
  }
  Integer timeout;
  if (instance.getHealthState().equalsIgnoreCase(HealthcheckConstants.HEALTH_STATE_INITIALIZING)) {
    timeout = healthCheck.getInitializingTimeout();
  } else {
    timeout = healthCheck.getReinitializingTimeout();
  }
  
  if (timeout != null && instance.getHealthUpdated() != null) {
    long createdTimeAgo = System.currentTimeMillis() - instance.getHealthUpdated().getTime();
    if (createdTimeAgo >= timeout) {
      remove = true;
    }
  }
  return remove;
}

代码示例来源:origin: rancher/cattle

setDeploymentUnitUuid(from.getDeploymentUnitUuid());
setVersion(from.getVersion());
setHealthUpdated(from.getHealthUpdated());
setServiceIndexId(from.getServiceIndexId());
setDnsInternal(from.getDnsInternal());

相关文章