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

This commit is contained in:
yliu 2015-02-19 08:26:42 +08:00
parent a19820f2fb
commit 64a8375635
3 changed files with 8 additions and 8 deletions

View File

@ -970,6 +970,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 FSDataInputStream open(final Path f, int bufferSize)
* {@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 FSDataInputStream open(Path f, int bufferSize) throws IOException {
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