flume-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpe...@apache.org
Subject git commit: FLUME-1735. Add support for a plugins.d directory.
Date Wed, 19 Dec 2012 23:18:24 GMT
Updated Branches:
  refs/heads/flume-1.4 311fdff5d -> ce5f8847c


FLUME-1735. Add support for a plugins.d directory.

(Brock Noland via Mike Percy)


Project: http://git-wip-us.apache.org/repos/asf/flume/repo
Commit: http://git-wip-us.apache.org/repos/asf/flume/commit/ce5f8847
Tree: http://git-wip-us.apache.org/repos/asf/flume/tree/ce5f8847
Diff: http://git-wip-us.apache.org/repos/asf/flume/diff/ce5f8847

Branch: refs/heads/flume-1.4
Commit: ce5f8847cec04b87b7df5ab665a01e555112a0a2
Parents: 311fdff
Author: Mike Percy <mpercy@apache.org>
Authored: Wed Dec 19 15:17:24 2012 -0800
Committer: Mike Percy <mpercy@apache.org>
Committed: Wed Dec 19 15:18:05 2012 -0800

----------------------------------------------------------------------
 bin/flume-ng |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flume/blob/ce5f8847/bin/flume-ng
----------------------------------------------------------------------
diff --git a/bin/flume-ng b/bin/flume-ng
index 31f62ef..4fd1503 100755
--- a/bin/flume-ng
+++ b/bin/flume-ng
@@ -333,6 +333,45 @@ else
   FLUME_CLASSPATH="${FLUME_HOME}/lib/*"
 fi
 
+# load plugins.d
+unset plugin_lib plugin_libext plugin_native
+PLUGINS_DIR=${FLUME_HOME}/plugins.d
+if [[ -d ${PLUGINS_DIR} ]]
+then
+  for plugin in ${PLUGINS_DIR}/*
+  do
+    if [[ -d $plugin/lib ]]
+    then
+      plugin_lib="${plugin_lib}${plugin_lib+:}${plugin}/lib/*"
+    fi 
+    if [[ -d $plugin/libext ]]
+    then
+      plugin_libext="${plugin_libext}${plugin_libext+:}${plugin}/libext/*"
+    fi 
+    if [[ -d $plugin/native ]]
+    then
+      plugin_native="${plugin_native}${plugin_native+:}${plugin}/native"
+    fi 
+  done
+fi
+if [[ -n "${plugin_lib}" ]]
+then
+  FLUME_CLASSPATH="${FLUME_CLASSPATH}:${plugin_lib}"
+fi
+if [[ -n "${plugin_libext}" ]]
+then
+  FLUME_CLASSPATH="${FLUME_CLASSPATH}:${plugin_libext}"
+fi
+if [[ -n "${plugin_native}" ]]
+then
+  if [[ -n "${FLUME_JAVA_LIBRARY_PATH}" ]]
+  then
+    FLUME_JAVA_LIBRARY_PATH="${FLUME_JAVA_LIBRARY_PATH}:${plugin_native}"
+  else
+    FLUME_JAVA_LIBRARY_PATH="${plugin_native}"
+  fi
+fi
+
 # find java
 if [ -z "${JAVA_HOME}" ] ; then
   warn "JAVA_HOME is not set!"


Mime
View raw message