本文整理了Java中hudson.model.Run.getPreviousBuildInProgress
方法的一些代码示例,展示了Run.getPreviousBuildInProgress
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Run.getPreviousBuildInProgress
方法的具体详情如下:
包路径:hudson.model.Run
类名称:Run
方法名:getPreviousBuildInProgress
[英]Obtains the next younger build in progress. It uses a skip-pointer so that we can compute this without O(n) computation time. This method also fixes up the skip list as we go, in a way that's concurrency safe.
We basically follow the existing skip list, and wherever we find a non-optimal pointer, we remember them in 'fixUp' and update them later.
[中]获得下一个正在进行的年轻构建。它使用了一个跳过指针,这样我们就可以在没有O(n)计算时间的情况下进行计算。这种方法还可以在执行过程中修复跳过列表,这是一种并发安全的方式。
我们基本上遵循现有的跳过列表,无论在哪里找到非最佳指针,我们都会在“修复”中记住它们,并在以后进行更新。
代码示例来源:origin: jenkinsci/jenkins
/**
* @see CheckPoint#block()
*/
/*package*/ static void waitForCheckpoint(@Nonnull CheckPoint id, @CheckForNull BuildListener listener, @CheckForNull String waiter) throws InterruptedException {
while(true) {
Run<?,?>.RunExecution exec = RunnerStack.INSTANCE.peek();
if (exec == null) {
return;
}
Run b = exec.getBuild().getPreviousBuildInProgress();
if(b==null) return; // no pending earlier build
Run.RunExecution runner = b.runner;
if(runner==null) {
// polled at the wrong moment. try again.
Thread.sleep(0);
continue;
}
if(runner.checkpoints.waitForCheckPoint(id, listener, waiter))
return; // confirmed that the previous build reached the check point
// the previous build finished without ever reaching the check point. try again.
}
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
/**
* @see CheckPoint#block()
*/
/*package*/ static void waitForCheckpoint(@Nonnull CheckPoint id, @CheckForNull BuildListener listener, @CheckForNull String waiter) throws InterruptedException {
while(true) {
Run<?,?>.RunExecution exec = RunnerStack.INSTANCE.peek();
if (exec == null) {
return;
}
Run b = exec.getBuild().getPreviousBuildInProgress();
if(b==null) return; // no pending earlier build
Run.RunExecution runner = b.runner;
if(runner==null) {
// polled at the wrong moment. try again.
Thread.sleep(0);
continue;
}
if(runner.checkpoints.waitForCheckPoint(id, listener, waiter))
return; // confirmed that the previous build reached the check point
// the previous build finished without ever reaching the check point. try again.
}
}
代码示例来源:origin: hudson/hudson-2.x
/**
* @see CheckPoint#block()
*/
/*package*/ static void waitForCheckpoint(CheckPoint id) throws InterruptedException {
while(true) {
Run b = RunnerStack.INSTANCE.peek().getBuild().getPreviousBuildInProgress();
if(b==null) return; // no pending earlier build
Run.Runner runner = b.runner;
if(runner==null) {
// polled at the wrong moment. try again.
Thread.sleep(0);
continue;
}
if(runner.checkpoints.waitForCheckPoint(id))
return; // confirmed that the previous build reached the check point
// the previous build finished without ever reaching the check point. try again.
}
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
/**
* @see CheckPoint#block()
*/
/*package*/ static void waitForCheckpoint(CheckPoint id) throws InterruptedException {
while(true) {
Run b = RunnerStack.INSTANCE.peek().getBuild().getPreviousBuildInProgress();
if(b==null) return; // no pending earlier build
Run.Runner runner = b.runner;
if(runner==null) {
// polled at the wrong moment. try again.
Thread.sleep(0);
continue;
}
if(runner.checkpoints.waitForCheckPoint(id))
return; // confirmed that the previous build reached the check point
// the previous build finished without ever reaching the check point. try again.
}
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* @see CheckPoint#block()
*/
/*package*/ static void waitForCheckpoint(CheckPoint id) throws InterruptedException {
while(true) {
Run b = RunnerStack.INSTANCE.peek().getBuild().getPreviousBuildInProgress();
if(b==null) return; // no pending earlier build
Run.Runner runner = b.runner;
if(runner==null) {
// polled at the wrong moment. try again.
Thread.sleep(0);
continue;
}
if(runner.checkpoints.waitForCheckPoint(id))
return; // confirmed that the previous build reached the check point
// the previous build finished without ever reaching the check point. try again.
}
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
/**
* @see CheckPoint#block()
*/
/*package*/ static void waitForCheckpoint(CheckPoint id) throws InterruptedException {
while (true) {
Run b = RunnerStack.INSTANCE.peek().getBuild().getPreviousBuildInProgress();
if (b == null) {
return; // no pending earlier build
}
Run.Runner runner = b.runner;
if (runner == null) {
// polled at the wrong moment. try again.
Thread.sleep(0);
continue;
}
if (runner.checkpoints.waitForCheckPoint(id)) {
return; // confirmed that the previous build reached the check point
}
// the previous build finished without ever reaching the check point. try again.
}
}
内容来源于网络,如有侵权,请联系作者删除!