diff --git a/CHANGES.txt b/CHANGES.txt index 71a1f6b3014..67d4a085a67 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -880,6 +880,9 @@ Trunk (unreleased changes) HADOOP-6137. Fix project specific test-patch requirements (Giridharan Kesavan) + HADOOP-6138. Eliminate the depracate warnings introduced by H-5438. + (He Yongqiang via szetszwo) + Release 0.20.1 - Unreleased INCOMPATIBLE CHANGES diff --git a/src/java/org/apache/hadoop/fs/ChecksumFileSystem.java b/src/java/org/apache/hadoop/fs/ChecksumFileSystem.java index 6f9701e4d72..d3844b5d614 100644 --- a/src/java/org/apache/hadoop/fs/ChecksumFileSystem.java +++ b/src/java/org/apache/hadoop/fs/ChecksumFileSystem.java @@ -20,6 +20,7 @@ package org.apache.hadoop.fs; import java.io.*; import java.util.Arrays; +import java.util.EnumSet; import java.util.zip.CRC32; import org.apache.commons.logging.Log; @@ -360,14 +361,14 @@ public abstract class ChecksumFileSystem extends FilterFileSystem { /** {@inheritDoc} */ @Override public FSDataOutputStream create(Path f, FsPermission permission, - boolean overwrite, int bufferSize, short replication, long blockSize, + EnumSet flag, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException { Path parent = f.getParent(); if (parent != null && !mkdirs(parent)) { throw new IOException("Mkdirs failed to create " + parent); } final FSDataOutputStream out = new FSDataOutputStream( - new ChecksumFSOutputSummer(this, f, overwrite, bufferSize, replication, + new ChecksumFSOutputSummer(this, f, flag.contains(CreateFlag.OVERWRITE), bufferSize, replication, blockSize, progress), null); if (permission != null) { setPermission(f, permission); diff --git a/src/java/org/apache/hadoop/fs/FileSystem.java b/src/java/org/apache/hadoop/fs/FileSystem.java index afa4d04ffb5..004941066e7 100644 --- a/src/java/org/apache/hadoop/fs/FileSystem.java +++ b/src/java/org/apache/hadoop/fs/FileSystem.java @@ -500,8 +500,9 @@ public abstract class FileSystem extends Configured implements Closeable { long blockSize, Progressable progress ) throws IOException { - return this.create(f, FsPermission.getDefault(), - overwrite, bufferSize, replication, blockSize, progress); + return this.create(f, FsPermission.getDefault(), overwrite ? EnumSet + .of(CreateFlag.OVERWRITE) : EnumSet.of(CreateFlag.CREATE), bufferSize, + replication, blockSize, progress); } /** diff --git a/src/java/org/apache/hadoop/fs/HarFileSystem.java b/src/java/org/apache/hadoop/fs/HarFileSystem.java index bcec4b660f1..46bf50f9339 100644 --- a/src/java/org/apache/hadoop/fs/HarFileSystem.java +++ b/src/java/org/apache/hadoop/fs/HarFileSystem.java @@ -22,6 +22,7 @@ import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; +import java.util.EnumSet; import java.util.List; import org.apache.hadoop.conf.Configuration; @@ -580,7 +581,7 @@ public class HarFileSystem extends FilterFileSystem { public FSDataOutputStream create(Path f, FsPermission permission, - boolean overwrite, + EnumSet flag, int bufferSize, short replication, long blockSize,