HADOOP-18724. [FOLLOW-UP] cherrypick changes from branch-3.3 backport (#5662)
* move FileContext.copy() onto optLong() * move FileUtil onto optLong() This brings trunk into sync with the branch-3.3 changes
This commit is contained in:
parent
bef40e9427
commit
a90c722143
@ -2231,7 +2231,7 @@ public boolean copy(final Path src, final Path dst, boolean deleteSource,
|
|||||||
InputStream in = awaitFuture(openFile(qSrc)
|
InputStream in = awaitFuture(openFile(qSrc)
|
||||||
.opt(FS_OPTION_OPENFILE_READ_POLICY,
|
.opt(FS_OPTION_OPENFILE_READ_POLICY,
|
||||||
FS_OPTION_OPENFILE_READ_POLICY_WHOLE_FILE)
|
FS_OPTION_OPENFILE_READ_POLICY_WHOLE_FILE)
|
||||||
.opt(FS_OPTION_OPENFILE_LENGTH,
|
.optLong(FS_OPTION_OPENFILE_LENGTH,
|
||||||
fs.getLen()) // file length hint for object stores
|
fs.getLen()) // file length hint for object stores
|
||||||
.build());
|
.build());
|
||||||
try (OutputStream out = create(qDst, createFlag)) {
|
try (OutputStream out = create(qDst, createFlag)) {
|
||||||
|
@ -484,7 +484,7 @@ public static boolean copy(FileSystem srcFS, FileStatus srcStatus,
|
|||||||
in = awaitFuture(srcFS.openFile(src)
|
in = awaitFuture(srcFS.openFile(src)
|
||||||
.opt(FS_OPTION_OPENFILE_READ_POLICY,
|
.opt(FS_OPTION_OPENFILE_READ_POLICY,
|
||||||
FS_OPTION_OPENFILE_READ_POLICY_WHOLE_FILE)
|
FS_OPTION_OPENFILE_READ_POLICY_WHOLE_FILE)
|
||||||
.opt(FS_OPTION_OPENFILE_LENGTH,
|
.optLong(FS_OPTION_OPENFILE_LENGTH,
|
||||||
srcStatus.getLen()) // file length hint for object stores
|
srcStatus.getLen()) // file length hint for object stores
|
||||||
.build());
|
.build());
|
||||||
out = dstFS.create(dst, overwrite);
|
out = dstFS.create(dst, overwrite);
|
||||||
|
Loading…
Reference in New Issue
Block a user