本文整理了Java中hudson.model.Executor.<init>()
方法的一些代码示例,展示了Executor.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Executor.<init>()
方法的具体详情如下:
包路径:hudson.model.Executor
类名称:Executor
方法名:<init>
暂无
代码示例来源:origin: jenkinsci/jenkins
private void addNewExecutorIfNecessary() {
if (Jenkins.getInstanceOrNull() == null) {
return;
}
Set<Integer> availableNumbers = new HashSet<Integer>();
for (int i = 0; i < numExecutors; i++)
availableNumbers.add(i);
for (Executor executor : executors)
availableNumbers.remove(executor.getNumber());
for (Integer number : availableNumbers) {
/* There may be busy executors with higher index, so only
fill up until numExecutors is reached.
Extra executors will call removeExecutor(...) and that
will create any necessary executors from #0 again. */
if (executors.size() < numExecutors) {
Executor e = new Executor(this, number);
executors.add(e);
}
}
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
private void addNewExecutorIfNecessary() {
Set<Integer> availableNumbers = new HashSet<Integer>();
for (int i = 0; i < numExecutors; i++)
availableNumbers.add(i);
for (Executor executor : executors)
availableNumbers.remove(executor.getNumber());
for (Integer number : availableNumbers) {
/* There may be busy executors with higher index, so only
fill up until numExecutors is reached.
Extra executors will call removeExecutor(...) and that
will create any necessary executors from #0 again. */
if (executors.size() < numExecutors) {
Executor e = new Executor(this, number);
executors.add(e);
}
}
}
代码示例来源:origin: hudson/hudson-2.x
private synchronized void setNumExecutors(int n) {
if(numExecutors==n) return; // no-op
int diff = n-numExecutors;
this.numExecutors = n;
if(diff<0) {
// send signal to all idle executors to potentially kill them off
for( Executor e : executors )
if(e.isIdle())
e.interrupt();
} else {
// if the number is increased, add new ones
while(executors.size()<numExecutors) {
Executor e = new Executor(this, executors.size());
e.start();
executors.add(e);
}
}
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
private synchronized void setNumExecutors(int n) {
if(numExecutors==n) return; // no-op
int diff = n-numExecutors;
this.numExecutors = n;
if(diff<0) {
// send signal to all idle executors to potentially kill them off
for( Executor e : executors )
if(e.isIdle())
e.interrupt();
} else {
// if the number is increased, add new ones
while(executors.size()<numExecutors) {
Executor e = new Executor(this, executors.size());
e.start();
executors.add(e);
}
}
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
private synchronized void setNumExecutors(int n) {
if(numExecutors==n) return; // no-op
int diff = n-numExecutors;
this.numExecutors = n;
if(diff<0) {
// send signal to all idle executors to potentially kill them off
for( Executor e : executors )
if(e.isIdle())
e.interrupt();
} else {
// if the number is increased, add new ones
while(executors.size()<numExecutors) {
Executor e = new Executor(this, executors.size());
e.start();
executors.add(e);
}
}
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
private synchronized void setNumExecutors(int n) {
if (numExecutors == n) {
return; // no-op
}
int diff = n - numExecutors;
this.numExecutors = n;
if (diff < 0) {
// send signal to all idle executors to potentially kill them off
for (Executor e : executors) {
if (e.isIdle()) {
e.interrupt();
}
}
} else {
// if the number is increased, add new ones
while (executors.size() < numExecutors) {
Executor e = new Executor(this, executors.size());
e.start();
executors.add(e);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!