hudson.model.Label.getClouds()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(91)

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

Label.getClouds介绍

[英]Gets all Clouds that can launch for this label.
[中]

代码示例

代码示例来源:origin: jenkinsci/jenkins

/**
 * If there's no such label defined in {@link Node} or {@link Cloud}.
 * This is usually used as a signal that this label is invalid.
 */
public boolean isEmpty() {
  return getNodes().isEmpty() && getClouds().isEmpty();
}

代码示例来源:origin: jenkinsci/jenkins

/**
 * Can jobs be assigned to this label?
 * <p>
 * The answer is yes if there is a reasonable basis to believe that Hudson can have
 * an executor under this label, given the current configuration. This includes
 * situations such as (1) there are offline agents that have this label (2) clouds exist
 * that can provision agents that have this label.
 */
public boolean isAssignable() {
  for (Node n : getNodes())
    if(n.getNumExecutors()>0)
      return true;
  return !getClouds().isEmpty();
}

代码示例来源:origin: jenkinsci/jenkins

/**
 * Returns a human readable text that explains this label.
 */
@Exported
public String getDescription() {
  Set<Node> nodes = getNodes();
  if(nodes.isEmpty()) {
    Set<Cloud> clouds = getClouds();
    if(clouds.isEmpty())
      return Messages.Label_InvalidLabel();
    return Messages.Label_ProvisionedFrom(toString(clouds));
  }
  if(nodes.size()==1)
    return nodes.iterator().next().getNodeDescription();
  return Messages.Label_GroupOf(toString(nodes));
}

代码示例来源:origin: jenkinsci/jenkins

private WorkspaceOfflineReason workspaceOffline(R build) throws IOException, InterruptedException {
  FilePath ws = build.getWorkspace();
  Label label = getAssignedLabel();
  if (isAllSuitableNodesOffline(build)) {
    Collection<Cloud> applicableClouds = label == null ? Jenkins.getInstance().clouds : label.getClouds();
    return applicableClouds.isEmpty() ? WorkspaceOfflineReason.all_suitable_nodes_are_offline : WorkspaceOfflineReason.use_ondemand_slave;
  }
  if (ws==null || !ws.exists()) {
    return WorkspaceOfflineReason.nonexisting_workspace;
  }
  Node builtOn = build.getBuiltOn();
  if (builtOn == null) { // node built-on doesn't exist anymore
    return WorkspaceOfflineReason.builton_node_gone;
  }
  if (builtOn.toComputer() == null) { // node still exists, but has 0 executors - o.s.l.t.
    return WorkspaceOfflineReason.builton_node_no_executors;
  }
  return null;
}

代码示例来源:origin: jenkinsci/jenkins

j.getRootUrl(), Util.escape(l.getName()), l.getUrl(), l.getNodes().size(), l.getClouds().size())
);

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * If there's no such label defined in {@link Node} or {@link Cloud}.
 * This is usually used as a signal that this label is invalid.
 */
public boolean isEmpty() {
  return getNodes().isEmpty() && getClouds().isEmpty();
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * If there's no such label defined in {@link Node} or {@link Cloud}.
 * This is usually used as a signal that this label is invalid.
 */
public boolean isEmpty() {
  return getNodes().isEmpty() && getClouds().isEmpty();
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * If there's no such label defined in {@link Node} or {@link Cloud}.
 * This is usually used as a signal that this label is invalid.
 */
public boolean isEmpty() {
  return getNodes().isEmpty() && getClouds().isEmpty();
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * If there's no such label defined in {@link Node} or {@link Cloud}.
 * This is usually used as a signal that this label is invalid.
 */
public boolean isEmpty() {
  return getNodes().isEmpty() && getClouds().isEmpty();
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * If there's no such label defined in {@link Node} or {@link Cloud}. This
 * is usually used as a signal that this label is invalid.
 */
public boolean isEmpty() {
  return getNodes().isEmpty() && getClouds().isEmpty();
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Can jobs be assigned to this label?
 * <p>
 * The answer is yes if there is a reasonable basis to believe that Hudson can have
 * an executor under this label, given the current configuration. This includes
 * situations such as (1) there are offline slaves that have this label (2) clouds exist
 * that can provision slaves that have this label.
 */
public boolean isAssignable() {
  for (Node n : getNodes())
    if(n.getNumExecutors()>0)
      return true;
  return !getClouds().isEmpty();
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * Can jobs be assigned to this label?
 * <p>
 * The answer is yes if there is a reasonable basis to believe that Hudson can have
 * an executor under this label, given the current configuration. This includes
 * situations such as (1) there are offline agents that have this label (2) clouds exist
 * that can provision agents that have this label.
 */
public boolean isAssignable() {
  for (Node n : getNodes())
    if(n.getNumExecutors()>0)
      return true;
  return !getClouds().isEmpty();
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Can jobs be assigned to this label?
 * <p>
 * The answer is yes if there is a reasonable basis to believe that Hudson can have
 * an executor under this label, given the current configuration. This includes
 * situations such as (1) there are offline slaves that have this label (2) clouds exist
 * that can provision slaves that have this label.
 */
public boolean isAssignable() {
  for (Node n : getNodes())
    if(n.getNumExecutors()>0)
      return true;
  return !getClouds().isEmpty();
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Can jobs be assigned to this label?
 * <p>
 * The answer is yes if there is a reasonable basis to believe that Hudson can have
 * an executor under this label, given the current configuration. This includes
 * situations such as (1) there are offline slaves that have this label (2) clouds exist
 * that can provision slaves that have this label.
 */
public boolean isAssignable() {
  for (Node n : getNodes())
    if(n.getNumExecutors()>0)
      return true;
  return !getClouds().isEmpty();
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Can jobs be assigned to this label? <p> The answer is yes if there is a
 * reasonable basis to believe that Hudson can have an executor under this
 * label, given the current configuration. This includes situations such as
 * (1) there are offline slaves that have this label (2) clouds exist that
 * can provision slaves that have this label.
 */
public boolean isAssignable() {
  for (Node n : getNodes()) {
    if (n.getNumExecutors() > 0) {
      return true;
    }
  }
  return !getClouds().isEmpty();
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * Returns a human readable text that explains this label.
 */
@Exported
public String getDescription() {
  Set<Node> nodes = getNodes();
  if(nodes.isEmpty()) {
    Set<Cloud> clouds = getClouds();
    if(clouds.isEmpty())
      return Messages.Label_InvalidLabel();
    return Messages.Label_ProvisionedFrom(toString(clouds));
  }
  if(nodes.size()==1)
    return nodes.iterator().next().getNodeDescription();
  return Messages.Label_GroupOf(toString(nodes));
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Returns a human readable text that explains this label.
 */
@Exported
public String getDescription() {
  Set<Node> nodes = getNodes();
  if(nodes.isEmpty()) {
    Set<Cloud> clouds = getClouds();
    if(clouds.isEmpty())
      return Messages.Label_InvalidLabel();
    return Messages.Label_ProvisionedFrom(toString(clouds));
  }
  if(nodes.size()==1)
    return nodes.iterator().next().getNodeDescription();
  return Messages.Label_GroupOf(toString(nodes));
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Returns a human readable text that explains this label.
 */
@Exported
public String getDescription() {
  Set<Node> nodes = getNodes();
  if(nodes.isEmpty()) {
    Set<Cloud> clouds = getClouds();
    if(clouds.isEmpty())
      return Messages.Label_InvalidLabel();
    return Messages.Label_ProvisionedFrom(toString(clouds));
  }
  if(nodes.size()==1)
    return nodes.iterator().next().getNodeDescription();
  return Messages.Label_GroupOf(toString(nodes));
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Returns a human readable text that explains this label.
 */
@Exported
public String getDescription() {
  Set<Node> nodes = getNodes();
  if(nodes.isEmpty()) {
    Set<Cloud> clouds = getClouds();
    if(clouds.isEmpty())
      return Messages.Label_InvalidLabel();
    return Messages.Label_ProvisionedFrom(toString(clouds));
  }
  if(nodes.size()==1)
    return nodes.iterator().next().getNodeDescription();
  return Messages.Label_GroupOf(toString(nodes));
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Returns a human readable text that explains this label.
 */
@Exported
public String getDescription() {
  Set<Node> nodes = getNodes();
  if (nodes.isEmpty()) {
    Set<Cloud> clouds = getClouds();
    if (clouds.isEmpty()) {
      return Messages.Label_InvalidLabel();
    }
    return Messages.Label_ProvisionedFrom(toString(clouds));
  }
  if (nodes.size() == 1) {
    return nodes.iterator().next().getNodeDescription();
  }
  return Messages.Label_GroupOf(toString(nodes));
}

相关文章