Skip to content

Commit f37422d

Browse files
authored
Merge branch 'apache:trunk' into YARN-11239
2 parents 448f940 + 759ddeb commit f37422d

File tree

112 files changed

+3763
-1103
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+3763
-1103
lines changed

LICENSE-binary

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/nvd3-1.8.5.* (css and js
210210
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/checker/AbstractFuture.java
211211
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/checker/TimeoutFuture.java
212212

213-
com.aliyun:aliyun-java-sdk-core:3.4.0
214-
com.aliyun:aliyun-java-sdk-ecs:4.2.0
215-
com.aliyun:aliyun-java-sdk-ram:3.0.0
213+
com.aliyun:aliyun-java-sdk-core:4.5.10
214+
com.aliyun:aliyun-java-sdk-kms:2.11.0
215+
com.aliyun:aliyun-java-sdk-ram:3.1.0
216216
com.aliyun:aliyun-java-sdk-sts:3.0.0
217217
com.aliyun.oss:aliyun-sdk-oss:3.13.2
218218
com.amazonaws:aws-java-sdk-bundle:1.12.316
@@ -323,21 +323,21 @@ org.apache.htrace:htrace-core4:4.1.0-incubating
323323
org.apache.httpcomponents:httpclient:4.5.6
324324
org.apache.httpcomponents:httpcore:4.4.10
325325
org.apache.kafka:kafka-clients:2.8.2
326-
org.apache.kerby:kerb-admin:2.0.2
327-
org.apache.kerby:kerb-client:2.0.2
328-
org.apache.kerby:kerb-common:2.0.2
329-
org.apache.kerby:kerb-core:2.0.2
330-
org.apache.kerby:kerb-crypto:2.0.2
331-
org.apache.kerby:kerb-identity:2.0.2
332-
org.apache.kerby:kerb-server:2.0.2
333-
org.apache.kerby:kerb-simplekdc:2.0.2
334-
org.apache.kerby:kerb-util:2.0.2
335-
org.apache.kerby:kerby-asn1:2.0.2
336-
org.apache.kerby:kerby-config:2.0.2
337-
org.apache.kerby:kerby-pkix:2.0.2
338-
org.apache.kerby:kerby-util:2.0.2
339-
org.apache.kerby:kerby-xdr:2.0.2
340-
org.apache.kerby:token-provider:2.0.2
326+
org.apache.kerby:kerb-admin:2.0.3
327+
org.apache.kerby:kerb-client:2.0.3
328+
org.apache.kerby:kerb-common:2.0.3
329+
org.apache.kerby:kerb-core:2.0.3
330+
org.apache.kerby:kerb-crypto:2.0.3
331+
org.apache.kerby:kerb-identity:2.0.3
332+
org.apache.kerby:kerb-server:2.0.3
333+
org.apache.kerby:kerb-simplekdc:2.0.3
334+
org.apache.kerby:kerb-util:2.0.3
335+
org.apache.kerby:kerby-asn1:2.0.3
336+
org.apache.kerby:kerby-config:2.0.3
337+
org.apache.kerby:kerby-pkix:2.0.3
338+
org.apache.kerby:kerby-util:2.0.3
339+
org.apache.kerby:kerby-xdr:2.0.3
340+
org.apache.kerby:token-provider:2.0.3
341341
org.apache.solr:solr-solrj:8.8.2
342342
org.apache.yetus:audience-annotations:0.5.0
343343
org.apache.zookeeper:zookeeper:3.6.3
@@ -357,10 +357,13 @@ org.eclipse.jetty:jetty-xml:9.4.48.v20220622
357357
org.eclipse.jetty.websocket:javax-websocket-client-impl:9.4.48.v20220622
358358
org.eclipse.jetty.websocket:javax-websocket-server-impl:9.4.48.v20220622
359359
org.ehcache:ehcache:3.3.1
360+
org.ini4j:ini4j:0.5.4
361+
org.jetbrains.kotlin:kotlin-stdlib:1.4.10
362+
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.10
360363
org.lz4:lz4-java:1.7.1
361364
org.objenesis:objenesis:2.6
362365
org.xerial.snappy:snappy-java:1.0.5
363-
org.yaml:snakeyaml:1.33
366+
org.yaml:snakeyaml:2.0
364367
org.wildfly.openssl:wildfly-openssl:1.1.3.Final
365368

366369

@@ -516,6 +519,8 @@ Eclipse Public License 1.0
516519
--------------------------
517520

518521
junit:junit:4.13.2
522+
org.jacoco:org.jacoco.agent:0.8.5
523+
519524

520525

521526
HSQL License

hadoop-common-project/hadoop-common/src/main/bin/hadoop

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ MYNAME="${BASH_SOURCE-$0}"
2626
function hadoop_usage
2727
{
2828
hadoop_add_option "buildpaths" "attempt to add class files from build tree"
29-
hadoop_add_option "hostnames list[,of,host,names]" "hosts to use in slave mode"
29+
hadoop_add_option "hostnames list[,of,host,names]" "hosts to use in worker mode"
3030
hadoop_add_option "loglevel level" "set the log4j level for this command"
31-
hadoop_add_option "hosts filename" "list of hosts to use in slave mode"
31+
hadoop_add_option "hosts filename" "list of hosts to use in worker mode"
3232
hadoop_add_option "workers" "turn on worker mode"
3333

3434
hadoop_add_subcommand "checknative" client "check native Hadoop and compression libraries availability"

hadoop-common-project/hadoop-common/src/main/bin/hadoop-daemons.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# limitations under the License.
1717

1818

19-
# Run a Hadoop command on all slave hosts.
19+
# Run a Hadoop command on all worker hosts.
2020

2121
function hadoop_usage
2222
{

hadoop-common-project/hadoop-common/src/main/conf/log4j.properties

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,6 @@ log4j.appender.console.target=System.err
7575
log4j.appender.console.layout=org.apache.log4j.PatternLayout
7676
log4j.appender.console.layout.ConversionPattern=%d{ISO8601} %p %c{2}: %m%n
7777

78-
#
79-
# TaskLog Appender
80-
#
81-
log4j.appender.TLA=org.apache.hadoop.mapred.TaskLogAppender
82-
83-
log4j.appender.TLA.layout=org.apache.log4j.PatternLayout
84-
log4j.appender.TLA.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n
85-
8678
#
8779
# HDFS block state change log from block manager
8880
#

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/log/LogLevel.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
import org.apache.hadoop.classification.VisibleForTesting;
3636
import org.apache.hadoop.thirdparty.com.google.common.base.Charsets;
37+
import org.slf4j.LoggerFactory;
38+
3739
import org.apache.hadoop.HadoopIllegalArgumentException;
3840
import org.apache.hadoop.classification.InterfaceAudience;
3941
import org.apache.hadoop.classification.InterfaceStability;
@@ -44,6 +46,7 @@
4446
import org.apache.hadoop.security.authentication.client.KerberosAuthenticator;
4547
import org.apache.hadoop.security.ssl.SSLFactory;
4648
import org.apache.hadoop.util.GenericOptionsParser;
49+
import org.apache.hadoop.util.GenericsUtil;
4750
import org.apache.hadoop.util.ServletUtil;
4851
import org.apache.hadoop.util.Tool;
4952
import org.apache.hadoop.util.ToolRunner;
@@ -338,14 +341,18 @@ public void doGet(HttpServletRequest request, HttpServletResponse response
338341
out.println(MARKER
339342
+ "Submitted Class Name: <b>" + logName + "</b><br />");
340343

341-
Logger log = Logger.getLogger(logName);
344+
org.slf4j.Logger log = LoggerFactory.getLogger(logName);
342345
out.println(MARKER
343346
+ "Log Class: <b>" + log.getClass().getName() +"</b><br />");
344347
if (level != null) {
345348
out.println(MARKER + "Submitted Level: <b>" + level + "</b><br />");
346349
}
347350

348-
process(log, level, out);
351+
if (GenericsUtil.isLog4jLogger(logName)) {
352+
process(Logger.getLogger(logName), level, out);
353+
} else {
354+
out.println("Sorry, setting log level is only supported for log4j loggers.<br />");
355+
}
349356
}
350357

351358
out.println(FORMS);

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,8 @@ public static void login(final Configuration conf,
314314

315315
String keytabFilename = conf.get(keytabFileKey);
316316
if (keytabFilename == null || keytabFilename.length() == 0) {
317-
throw new IOException("Running in secure mode, but config doesn't have a keytab");
317+
throw new IOException(
318+
"Running in secure mode, but config doesn't have a keytab for key: " + keytabFileKey);
318319
}
319320

320321
String principalConfig = conf.get(userNameKey, System

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/GenericsUtil.java

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import java.lang.reflect.Array;
2222
import java.util.List;
23+
import java.util.concurrent.atomic.AtomicBoolean;
2324

2425
import org.apache.hadoop.classification.InterfaceAudience;
2526
import org.apache.hadoop.classification.InterfaceStability;
@@ -33,6 +34,14 @@
3334
@InterfaceStability.Unstable
3435
public class GenericsUtil {
3536

37+
private static final String SLF4J_LOG4J_ADAPTER_CLASS = "org.slf4j.impl.Log4jLoggerAdapter";
38+
39+
/**
40+
* Set to false only if log4j adapter class is not found in the classpath. Once set to false,
41+
* the utility method should not bother re-loading class again.
42+
*/
43+
private static final AtomicBoolean IS_LOG4J_LOGGER = new AtomicBoolean(true);
44+
3645
/**
3746
* Returns the Class object (of type <code>Class&lt;T&gt;</code>) of the
3847
* argument of type <code>T</code>.
@@ -87,12 +96,27 @@ public static boolean isLog4jLogger(Class<?> clazz) {
8796
if (clazz == null) {
8897
return false;
8998
}
90-
Logger log = LoggerFactory.getLogger(clazz);
99+
return isLog4jLogger(clazz.getName());
100+
}
101+
102+
/**
103+
* Determine whether the log of the given logger is of Log4J implementation.
104+
*
105+
* @param logger the logger name, usually class name as string.
106+
* @return true if the logger uses Log4J implementation.
107+
*/
108+
public static boolean isLog4jLogger(String logger) {
109+
if (logger == null || !IS_LOG4J_LOGGER.get()) {
110+
return false;
111+
}
112+
Logger log = LoggerFactory.getLogger(logger);
91113
try {
92-
Class log4jClass = Class.forName("org.slf4j.impl.Log4jLoggerAdapter");
114+
Class<?> log4jClass = Class.forName(SLF4J_LOG4J_ADAPTER_CLASS);
93115
return log4jClass.isInstance(log);
94116
} catch (ClassNotFoundException e) {
117+
IS_LOG4J_LOGGER.set(false);
95118
return false;
96119
}
97120
}
121+
98122
}

hadoop-common-project/hadoop-common/src/site/markdown/Metrics.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,9 @@ Each metrics record contains tags such as SessionId and Hostname as additional i
370370
|:---- |:---- |
371371
| `BytesWritten` | Total number of bytes written to DataNode |
372372
| `BytesRead` | Total number of bytes read from DataNode |
373+
| `ReadTransferRateNumOps` | Total number of data read transfers |
374+
| `ReadTransferRateAvgTime` | Average transfer rate of bytes read from DataNode, measured in bytes per second. |
375+
| `ReadTransferRate`*num*`s(50/75/90/95/99)thPercentileRate` | The 50/75/90/95/99th percentile of the transfer rate of bytes read from DataNode, measured in bytes per second. |
373376
| `BlocksWritten` | Total number of blocks written to DataNode |
374377
| `BlocksRead` | Total number of blocks read from DataNode |
375378
| `BlocksReplicated` | Total number of blocks replicated |

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestGenericsUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public void testGetClass() {
140140

141141
@Test
142142
public void testIsLog4jLogger() throws Exception {
143-
assertFalse("False if clazz is null", GenericsUtil.isLog4jLogger(null));
143+
assertFalse("False if clazz is null", GenericsUtil.isLog4jLogger((Class<?>) null));
144144
assertTrue("The implementation is Log4j",
145145
GenericsUtil.isLog4jLogger(TestGenericsUtil.class));
146146
}

hadoop-common-project/hadoop-kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMSConfiguration.java

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import org.apache.hadoop.classification.InterfaceAudience;
2121
import org.apache.hadoop.conf.Configuration;
2222
import org.apache.hadoop.fs.Path;
23-
import org.apache.log4j.PropertyConfigurator;
23+
2424
import org.slf4j.Logger;
2525
import org.slf4j.LoggerFactory;
2626

@@ -104,8 +104,6 @@ public class KMSConfiguration {
104104

105105
public static final boolean KEY_AUTHORIZATION_ENABLE_DEFAULT = true;
106106

107-
private static final String LOG4J_PROPERTIES = "kms-log4j.properties";
108-
109107
static {
110108
Configuration.addDefaultResource(KMS_DEFAULT_XML);
111109
Configuration.addDefaultResource(KMS_SITE_XML);
@@ -163,31 +161,20 @@ public static boolean isACLsFileNewer(long time) {
163161
return newer;
164162
}
165163

166-
public static void initLogging() {
167-
String confDir = System.getProperty(KMS_CONFIG_DIR);
168-
if (confDir == null) {
169-
throw new RuntimeException("System property '" +
170-
KMSConfiguration.KMS_CONFIG_DIR + "' not defined");
164+
/**
165+
* Validate whether "kms.config.dir" and "log4j.configuration" are defined in the System
166+
* properties. If not, abort the KMS WebServer.
167+
*/
168+
public static void validateSystemProps() {
169+
if (System.getProperty(KMS_CONFIG_DIR) == null) {
170+
String errorMsg = "System property '" + KMS_CONFIG_DIR + "' not defined";
171+
System.err.println("Aborting KMSWebServer because " + errorMsg);
172+
throw new RuntimeException(errorMsg);
171173
}
172174
if (System.getProperty("log4j.configuration") == null) {
173-
System.setProperty("log4j.defaultInitOverride", "true");
174-
boolean fromClasspath = true;
175-
File log4jConf = new File(confDir, LOG4J_PROPERTIES).getAbsoluteFile();
176-
if (log4jConf.exists()) {
177-
PropertyConfigurator.configureAndWatch(log4jConf.getPath(), 1000);
178-
fromClasspath = false;
179-
} else {
180-
ClassLoader cl = Thread.currentThread().getContextClassLoader();
181-
URL log4jUrl = cl.getResource(LOG4J_PROPERTIES);
182-
if (log4jUrl != null) {
183-
PropertyConfigurator.configure(log4jUrl);
184-
}
185-
}
186-
LOG.debug("KMS log starting");
187-
if (fromClasspath) {
188-
LOG.warn("Log4j configuration file '{}' not found", LOG4J_PROPERTIES);
189-
LOG.warn("Logging with INFO level to standard output");
190-
}
175+
String errorMsg = "System property 'log4j.configuration' not defined";
176+
System.err.println("Aborting KMSWebServer because " + errorMsg);
177+
throw new RuntimeException(errorMsg);
191178
}
192179
}
193180
}

0 commit comments

Comments
 (0)