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/24 08:52:40 UTC
[hadoop] branch trunk updated: HDFS-15902. Improve the log for
HTTPFS server operation. Contributed by Bhavik Patel.
This is an automated email from the ASF dual-hosted git repository.
tasanuma pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new b4d97a8 HDFS-15902. Improve the log for HTTPFS server operation. Contributed by Bhavik Patel.
b4d97a8 is described below
commit b4d97a8dc75e4dc823d092f5bac37d6096dc6dc4
Author: Takanobu Asanuma <ta...@apache.org>
AuthorDate: Wed Mar 24 17:51:35 2021 +0900
HDFS-15902. Improve the log for HTTPFS server operation. Contributed by Bhavik Patel.
---
.../token/delegation/web/DelegationTokenAuthenticatedURL.java | 6 ++----
.../java/org/apache/hadoop/fs/http/server/HttpFSServer.java | 11 ++++-------
.../hadoop/lib/service/hadoop/FileSystemAccessService.java | 10 ++++++----
3 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/web/DelegationTokenAuthenticatedURL.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/web/DelegationTokenAuthenticatedURL.java
index 07507f9..eb84c63 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/web/DelegationTokenAuthenticatedURL.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/web/DelegationTokenAuthenticatedURL.java
@@ -295,10 +295,8 @@ public class DelegationTokenAuthenticatedURL extends AuthenticatedURL {
// delegation token
Credentials creds = UserGroupInformation.getCurrentUser().
getCredentials();
- if (LOG.isDebugEnabled()) {
- LOG.debug("Token not set, looking for delegation token. Creds:{},"
- + " size:{}", creds.getAllTokens(), creds.numberOfTokens());
- }
+ LOG.debug("Token not set, looking for delegation token. Creds:{},"
+ + " size:{}", creds.getAllTokens(), creds.numberOfTokens());
if (!creds.getAllTokens().isEmpty()) {
dToken = selectDelegationToken(url, creds);
if (dToken != null) {
diff --git a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/HttpFSServer.java b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/HttpFSServer.java
index 0e7038b..d0d76d6 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/HttpFSServer.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/HttpFSServer.java
@@ -285,7 +285,7 @@ public class HttpFSServer {
}
});
} catch (InterruptedException ie) {
- LOG.info("Open interrupted.", ie);
+ LOG.warn("Open interrupted.", ie);
Thread.currentThread().interrupt();
}
Long offset = params.get(OffsetParam.NAME, OffsetParam.class);
@@ -318,7 +318,7 @@ public class HttpFSServer {
enforceRootPath(op.value(), path);
FSOperations.FSHomeDir command = new FSOperations.FSHomeDir();
JSONObject json = fsExecute(user, command);
- AUDIT_LOG.info("");
+ AUDIT_LOG.info("Home Directory for [{}]", user);
response = Response.ok(json).type(MediaType.APPLICATION_JSON).build();
break;
}
@@ -340,7 +340,7 @@ public class HttpFSServer {
FSOperations.FSContentSummary command =
new FSOperations.FSContentSummary(path);
Map json = fsExecute(user, command);
- AUDIT_LOG.info("[{}]", path);
+ AUDIT_LOG.info("Content summary for [{}]", path);
response = Response.ok(json).type(MediaType.APPLICATION_JSON).build();
break;
}
@@ -348,7 +348,7 @@ public class HttpFSServer {
FSOperations.FSQuotaUsage command =
new FSOperations.FSQuotaUsage(path);
Map json = fsExecute(user, command);
- AUDIT_LOG.info("[{}]", path);
+ AUDIT_LOG.info("Quota Usage for [{}]", path);
response = Response.ok(json).type(MediaType.APPLICATION_JSON).build();
break;
}
@@ -657,14 +657,11 @@ public class HttpFSServer {
break;
}
case CONCAT: {
- System.out.println("HTTPFS SERVER CONCAT");
String sources = params.get(SourcesParam.NAME, SourcesParam.class);
-
FSOperations.FSConcat command =
new FSOperations.FSConcat(path, sources.split(","));
fsExecute(user, command);
AUDIT_LOG.info("[{}]", path);
- System.out.println("SENT RESPONSE");
response = Response.ok().build();
break;
}
diff --git a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/service/hadoop/FileSystemAccessService.java b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/service/hadoop/FileSystemAccessService.java
index 094526a..b0c1060 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/service/hadoop/FileSystemAccessService.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/service/hadoop/FileSystemAccessService.java
@@ -194,9 +194,11 @@ public class FileSystemAccessService extends BaseService implements FileSystemAc
throw new ServiceException(FileSystemAccessException.ERROR.H11, ex.toString(), ex);
}
- LOG.debug("FileSystemAccess FileSystem configuration:");
- for (Map.Entry entry : serviceHadoopConf) {
- LOG.debug(" {} = {}", entry.getKey(), entry.getValue());
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("FileSystemAccess FileSystem configuration:");
+ for (Map.Entry entry : serviceHadoopConf) {
+ LOG.debug(" {} = {}", entry.getKey(), entry.getValue());
+ }
}
setRequiredServiceHadoopConf(serviceHadoopConf);
@@ -262,7 +264,7 @@ public class FileSystemAccessService extends BaseService implements FileSystemAc
LOG.warn("Error while purging filesystem, " + ex.toString(), ex);
}
}
- LOG.debug("Purged [{}} filesystem instances", count);
+ LOG.debug("Purged [{}] filesystem instances", count);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org