You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ta...@apache.org on 2021/03/17 05:17:50 UTC
[hadoop] branch branch-3.3 updated: HDFS-15890. Improve the Logs
for File Concat Operation. Contributed by Bhavik Patel.
This is an automated email from the ASF dual-hosted git repository.
tasanuma pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-3.3 by this push:
new aec9d2c HDFS-15890. Improve the Logs for File Concat Operation. Contributed by Bhavik Patel.
aec9d2c is described below
commit aec9d2cff7bbe5d3ce0bcc25c40e6f6d4ccc7a03
Author: Takanobu Asanuma <ta...@apache.org>
AuthorDate: Wed Mar 17 14:14:26 2021 +0900
HDFS-15890. Improve the Logs for File Concat Operation. Contributed by Bhavik Patel.
(cherry picked from commit 9ba60c33d8e68766aec49e50ec4c86519c6f9889)
---
.../hadoop/hdfs/server/namenode/FSDirConcatOp.java | 17 +++++------------
.../hadoop/hdfs/server/namenode/NameNodeRpcServer.java | 2 ++
2 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirConcatOp.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirConcatOp.java
index 843f1a5..04ae358 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirConcatOp.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirConcatOp.java
@@ -52,9 +52,9 @@ class FSDirConcatOp {
String target, String[] srcs, boolean logRetryCache) throws IOException {
validatePath(target, srcs);
assert srcs != null;
- if (FSDirectory.LOG.isDebugEnabled()) {
- FSDirectory.LOG.debug("concat {} to {}", Arrays.toString(srcs), target);
- }
+ NameNode.stateChangeLog.debug("DIR* NameSystem.concat: {} to {}",
+ Arrays.toString(srcs), target);
+
final INodesInPath targetIIP = fsd.resolvePath(pc, target, DirOp.WRITE);
// write permission for the target
if (fsd.isPermissionEnabled()) {
@@ -66,11 +66,6 @@ class FSDirConcatOp {
// check the srcs
INodeFile[] srcFiles = verifySrcFiles(fsd, srcs, targetIIP, pc);
- if(NameNode.stateChangeLog.isDebugEnabled()) {
- NameNode.stateChangeLog.debug("DIR* NameSystem.concat: " +
- Arrays.toString(srcs) + " to " + target);
- }
-
long timestamp = now();
fsd.writeLock();
try {
@@ -234,10 +229,8 @@ class FSDirConcatOp {
static void unprotectedConcat(FSDirectory fsd, INodesInPath targetIIP,
INodeFile[] srcList, long timestamp) throws IOException {
assert fsd.hasWriteLock();
- if (NameNode.stateChangeLog.isDebugEnabled()) {
- NameNode.stateChangeLog.debug("DIR* FSNamesystem.concat to "
- + targetIIP.getPath());
- }
+ NameNode.stateChangeLog.debug("DIR* NameSystem.concat to {}",
+ targetIIP.getPath());
final INodeFile trgInode = targetIIP.getLastINode().asFile();
QuotaCounts deltas = computeQuotaDeltas(fsd, trgInode, srcList);
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java
index 66b2bcc..1dc5383 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java
@@ -1057,6 +1057,8 @@ public class NameNodeRpcServer implements NamenodeProtocols {
@Override // ClientProtocol
public void concat(String trg, String[] src) throws IOException {
checkNNStartup();
+ stateChangeLog.debug("*DIR* NameNode.concat: src path {} to" +
+ " target path {}", Arrays.toString(src), trg);
namesystem.checkOperation(OperationCategory.WRITE);
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
if (cacheEntry != null && cacheEntry.isSuccess()) {
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org