hudson.slaves.AbstractCloudComputer.getNode()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(88)

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

AbstractCloudComputer.getNode介绍

暂无

代码示例

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

@Override
@GuardedBy("hudson.model.Queue.lock")
public long check(final AbstractCloudComputer c) {
  final AbstractCloudSlave computerNode = c.getNode();
  if (c.isIdle() && !disabled && computerNode != null) {
    final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds();
    if (idleMilliseconds > MINUTES.toMillis(idleMinutes)) {
      LOGGER.log(Level.INFO, "Disconnecting {0}", c.getName());
      try {
        computerNode.terminate();
      } catch (InterruptedException | IOException e) {
        LOGGER.log(WARNING, "Failed to terminate " + c.getName(), e);
      }
    }
  }
  return 1;
}

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

/**
   * When the agent is deleted, free the node right away.
   */
  @Override
  @RequirePOST
  public HttpResponse doDoDelete() throws IOException {
    checkPermission(DELETE);
    try {
      T node = getNode();
      if (node != null) { // No need to terminate nodes again
        node.terminate();
      }
      return new HttpRedirect("..");
    } catch (InterruptedException e) {
      return HttpResponses.error(500,e);
    }
  }
}

代码示例来源:origin: openshift/jenkins-cloud-plugin

@Override
public OpenShiftSlave getNode() {
  return (OpenShiftSlave) super.getNode();
}

代码示例来源:origin: jenkinsci/openstack-cloud-plugin

@Override
public @CheckForNull JCloudsSlave getNode() {
  return super.getNode();
}

代码示例来源:origin: KostyaSha/yet-another-docker-plugin

@Override
public void start(AbstractCloudComputer c) {
  if (c.getNode() instanceof EphemeralNode) {
    throw new IllegalStateException("May not use OnceRetentionStrategy on an EphemeralNode: " + c);
  }
  super.start(c);
}

代码示例来源:origin: jenkinsci/kubernetes-ci-plugin

@Override
  public void run() {
    try {
      AbstractCloudSlave node = computer.getNode();
      if (node != null) {
        node.terminate();
      }
    } catch (InterruptedException e) {
      LOGGER.log(Level.WARNING, "Failed to terminate " + computer.getName(), e);
    } catch (IOException e) {
      LOGGER.log(Level.WARNING, "Failed to terminate " + computer.getName(), e);
    }
  }
});

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

@Override
@GuardedBy("hudson.model.Queue.lock")
public long check(final AbstractCloudComputer c) {
  final AbstractCloudSlave computerNode = c.getNode();
  if (c.isIdle() && !disabled && computerNode != null) {
    final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds();
    if (idleMilliseconds > MINUTES.toMillis(idleMinutes)) {
      LOGGER.log(Level.INFO, "Disconnecting {0}", c.getName());
      try {
        computerNode.terminate();
      } catch (InterruptedException e) {
        LOGGER.log(WARNING, "Failed to terminate " + c.getName(), e);
      } catch (IOException e) {
        LOGGER.log(WARNING, "Failed to terminate " + c.getName(), e);
      }
    }
  }
  return 1;
}

代码示例来源:origin: KostyaSha/yet-another-docker-plugin

protected void done(final AbstractCloudComputer<?> c) {
  c.setAcceptingTasks(false); // just in case
  synchronized (this) {
    if (terminating) {
      return;
    }
    terminating = true;
  }
  final Future<?> submit = Computer.threadPoolForRemoting.submit(() -> {
      try {
        AbstractCloudSlave node = c.getNode();
        if (node != null) {
          node.terminate();
        }
      } catch (InterruptedException | IOException e) {
        LOG.warn("Failed to terminate " + c.getName(), e);
        synchronized (DockerOnceRetentionStrategy.this) {
          terminating = false;
        }
      }
    }
  );
}

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

public synchronized long check(AbstractCloudComputer c) {
  if (c.isIdle() && !disabled) {
    final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds();
    if (idleMilliseconds > MINUTES.toMillis(idleMinutes)) {
      LOGGER.info("Disconnecting " + c.getName());
      try {
        c.getNode().terminate();
      } catch (InterruptedException e) {
        LOGGER.log(WARNING, "Failed to terminate " + c.getName(), e);
      } catch (IOException e) {
        LOGGER.log(WARNING, "Failed to terminate " + c.getName(), e);
      }
    }
  }
  return 1;
}

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

public synchronized long check(AbstractCloudComputer c) {
  if (c.isIdle() && !disabled) {
    final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds();
    if (idleMilliseconds > MINUTES.toMillis(idleMinutes)) {
      LOGGER.info("Disconnecting "+c.getName());
      try {
        c.getNode().terminate();
      } catch (InterruptedException e) {
        LOGGER.log(WARNING,"Failed to terminate "+c.getName(),e);
      } catch (IOException e) {
        LOGGER.log(WARNING,"Failed to terminate "+c.getName(),e);
      }
    }
  }
  return 1;
}

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

public synchronized long check(AbstractCloudComputer c) {
  if (c.isIdle() && !disabled) {
    final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds();
    if (idleMilliseconds > MINUTES.toMillis(idleMinutes)) {
      LOGGER.info("Disconnecting "+c.getName());
      try {
        c.getNode().terminate();
      } catch (InterruptedException e) {
        LOGGER.log(WARNING,"Failed to terminate "+c.getName(),e);
      } catch (IOException e) {
        LOGGER.log(WARNING,"Failed to terminate "+c.getName(),e);
      }
    }
  }
  return 1;
}

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

public synchronized long check(AbstractCloudComputer c) {
  if (c.isIdle() && !disabled) {
    final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds();
    if (idleMilliseconds > MINUTES.toMillis(idleMinutes)) {
      LOGGER.info("Disconnecting "+c.getName());
      try {
        c.getNode().terminate();
      } catch (InterruptedException e) {
        LOGGER.log(WARNING,"Failed to terminate "+c.getName(),e);
      } catch (IOException e) {
        LOGGER.log(WARNING,"Failed to terminate "+c.getName(),e);
      }
    }
  }
  return 1;
}

代码示例来源:origin: KostyaSha/yet-another-docker-plugin

/**
 * While x-stream serialisation buggy, copy implementation.
 */
@Override
@GuardedBy("hudson.model.Queue.lock")
public long check(final AbstractCloudComputer c) {
  final AbstractCloudSlave computerNode = c.getNode();
  if (c.isIdle() && computerNode != null) {
    final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds();
    if (idleMilliseconds > MINUTES.toMillis(idleMinutes)) {
      LOG.info("Disconnecting {}, after {} min timeout.", c.getName(), idleMinutes);
      try {
        computerNode.terminate();
      } catch (InterruptedException | IOException e) {
        LOG.warn("Failed to terminate {}", c.getName(), e);
      }
    }
  }
  return 1;
}

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

/**
   * When the slave is deleted, free the node.
   */
  @Override
  public HttpResponse doDoDelete() throws IOException {
    checkPermission(DELETE);
    try {
      getNode().terminate();
      return new HttpRedirect("..");
    } catch (InterruptedException e) {
      return HttpResponses.error(500,e);
    }
  }
}

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

/**
   * When the slave is deleted, free the node.
   */
  @Override
  public HttpResponse doDoDelete() throws IOException {
    checkPermission(DELETE);
    try {
      getNode().terminate();
      return new HttpRedirect("..");
    } catch (InterruptedException e) {
      return HttpResponses.error(500, e);
    }
  }
}

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

/**
   * When the slave is deleted, free the node.
   */
  @Override
  public HttpResponse doDoDelete() throws IOException {
    checkPermission(DELETE);
    try {
      getNode().terminate();
      return new HttpRedirect("..");
    } catch (InterruptedException e) {
      return HttpResponses.error(500,e);
    }
  }
}

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

/**
   * When the slave is deleted, free the node.
   */
  @Override
  public HttpResponse doDoDelete() throws IOException {
    checkPermission(DELETE);
    try {
      getNode().terminate();
      return new HttpRedirect("..");
    } catch (InterruptedException e) {
      return HttpResponses.error(500,e);
    }
  }
}

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

/**
   * When the agent is deleted, free the node right away.
   */
  @Override
  @RequirePOST
  public HttpResponse doDoDelete() throws IOException {
    checkPermission(DELETE);
    try {
      T node = getNode();
      if (node != null) { // No need to terminate nodes again
        node.terminate();
      }
      return new HttpRedirect("..");
    } catch (InterruptedException e) {
      return HttpResponses.error(500,e);
    }
  }
}

相关文章