Skip to content

Commit

Permalink
FLUME-2913. Don't strip SLF4J from imported classpaths
Browse files Browse the repository at this point in the history
It is no longer necessary to strip other versions of SLF4J from
classpaths imported from hadoop or hbase. With recent versions of SLF4J,
when multiple connectors are found, one of them "wins" and the logging
does not break. A warning is printed once, however. This is acceptable
because having too long of a classpath can cause major problems on
systems with a low ARG_MAX.

(Bessenyei Balázs Donát via Mike Percy)
  • Loading branch information
mpercy committed May 27, 2016
1 parent 37ddd1b commit f4f15be
Showing 1 changed file with 2 additions and 29 deletions.
31 changes: 2 additions & 29 deletions bin/flume-ng
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,7 @@ add_hadoop_paths() {
# determine hadoop classpath
HADOOP_CLASSPATH=$($HADOOP_IN_PATH classpath)

# hack up and filter hadoop classpath
local ELEMENTS=$(sed -e 's/:/ /g' <<<${HADOOP_CLASSPATH})
local ELEMENT
for ELEMENT in $ELEMENTS; do
local PIECE
for PIECE in $(echo $ELEMENT); do
if [[ $PIECE =~ slf4j-(api|log4j12).*\.jar ]]; then
info "Excluding $PIECE from classpath"
continue
else
FLUME_CLASSPATH="$FLUME_CLASSPATH:$PIECE"
fi
done
done

FLUME_CLASSPATH="$FLUME_CLASSPATH:$HADOOP_CLASSPATH"
fi
}
add_HBASE_paths() {
Expand Down Expand Up @@ -142,20 +128,7 @@ add_HBASE_paths() {
# determine HBASE classpath
HBASE_CLASSPATH=$($HBASE_IN_PATH classpath)

# hack up and filter HBASE classpath
local ELEMENTS=$(sed -e 's/:/ /g' <<<${HBASE_CLASSPATH})
local ELEMENT
for ELEMENT in $ELEMENTS; do
local PIECE
for PIECE in $(echo $ELEMENT); do
if [[ $PIECE =~ slf4j-(api|log4j12).*\.jar ]]; then
info "Excluding $PIECE from classpath"
continue
else
FLUME_CLASSPATH="$FLUME_CLASSPATH:$PIECE"
fi
done
done
FLUME_CLASSPATH="$FLUME_CLASSPATH:$HBASE_CLASSPATH"
FLUME_CLASSPATH="$FLUME_CLASSPATH:$HBASE_HOME/conf"

fi
Expand Down

0 comments on commit f4f15be

Please sign in to comment.