HADOOP-11595. Add default implementation for AbstractFileSystem#truncate. (yliu)

This commit is contained in:
yliu 2015-02-19 08:28:15 +08:00
parent 32d215dc89
commit 000b9e6c24
3 changed files with 8 additions and 8 deletions

View File

@ -562,6 +562,9 @@ Release 2.7.0 - UNRELEASED
HADOOP-11545. ArrayIndexOutOfBoundsException is thrown with "hadoop
credential list -provider". (Brahma Reddy Battula via aajisaka)
HADOOP-11595. Add default implementation for AbstractFileSystem#truncate.
(yliu)
Release 2.6.1 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -642,9 +642,12 @@ public abstract class AbstractFileSystem {
* {@link FileContext#truncate(Path, long)} except that Path f must be for
* this file system.
*/
public abstract boolean truncate(Path f, long newLength)
public boolean truncate(Path f, long newLength)
throws AccessControlException, FileNotFoundException,
UnresolvedLinkException, IOException;
UnresolvedLinkException, IOException {
throw new UnsupportedOperationException(getClass().getSimpleName()
+ " doesn't support truncate");
}
/**
* The specification of this method matches that of

View File

@ -140,12 +140,6 @@ public class TestAfsCheckPath {
return null;
}
@Override
public boolean truncate(Path f, long newLength) throws IOException {
// deliberately empty
return false;
}
@Override
public void renameInternal(Path src, Path dst) throws IOException {
// deliberately empty