提交 ca8a5bde 编写于 作者: K kohsuke

[FIXED HUDSON-3254] Use a bigger buffer size to improve remote I/O performance. Will be in 1.302.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@17491 71c3de6d-444a-0410-be80-ed276b4c234a
上级 aaf53efc
......@@ -424,7 +424,7 @@ public final class FilePath implements Serializable {
public InputStream extract(InputStream _in) throws IOException {
HeadBufferingStream in = new HeadBufferingStream(_in,SIDE_BUFFER_SIZE);
try {
return new GZIPInputStream(in);
return new GZIPInputStream(in,8192);
} catch (IOException e) {
// various people reported "java.io.IOException: Not in GZIP format" here, so diagnose this problem better
in.fillSide();
......@@ -432,7 +432,7 @@ public final class FilePath implements Serializable {
}
}
public OutputStream compress(OutputStream out) throws IOException {
return new GZIPOutputStream(out);
return new GZIPOutputStream(new BufferedOutputStream(out));
}
};
......@@ -454,7 +454,7 @@ public final class FilePath implements Serializable {
final InputStream in = new RemoteInputStream(_in);
act(new FileCallable<Void>() {
public Void invoke(File dir, VirtualChannel channel) throws IOException {
readFromTar("input stream",dir, compression.extract(new BufferedInputStream(in)));
readFromTar("input stream",dir, compression.extract(in));
return null;
}
private static final long serialVersionUID = 1L;
......@@ -1150,7 +1150,7 @@ public final class FilePath implements Serializable {
}
}
});
int r = writeToTar(new File(remote),fileMask,excludes,new GZIPOutputStream(pipe.getOut()));
int r = writeToTar(new File(remote),fileMask,excludes,TarCompression.GZIP.compress(pipe.getOut()));
try {
future.get();
} catch (ExecutionException e) {
......@@ -1164,7 +1164,7 @@ public final class FilePath implements Serializable {
Future<Integer> future = actAsync(new FileCallable<Integer>() {
public Integer invoke(File f, VirtualChannel channel) throws IOException {
try {
return writeToTar(f,fileMask,excludes,new GZIPOutputStream(pipe.getOut()));
return writeToTar(f,fileMask,excludes,TarCompression.GZIP.compress(pipe.getOut()));
} finally {
pipe.getOut().close();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册