Skip to content

Commit ae63d8e

Browse files
authored
HDFS-17621. Make PathIsNotEmptyDirectoryException terse (#7036). Contributed by dzcxzl.
1 parent 50fcfd8 commit ae63d8e

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import java.util.stream.Collectors;
5757

5858
import org.apache.hadoop.fs.Path;
59+
import org.apache.hadoop.fs.PathIsNotEmptyDirectoryException;
5960
import org.apache.hadoop.hdfs.HAUtil;
6061
import org.apache.hadoop.hdfs.protocol.UnresolvedPathException;
6162
import org.apache.hadoop.thirdparty.com.google.common.cache.CacheBuilder;
@@ -368,7 +369,8 @@ public RouterRpcServer(Configuration conf, Router router,
368369
NotReplicatedYetException.class,
369370
IOException.class,
370371
ConnectException.class,
371-
RetriableException.class);
372+
RetriableException.class,
373+
PathIsNotEmptyDirectoryException.class);
372374

373375
this.rpcServer.addSuppressedLoggingExceptions(
374376
StandbyException.class, UnresolvedPathException.class);

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
import org.apache.hadoop.conf.ReconfigurationTaskStatus;
5555
import org.apache.hadoop.crypto.CryptoProtocolVersion;
5656
import org.apache.hadoop.fs.BatchedRemoteIterator.BatchedEntries;
57+
import org.apache.hadoop.fs.PathIsNotEmptyDirectoryException;
5758
import org.apache.hadoop.hdfs.AddBlockFlag;
5859
import org.apache.hadoop.fs.CacheFlag;
5960
import org.apache.hadoop.fs.CommonConfigurationKeys;
@@ -541,7 +542,8 @@ public NameNodeRpcServer(Configuration conf, NameNode nn)
541542
FSLimitException.PathComponentTooLongException.class,
542543
FSLimitException.MaxDirectoryItemsExceededException.class,
543544
DisallowedDatanodeException.class,
544-
XAttrNotFoundException.class);
545+
XAttrNotFoundException.class,
546+
PathIsNotEmptyDirectoryException.class);
545547

546548
clientRpcServer.addSuppressedLoggingExceptions(StandbyException.class,
547549
UnresolvedPathException.class);

0 commit comments

Comments
 (0)