|
@@ -18,7 +18,6 @@
|
|
package org.apache.hadoop.hdfs.server.namenode;
|
|
package org.apache.hadoop.hdfs.server.namenode;
|
|
|
|
|
|
import com.google.common.base.Preconditions;
|
|
import com.google.common.base.Preconditions;
|
|
-import org.apache.commons.io.Charsets;
|
|
|
|
import org.apache.hadoop.fs.FileAlreadyExistsException;
|
|
import org.apache.hadoop.fs.FileAlreadyExistsException;
|
|
import org.apache.hadoop.fs.InvalidPathException;
|
|
import org.apache.hadoop.fs.InvalidPathException;
|
|
import org.apache.hadoop.fs.UnresolvedLinkException;
|
|
import org.apache.hadoop.fs.UnresolvedLinkException;
|
|
@@ -33,6 +32,7 @@ import org.apache.hadoop.hdfs.protocol.QuotaExceededException;
|
|
import org.apache.hadoop.hdfs.server.namenode.snapshot.Snapshot;
|
|
import org.apache.hadoop.hdfs.server.namenode.snapshot.Snapshot;
|
|
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
|
+import java.nio.charset.StandardCharsets;
|
|
import java.util.AbstractMap;
|
|
import java.util.AbstractMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -121,7 +121,8 @@ class FSDirMkdirOp {
|
|
static Map.Entry<INodesInPath, String> createAncestorDirectories(
|
|
static Map.Entry<INodesInPath, String> createAncestorDirectories(
|
|
FSDirectory fsd, INodesInPath iip, PermissionStatus permission)
|
|
FSDirectory fsd, INodesInPath iip, PermissionStatus permission)
|
|
throws IOException {
|
|
throws IOException {
|
|
- final String last = new String(iip.getLastLocalName(), Charsets.UTF_8);
|
|
|
|
|
|
+ final String last =
|
|
|
|
+ new String(iip.getLastLocalName(), StandardCharsets.UTF_8);
|
|
INodesInPath existing = iip.getExistingINodes();
|
|
INodesInPath existing = iip.getExistingINodes();
|
|
List<String> children = iip.getPath(existing.length(),
|
|
List<String> children = iip.getPath(existing.length(),
|
|
iip.length() - existing.length());
|
|
iip.length() - existing.length());
|
|
@@ -189,7 +190,7 @@ class FSDirMkdirOp {
|
|
throws IOException {
|
|
throws IOException {
|
|
assert fsd.hasWriteLock();
|
|
assert fsd.hasWriteLock();
|
|
existing = unprotectedMkdir(fsd, fsd.allocateNewInodeId(), existing,
|
|
existing = unprotectedMkdir(fsd, fsd.allocateNewInodeId(), existing,
|
|
- localName.getBytes(Charsets.UTF_8), perm, null, now());
|
|
|
|
|
|
+ localName.getBytes(StandardCharsets.UTF_8), perm, null, now());
|
|
if (existing == null) {
|
|
if (existing == null) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|