Skip to content

Commit 2f771e5

Browse files
committed
Merge branch 'master' into HBASE-25720
2 parents b384061 + 253968f commit 2f771e5

339 files changed

Lines changed: 11733 additions & 6725 deletions

File tree

Some content is hidden

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

bin/hbase

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,11 @@ add_jdk11_deps_to_classpath() {
480480
done
481481
}
482482

483+
enable_trace() {
484+
agent_jar=$(find lib/trace -type f -name "opentelemetry-javaagent-*")
485+
HBASE_OPTS="$HBASE_OPTS -javaagent:$agent_jar $HBASE_TRACE_OPTS"
486+
}
487+
483488
#Add the development env class path stuff
484489
if $in_dev_env; then
485490
add_maven_deps_to_classpath "cached_classpath.txt"
@@ -772,6 +777,11 @@ elif [ "${DEBUG}" = "true" ]; then
772777
echo "JDK11 jars skipped from classpath."
773778
fi
774779

780+
if [[ -n "${HBASE_TRACE_OPTS}" ]]; then
781+
echo "Attach opentelemetry agent to enable trace"
782+
enable_trace
783+
fi
784+
775785
# Have JVM dump heap if we run out of memory. Files will be 'launch directory'
776786
# and are named like the following: java_pid21612.hprof. Apparently it doesn't
777787
# 'cost' to have this flag enabled. Its a 1.6 flag only. See:

conf/hbase-env.cmd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,8 @@ set HBASE_OPTS=%HBASE_OPTS% "-XX:+UseConcMarkSweepGC" "-Djava.net.preferIPv4Stac
8181

8282
@rem Tell HBase whether it should manage it's own instance of ZooKeeper or not.
8383
@rem set HBASE_MANAGES_ZK=true
84+
85+
@rem Uncomment to enable trace, you can change the options to use other exporters such as jaeger or
86+
@rem zipkin. See https://github.com/open-telemetry/opentelemetry-java-instrumentation on how to
87+
@rem configure exporters and other components through system properties.
88+
@rem set HBASE_TRACE_OPTS="-Dotel.resource.attributes=service.name=HBase -Dotel.traces.exporter=logging otel.metrics.exporter=none"

conf/hbase-env.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,8 @@
142142
# Override text processing tools for use by these launch scripts.
143143
# export GREP="${GREP-grep}"
144144
# export SED="${SED-sed}"
145+
146+
# Uncomment to enable trace, you can change the options to use other exporters such as jaeger or
147+
# zipkin. See https://github.com/open-telemetry/opentelemetry-java-instrumentation on how to
148+
# configure exporters and other components through system properties.
149+
# export HBASE_TRACE_OPTS="-Dotel.resource.attributes=service.name=HBase -Dotel.traces.exporter=logging otel.metrics.exporter=none"

conf/log4j2.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
<!-- Daily Rolling File Appender -->
2828
<RollingFile name="DRFA"
2929
fileName="${sys:hbase.log.dir:-.}/${sys:hbase.log.file:-hbase.log}"
30-
filePattern="${sys:hbase.log.dir:-.}/${sys:hbase.log.file:-hbase.log}.%d{yyyy-MM-dd}">
30+
filePattern="${sys:hbase.log.dir:-.}/${sys:hbase.log.file:-hbase.log}.%d{yyyy-MM-dd}"
31+
createOnDemand="true">
3132
<PatternLayout pattern="%d{ISO8601} %-5p [%t] %c{2}: %.1000m%n" />
3233
<Policies>
3334
<TimeBasedTriggeringPolicy interval="1" />
@@ -37,7 +38,8 @@
3738
<!-- Rolling File Appender -->
3839
<RollingFile name="RFA"
3940
fileName="${sys:hbase.log.dir:-.}/${sys:hbase.log.file:-hbase.log}"
40-
filePattern="${sys:hbase.log.dir:-.}/${sys:hbase.log.file:-hbase.log}.%i">
41+
filePattern="${sys:hbase.log.dir:-.}/${sys:hbase.log.file:-hbase.log}.%i"
42+
createOnDemand="true">
4143
<PatternLayout pattern="%d{ISO8601} %-5p [%t] %c{2}: %.1000m%n" />
4244
<Policies>
4345
<SizeBasedTriggeringPolicy size="256MB" />
@@ -47,7 +49,8 @@
4749
<!-- Security audit appender -->
4850
<RollingFile name="RFAS"
4951
fileName="${sys:hbase.log.dir:-.}/${sys:hbase.security.log.file:-SecurityAuth.audit}"
50-
filePattern="${sys:hbase.log.dir:-.}/${sys:hbase.security.log.file:-SecurityAuth.audit}.%i">
52+
filePattern="${sys:hbase.log.dir:-.}/${sys:hbase.security.log.file:-SecurityAuth.audit}.%i"
53+
createOnDemand="true">
5154
<PatternLayout pattern="%d{ISO8601} %-5p [%t] %c{2}: %.1000m%n" />
5255
<Policies>
5356
<SizeBasedTriggeringPolicy size="256MB" />
@@ -58,7 +61,8 @@
5861
Http Access Log RFA, uncomment this if you want an http access.log
5962
<RollingFile name="AccessRFA"
6063
fileName="/var/log/hbase/access.log"
61-
filePattern="/var/log/hbase/access.log.%i">
64+
filePattern="/var/log/hbase/access.log.%i"
65+
createOnDemand="true">
6266
<PatternLayout pattern="%m%n" />
6367
<Policies>
6468
<SizeBasedTriggeringPolicy size="200MB" />

dev-support/spotbugs-exclude.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,4 +252,23 @@
252252
<Bug pattern="SC_START_IN_CTOR"/>
253253
</Match>
254254

255+
<Match>
256+
<!--
257+
False positives, NettyRpcServer#start & SimpleRpcServer#start are already synchronized and
258+
there is check to ensure single initialization of authTokenSecretMgr field.
259+
Ignore the warning, see HBASE-25875.
260+
!-->
261+
<Or>
262+
<And>
263+
<Class name="org.apache.hadoop.hbase.ipc.NettyRpcServer"/>
264+
<Method name="start"/>
265+
</And>
266+
<And>
267+
<Class name="org.apache.hadoop.hbase.ipc.SimpleRpcServer"/>
268+
<Method name="start"/>
269+
</And>
270+
</Or>
271+
<Bug pattern="ML_SYNC_ON_UPDATED_FIELD"/>
272+
</Match>
273+
255274
</FindBugsFilter>

hbase-archetypes/hbase-client-project/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@
5353
<groupId>org.apache.hbase</groupId>
5454
<artifactId>hbase-client</artifactId>
5555
</dependency>
56+
<dependency>
57+
<groupId>org.slf4j</groupId>
58+
<artifactId>jcl-over-slf4j</artifactId>
59+
<scope>runtime</scope>
60+
</dependency>
61+
<dependency>
62+
<groupId>org.slf4j</groupId>
63+
<artifactId>jul-to-slf4j</artifactId>
64+
<scope>runtime</scope>
65+
</dependency>
5666
<dependency>
5767
<groupId>org.apache.logging.log4j</groupId>
5868
<artifactId>log4j-api</artifactId>

hbase-archetypes/hbase-client-project/src/main/resources/log4j2.xml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
<!-- Daily Rolling File Appender -->
2828
<RollingFile name="DRFA"
2929
fileName="${sys:hbase.log.dir:-.}/${sys:hbase.log.file:-hbase.log}"
30-
filePattern="${sys:hbase.log.dir:-.}/${sys:hbase.log.file:-hbase.log}.%d{yyyy-MM-dd}">
30+
filePattern="${sys:hbase.log.dir:-.}/${sys:hbase.log.file:-hbase.log}.%d{yyyy-MM-dd}"
31+
createOnDemand="true">
3132
<PatternLayout pattern="%d{ISO8601} %-5p [%t] %c{2}: %.1000m%n" />
3233
<Policies>
3334
<TimeBasedTriggeringPolicy interval="1" />
@@ -37,7 +38,8 @@
3738
<!-- Rolling File Appender -->
3839
<RollingFile name="RFA"
3940
fileName="${sys:hbase.log.dir:-.}/${sys:hbase.log.file:-hbase.log}"
40-
filePattern="${sys:hbase.log.dir:-.}/${sys:hbase.log.file:-hbase.log}.%i">
41+
filePattern="${sys:hbase.log.dir:-.}/${sys:hbase.log.file:-hbase.log}.%i"
42+
createOnDemand="true">
4143
<PatternLayout pattern="%d{ISO8601} %-5p [%t] %c{2}: %.1000m%n" />
4244
<Policies>
4345
<SizeBasedTriggeringPolicy size="256MB" />
@@ -47,23 +49,27 @@
4749
<!-- Security audit appender -->
4850
<RollingFile name="RFAS"
4951
fileName="${sys:hbase.log.dir:-.}/${sys:hbase.security.log.file:-SecurityAuth.audit}"
50-
filePattern="${sys:hbase.log.dir:-.}/${sys:hbase.security.log.file:-SecurityAuth.audit}.%i">
52+
filePattern="${sys:hbase.log.dir:-.}/${sys:hbase.security.log.file:-SecurityAuth.audit}.%i"
53+
createOnDemand="true">
5154
<PatternLayout pattern="%d{ISO8601} %-5p [%t] %c{2}: %.1000m%n" />
5255
<Policies>
5356
<SizeBasedTriggeringPolicy size="256MB" />
5457
</Policies>
5558
<DefaultRolloverStrategy max="20" />
5659
</RollingFile>
57-
<!-- Http Access Log RFA -->
60+
<!--
61+
Http Access Log RFA, uncomment this if you want an http access.log
5862
<RollingFile name="AccessRFA"
5963
fileName="/var/log/hbase/access.log"
60-
filePattern="/var/log/hbase/access.log.%i">
64+
filePattern="/var/log/hbase/access.log.%i"
65+
createOnDemand="true">
6166
<PatternLayout pattern="%m%n" />
6267
<Policies>
6368
<SizeBasedTriggeringPolicy size="200MB" />
6469
</Policies>
6570
<DefaultRolloverStrategy max="10" />
6671
</RollingFile>
72+
-->
6773
<Null name="NullAppender" />
6874
</Appenders>
6975
<Loggers>

hbase-archetypes/hbase-shaded-client-project/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@
5959
<groupId>org.apache.hbase</groupId>
6060
<artifactId>hbase-shaded-client</artifactId>
6161
</dependency>
62+
<dependency>
63+
<groupId>org.slf4j</groupId>
64+
<artifactId>jcl-over-slf4j</artifactId>
65+
<scope>runtime</scope>
66+
</dependency>
67+
<dependency>
68+
<groupId>org.slf4j</groupId>
69+
<artifactId>jul-to-slf4j</artifactId>
70+
<scope>runtime</scope>
71+
</dependency>
6272
<dependency>
6373
<groupId>org.apache.logging.log4j</groupId>
6474
<artifactId>log4j-api</artifactId>

hbase-archetypes/hbase-shaded-client-project/src/main/resources/log4j2.xml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
<!-- Daily Rolling File Appender -->
2828
<RollingFile name="DRFA"
2929
fileName="${sys:hbase.log.dir:-.}/${sys:hbase.log.file:-hbase.log}"
30-
filePattern="${sys:hbase.log.dir:-.}/${sys:hbase.log.file:-hbase.log}.%d{yyyy-MM-dd}">
30+
filePattern="${sys:hbase.log.dir:-.}/${sys:hbase.log.file:-hbase.log}.%d{yyyy-MM-dd}"
31+
createOnDemand="true">
3132
<PatternLayout pattern="%d{ISO8601} %-5p [%t] %c{2}: %.1000m%n" />
3233
<Policies>
3334
<TimeBasedTriggeringPolicy interval="1" />
@@ -37,7 +38,8 @@
3738
<!-- Rolling File Appender -->
3839
<RollingFile name="RFA"
3940
fileName="${sys:hbase.log.dir:-.}/${sys:hbase.log.file:-hbase.log}"
40-
filePattern="${sys:hbase.log.dir:-.}/${sys:hbase.log.file:-hbase.log}.%i">
41+
filePattern="${sys:hbase.log.dir:-.}/${sys:hbase.log.file:-hbase.log}.%i"
42+
createOnDemand="true">
4143
<PatternLayout pattern="%d{ISO8601} %-5p [%t] %c{2}: %.1000m%n" />
4244
<Policies>
4345
<SizeBasedTriggeringPolicy size="256MB" />
@@ -47,23 +49,27 @@
4749
<!-- Security audit appender -->
4850
<RollingFile name="RFAS"
4951
fileName="${sys:hbase.log.dir:-.}/${sys:hbase.security.log.file:-SecurityAuth.audit}"
50-
filePattern="${sys:hbase.log.dir:-.}/${sys:hbase.security.log.file:-SecurityAuth.audit}.%i">
52+
filePattern="${sys:hbase.log.dir:-.}/${sys:hbase.security.log.file:-SecurityAuth.audit}.%i"
53+
createOnDemand="true">
5154
<PatternLayout pattern="%d{ISO8601} %-5p [%t] %c{2}: %.1000m%n" />
5255
<Policies>
5356
<SizeBasedTriggeringPolicy size="256MB" />
5457
</Policies>
5558
<DefaultRolloverStrategy max="20" />
5659
</RollingFile>
57-
<!-- Http Access Log RFA -->
60+
<!--
61+
Http Access Log RFA, uncomment this if you want an http access.log
5862
<RollingFile name="AccessRFA"
5963
fileName="/var/log/hbase/access.log"
60-
filePattern="/var/log/hbase/access.log.%i">
64+
filePattern="/var/log/hbase/access.log.%i"
65+
createOnDemand="true">
6166
<PatternLayout pattern="%m%n" />
6267
<Policies>
6368
<SizeBasedTriggeringPolicy size="200MB" />
6469
</Policies>
6570
<DefaultRolloverStrategy max="10" />
6671
</RollingFile>
72+
-->
6773
<Null name="NullAppender" />
6874
</Appenders>
6975
<Loggers>

hbase-assembly/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,5 +347,11 @@
347347
<groupId>org.apache.logging.log4j</groupId>
348348
<artifactId>log4j-1.2-api</artifactId>
349349
</dependency>
350+
<!-- Include OpenTelemetry agent -->
351+
<dependency>
352+
<groupId>io.opentelemetry.javaagent</groupId>
353+
<artifactId>opentelemetry-javaagent</artifactId>
354+
<classifier>all</classifier>
355+
</dependency>
350356
</dependencies>
351357
</project>

0 commit comments

Comments
 (0)