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

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

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

Instance.getFirstRunning介绍

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

代码示例

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

@Override
public boolean evaluate(Instance obj) {
  return obj.getFirstRunning() != null;
}

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

@Override
public HandlerResult handle(ProcessState state, ProcessInstance process) {
  Date running = ((Instance) state.getResource()).getFirstRunning();
  return new HandlerResult(INSTANCE.FIRST_RUNNING, running == null ? new Date() : running);
}

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

protected void handleReconnecting(ProcessState state, Instance instance) {
  boolean reconnecting = false;
  InstanceHealthCheck healthCheck = DataAccessor.field(instance,
      InstanceConstants.FIELD_HEALTH_CHECK, jsonMapper, InstanceHealthCheck.class);
  for (InstanceHostMap map : mapDao.findNonRemoved(InstanceHostMap.class, Instance.class, instance.getId())) {
    Host host = objectManager.loadResource(Host.class, map.getHostId());
    Agent agent = host == null ? null : objectManager.loadResource(Agent.class, host.getAgentId());
    if (agent != null && (AgentConstants.STATE_RECONNECTING.equals(agent.getState()) ||
        AgentConstants.STATE_DISCONNECTED.equals(agent.getState()))) {
      reconnecting = true;
    } else {
      reconnecting = false;
      break;
    }
  }
  if (reconnecting && (healthCheck != null || instance.getFirstRunning() == null)) {
    getObjectProcessManager().scheduleProcessInstance(InstanceConstants.PROCESS_STOP, instance,
        CollectionUtils.asMap(InstanceConstants.REMOVE_OPTION, true));
  }
}

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

@Override
public Instance findOneInstanceForService(long serviceId) {
  Instance last = null;
  List<? extends Instance> instances = create()
      .select(INSTANCE.fields())
      .from(INSTANCE)
      .join(SERVICE_EXPOSE_MAP)
        .on(SERVICE_EXPOSE_MAP.INSTANCE_ID.eq(INSTANCE.ID))
      .where(INSTANCE.REMOVED.isNull()
          .and(SERVICE_EXPOSE_MAP.SERVICE_ID.eq(serviceId))
          .and(SERVICE_EXPOSE_MAP.REMOVED.isNull()))
      .orderBy(INSTANCE.CREATED.desc())
      .fetchInto(InstanceRecord.class);
  for (Instance instance : instances) {
    last = instance;
    if (last.getFirstRunning() != null) {
      return last;
    }
  }
  return last;
}

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

setAgentId(from.getAgentId());
setDomain(from.getDomain());
setFirstRunning(from.getFirstRunning());
setToken(from.getToken());
setUserdata(from.getUserdata());

相关文章