HDFS-9302. WebHDFS throws NullPointerException if newLength is not provided. (Jagadesh Kiran N via yliu)

This commit is contained in:
yliu 2015-10-28 15:54:04 +08:00
parent 97913f430c
commit 6ff6663f64
2 changed files with 7 additions and 0 deletions

View File

@ -2170,6 +2170,9 @@ Release 2.8.0 - UNRELEASED
HDFS-9231. fsck doesn't list correct file path when Bad Replicas/Blocks
are in a snapshot. (Xiao Chen via Yongjun Zhang)
HDFS-9302. WebHDFS throws NullPointerException if newLength is not
provided. (Jagadesh Kiran N via yliu)
Release 2.7.2 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -707,6 +707,10 @@ public class NamenodeWebHdfsMethods {
}
case TRUNCATE:
{
if (newLength.getValue() == null) {
throw new IllegalArgumentException(
"newLength parameter is Missing");
}
// We treat each rest request as a separate client.
final boolean b = np.truncate(fullpath, newLength.getValue(),
"DFSClient_" + DFSUtil.getSecureRandom().nextLong());