HADOOP-6138. Eliminate the depracate warnings introduced by H-5438. Contributed by He Yongqiang
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@795172 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5478e9a188
commit
391112f6ce
@ -880,6 +880,9 @@ Trunk (unreleased changes)
|
|||||||
HADOOP-6137. Fix project specific test-patch requirements
|
HADOOP-6137. Fix project specific test-patch requirements
|
||||||
(Giridharan Kesavan)
|
(Giridharan Kesavan)
|
||||||
|
|
||||||
|
HADOOP-6138. Eliminate the depracate warnings introduced by H-5438.
|
||||||
|
(He Yongqiang via szetszwo)
|
||||||
|
|
||||||
Release 0.20.1 - Unreleased
|
Release 0.20.1 - Unreleased
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.EnumSet;
|
||||||
import java.util.zip.CRC32;
|
import java.util.zip.CRC32;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
@ -360,14 +361,14 @@ protected void writeChunk(byte[] b, int offset, int len, byte[] checksum)
|
|||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
public FSDataOutputStream create(Path f, FsPermission permission,
|
public FSDataOutputStream create(Path f, FsPermission permission,
|
||||||
boolean overwrite, int bufferSize, short replication, long blockSize,
|
EnumSet<CreateFlag> flag, int bufferSize, short replication, long blockSize,
|
||||||
Progressable progress) throws IOException {
|
Progressable progress) throws IOException {
|
||||||
Path parent = f.getParent();
|
Path parent = f.getParent();
|
||||||
if (parent != null && !mkdirs(parent)) {
|
if (parent != null && !mkdirs(parent)) {
|
||||||
throw new IOException("Mkdirs failed to create " + parent);
|
throw new IOException("Mkdirs failed to create " + parent);
|
||||||
}
|
}
|
||||||
final FSDataOutputStream out = new FSDataOutputStream(
|
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);
|
blockSize, progress), null);
|
||||||
if (permission != null) {
|
if (permission != null) {
|
||||||
setPermission(f, permission);
|
setPermission(f, permission);
|
||||||
|
@ -500,8 +500,9 @@ public FSDataOutputStream create(Path f,
|
|||||||
long blockSize,
|
long blockSize,
|
||||||
Progressable progress
|
Progressable progress
|
||||||
) throws IOException {
|
) throws IOException {
|
||||||
return this.create(f, FsPermission.getDefault(),
|
return this.create(f, FsPermission.getDefault(), overwrite ? EnumSet
|
||||||
overwrite, bufferSize, replication, blockSize, progress);
|
.of(CreateFlag.OVERWRITE) : EnumSet.of(CreateFlag.CREATE), bufferSize,
|
||||||
|
replication, blockSize, progress);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
@ -580,7 +581,7 @@ public FSDataOutputStream create(Path f, int bufferSize)
|
|||||||
|
|
||||||
public FSDataOutputStream create(Path f,
|
public FSDataOutputStream create(Path f,
|
||||||
FsPermission permission,
|
FsPermission permission,
|
||||||
boolean overwrite,
|
EnumSet<CreateFlag> flag,
|
||||||
int bufferSize,
|
int bufferSize,
|
||||||
short replication,
|
short replication,
|
||||||
long blockSize,
|
long blockSize,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user