[FIXED JENKINS-18438]

Node monitoring should run in parallel to reduce the total round-trip
time in large instances.
This commit is contained in:
Kohsuke Kawaguchi committed 2013-06-26 16:29:43 -07:00
1 parent 208cf9cddc
commit 735713801b
15 files changed
+375 -83

No files matched your search

+22
View File
@@ -70,6 +70,7 @@ import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InterruptedIOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
@@ -998,6 +999,27 @@ public final class FilePath implements Serializable {
}
}
/**
* Takes a {@link FilePath}+{@link FileCallable} pair and returns the equivalent {@link Callable}.
* When executing the resulting {@link Callable}, it executes {@link FileCallable#act(FileCallable)}
* on this {@link FilePath}.
*
* @since 1.522
*/
public <V> Callable<V,IOException> asCallableWith(final FileCallable<V> task) {
return new Callable<V,IOException>() {
@Override
public V call() throws IOException {
try {
return act(task);
} catch (InterruptedException e) {
throw (IOException)new InterruptedIOException().initCause(e);
}
}
private static final long serialVersionUID = 1L;
};
}
/**
* Converts this file to the URI, relative to the machine
* on which this file is available.