本文整理汇总了Java中hudson.slaves.AbstractCloudComputer类的典型用法代码示例。如果您正苦于以下问题:Java AbstractCloudComputer类的具体用法?Java AbstractCloudComputer怎么用?Java AbstractCloudComputer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AbstractCloudComputer类属于hudson.slaves包,在下文中一共展示了AbstractCloudComputer类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: check
import hudson.slaves.AbstractCloudComputer; //导入依赖的package包/类
/**
* 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;
}
开发者ID:KostyaSha,项目名称:yet-another-docker-plugin,代码行数:21,代码来源:DockerCloudRetentionStrategy.java
示例2: check
import hudson.slaves.AbstractCloudComputer; //导入依赖的package包/类
@Override
@GuardedBy("hudson.model.Queue.lock")
public long check(final AbstractCloudComputer acc) {
// When the slave is idle we should disable accepting tasks and check to see if it is already trying to
// terminate. If it's not already trying to terminate then lets terminate manually.
if (acc.isIdle() && !disabled) {
final long idleMilliseconds = System.currentTimeMillis() - acc.getIdleStartMilliseconds();
if (idleMilliseconds > TimeUnit2.MINUTES.toMillis(idleMinutes)) {
LOG.debug("Disconnecting {}", acc.getName());
done(acc);
}
}
// Return one because we want to check every minute if idle.
return 1;
}
开发者ID:KostyaSha,项目名称:yet-another-docker-plugin,代码行数:17,代码来源:DockerOnceRetentionStrategy.java
示例3: done
import hudson.slaves.AbstractCloudComputer; //导入依赖的package包/类
protected void done(Executor executor) {
final AbstractCloudComputer<?> c = (AbstractCloudComputer) executor.getOwner();
Queue.Executable exec = executor.getCurrentExecutable();
if (executor instanceof OneOffExecutor) {
LOG.debug("Not terminating {} because {} was a flyweight task", c.getName(), exec);
return;
}
if (exec instanceof ContinuableExecutable && ((ContinuableExecutable) exec).willContinue()) {
LOG.debug("not terminating {} because {} says it will be continued", c.getName(), exec);
return;
}
LOG.debug("terminating {} since {} seems to be finished", c.getName(), exec);
done(c);
}
开发者ID:KostyaSha,项目名称:yet-another-docker-plugin,代码行数:17,代码来源:DockerOnceRetentionStrategy.java
示例4: getIdFor
import hudson.slaves.AbstractCloudComputer; //导入依赖的package包/类
private static @CheckForNull ProvisioningActivity.Id getIdFor(Computer computer) {
if (computer instanceof Jenkins.MasterComputer) return null;
if (!(computer instanceof AbstractCloudComputer)) return null;
if (!(computer instanceof TrackedItem)) {
logTypeNotSupported(computer.getClass());
return null;
}
return ((TrackedItem) computer).getId();
}
开发者ID:jenkinsci,项目名称:cloud-stats-plugin,代码行数:12,代码来源:CloudStatistics.java
示例5: start
import hudson.slaves.AbstractCloudComputer; //导入依赖的package包/类
@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);
}
开发者ID:KostyaSha,项目名称:yet-another-docker-plugin,代码行数:8,代码来源:DockerOnceRetentionStrategy.java
示例6: createComputer
import hudson.slaves.AbstractCloudComputer; //导入依赖的package包/类
@Override
public AbstractCloudComputer createComputer() {
return new TrackedComputer(this, id);
}
开发者ID:jenkinsci,项目名称:cloud-stats-plugin,代码行数:5,代码来源:CloudStatisticsTest.java
示例7: createComputer
import hudson.slaves.AbstractCloudComputer; //导入依赖的package包/类
@Override
public AbstractCloudComputer createComputer()
{
return new ParallelsDesktopVMSlaveComputer(this);
}
开发者ID:Parallels,项目名称:jenkins-parallels,代码行数:6,代码来源:ParallelsDesktopVMSlave.java
示例8: createComputer
import hudson.slaves.AbstractCloudComputer; //导入依赖的package包/类
@Override
public AbstractCloudComputer createComputer()
{
return new ParallelsDesktopConnectorSlaveComputer(this);
}
开发者ID:Parallels,项目名称:jenkins-parallels,代码行数:6,代码来源:ParallelsDesktopConnectorSlave.java
示例9: createComputer
import hudson.slaves.AbstractCloudComputer; //导入依赖的package包/类
@Override
public AbstractCloudComputer createComputer() {
return new ECSComputer(this);
}
开发者ID:cloudbees,项目名称:amazon-ecs-plugin,代码行数:5,代码来源:ECSSlave.java
示例10: createComputer
import hudson.slaves.AbstractCloudComputer; //导入依赖的package包/类
@Override
public AbstractCloudComputer createComputer() {
return new DockerComputerSingle(this, activityId);
}
开发者ID:KostyaSha,项目名称:yet-another-docker-plugin,代码行数:5,代码来源:DockerSlaveSingle.java
示例11: start
import hudson.slaves.AbstractCloudComputer; //导入依赖的package包/类
/**
* Try to connect to it ASAP.
*/
@Override
public void start(AbstractCloudComputer c) {
c.connect(false);
}
开发者ID:KostyaSha,项目名称:yet-another-docker-plugin,代码行数:8,代码来源:DockerCloudRetentionStrategy.java
注:本文中的hudson.slaves.AbstractCloudComputer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论