You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eagle.apache.org by ha...@apache.org on 2016/04/12 09:15:36 UTC
[1/2] incubator-eagle git commit: EAGLE-232 Fix alert engine related
bugs,
and create local Kafka/Zookeeper/Storm tools for quick-start examples and
development
Repository: incubator-eagle
Updated Branches:
refs/heads/master 8e338fea1 -> 60325aa2f
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-devsupport/build.sh
----------------------------------------------------------------------
diff --git a/eagle-devsupport/build.sh b/eagle-devsupport/build.sh
new file mode 100755
index 0000000..4e41f3e
--- /dev/null
+++ b/eagle-devsupport/build.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+cd $(dirname $0)/../
+mvn clean install -DskipTests
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-devsupport/clean-all-services.sh
----------------------------------------------------------------------
diff --git a/eagle-devsupport/clean-all-services.sh b/eagle-devsupport/clean-all-services.sh
new file mode 100755
index 0000000..20e2b3f
--- /dev/null
+++ b/eagle-devsupport/clean-all-services.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+echo "Stopping all service ..."
+$(dirname $0)/stop-all-services.sh
+echo "Cleaning tmp files (including local db, zookeeper data, kafka log, etc.) ..."
+rm -rf /tmp/eagle-*
+echo "Done."
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-devsupport/eclipse-java-templates.xml
----------------------------------------------------------------------
diff --git a/eagle-devsupport/eclipse-java-templates.xml b/eagle-devsupport/eclipse-java-templates.xml
new file mode 100644
index 0000000..8ccc558
--- /dev/null
+++ b/eagle-devsupport/eclipse-java-templates.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><templates><template autoinsert="false" context="newtype_context" deleted="false" description="Newly created files" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.newtype" name="newtype">/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+${package_declaration}
+
+${typecomment}
+${type_declaration}</template></templates>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-devsupport/eclipse-scala-templates.xml
----------------------------------------------------------------------
diff --git a/eagle-devsupport/eclipse-scala-templates.xml b/eagle-devsupport/eclipse-scala-templates.xml
new file mode 100644
index 0000000..55ce31a
--- /dev/null
+++ b/eagle-devsupport/eclipse-scala-templates.xml
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><templates><template autoinsert="true" context="org.scala-ide.sdt.core.templates" deleted="false" description="New App template for the new file wizard" enabled="true" id="org.scalaide.core.templates.wizards.app" name="wizard_app">/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+${package_name}
+
+object ${type_name} extends App {
+ ${cursor}
+}</template><template autoinsert="true" context="org.scala-ide.sdt.core.templates" deleted="false" description="New class template for the new file wizard" enabled="true" id="org.scalaide.core.templates.wizards.class" name="wizard_class">/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+${package_name}
+
+class ${type_name} {
+ ${cursor}
+}</template><template autoinsert="true" context="org.scala-ide.sdt.core.templates" deleted="false" description="New empty file template for the new file wizard" enabled="true" id="org.scalaide.core.templates.wizards.empty" name="wizard_empty">/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ </template><template autoinsert="true" context="org.scala-ide.sdt.core.templates" deleted="false" description="New object template for the new file wizard" enabled="true" id="org.scalaide.core.templates.wizards.object" name="wizard_object">/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+${package_name}
+
+object ${type_name} {
+ ${cursor}
+}</template><template autoinsert="true" context="org.scala-ide.sdt.core.templates" deleted="false" description="New package object template for the new file wizard" enabled="true" id="org.scalaide.core.templates.wizards.packageObject" name="wizard_package_object">/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+${package_name}
+
+package object ${type_name} {
+ ${cursor}
+}</template><template autoinsert="true" context="org.scala-ide.sdt.core.templates" deleted="false" description="New trait template for the new file wizard" enabled="true" id="org.scalaide.core.templates.wizards.trait" name="wizard_trait">/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+${package_name}
+
+trait ${type_name} {
+ ${cursor}
+}</template></templates>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-devsupport/start-webservice.sh
----------------------------------------------------------------------
diff --git a/eagle-devsupport/start-webservice.sh b/eagle-devsupport/start-webservice.sh
new file mode 100755
index 0000000..fc91f7a
--- /dev/null
+++ b/eagle-devsupport/start-webservice.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+export EAGLE_BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.."
+export EAGLE_BUILD_DIR=${EAGLE_BASE_DIR}/eagle-assembly/target/eagle-*-bin/eagle-*/
+
+ls ${EAGLE_BUILD_DIR} 1>/dev/null 2>/dev/null
+if [ "$?" != "0" ];then
+ echo "$EAGLE_BUILD_DIR not exist, build now"
+ cd $EAGLE_BASE_DIR
+ mvn package -DskipTests
+fi
+
+cd $EAGLE_BUILD_DIR/
+
+bin/eagle-service.sh status
+
+if [ "$?" != "0" ];then
+ echo "Starting eagle service ..."
+ bin/eagle-service.sh start
+ sleep 1
+else
+ echo "Eagle service has already started"
+fi
+
+bin/eagle-topology-init.sh
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-devsupport/start-zk-kafka-webservice.sh
----------------------------------------------------------------------
diff --git a/eagle-devsupport/start-zk-kafka-webservice.sh b/eagle-devsupport/start-zk-kafka-webservice.sh
new file mode 100755
index 0000000..61313c0
--- /dev/null
+++ b/eagle-devsupport/start-zk-kafka-webservice.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+export EAGLE_BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.."
+export EAGLE_BUILD_DIR=${EAGLE_BASE_DIR}/eagle-assembly/target/eagle-*-bin/eagle-*/
+
+ls ${EAGLE_BUILD_DIR} 1>/dev/null 2>/dev/null
+if [ "$?" != "0" ];then
+ echo "$EAGLE_BUILD_DIR not exist, build now"
+ cd $EAGLE_BASE_DIR
+ mvn package -DskipTests
+fi
+
+cd $EAGLE_BUILD_DIR/
+
+bin/eagle-service.sh status
+
+if [ "$?" != "0" ];then
+ echo "Starting eagle service ..."
+ bin/eagle-service.sh start
+ sleep 1
+else
+ echo "Eagle service has already started"
+fi
+
+bin/eagle-topology-init.sh
+
+echo "Starting zookeeper"
+bin/zookeeper-server-start.sh -daemon conf/zookeeper-server.properties
+sleep 1
+bin/zookeeper-server-status.sh
+
+echo "Starting kafka"
+bin/kafka-server-start.sh -daemon conf/kafka-server.properties
+sleep 1
+bin/kafka-server-status.sh
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-devsupport/start-zk-kafka.sh
----------------------------------------------------------------------
diff --git a/eagle-devsupport/start-zk-kafka.sh b/eagle-devsupport/start-zk-kafka.sh
new file mode 100755
index 0000000..17d8515
--- /dev/null
+++ b/eagle-devsupport/start-zk-kafka.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+export EAGLE_BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.."
+export EAGLE_BUILD_DIR=${EAGLE_BASE_DIR}/eagle-assembly/target/eagle-*-bin/eagle-*/
+
+ls ${EAGLE_BUILD_DIR} 1>/dev/null 2>/dev/null
+if [ "$?" != "0" ];then
+ echo "$EAGLE_BUILD_DIR not exist, build now"
+ cd $EAGLE_BASE_DIR
+ mvn package -DskipTests
+fi
+
+cd $EAGLE_BUILD_DIR/
+
+echo "Starting zookeeper"
+bin/zookeeper-server-start.sh -daemon conf/zookeeper-server.properties
+sleep 1
+bin/zookeeper-server-status.sh
+
+echo "Starting kafka"
+bin/kafka-server-start.sh -daemon conf/kafka-server.properties
+sleep 1
+bin/kafka-server-status.sh
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-devsupport/stop-all-services.sh
----------------------------------------------------------------------
diff --git a/eagle-devsupport/stop-all-services.sh b/eagle-devsupport/stop-all-services.sh
new file mode 100755
index 0000000..78b776d
--- /dev/null
+++ b/eagle-devsupport/stop-all-services.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+export EAGLE_BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/../
+export EAGLE_BUILD_DIR=${EAGLE_BASE_DIR}/eagle-assembly/target/eagle-*-bin/eagle-*/
+chmod +x $EAGLE_BASE_DIR/eagle-assembly/src/main/bin/*
+
+echo "Stopping eagle service"
+ls ${EAGLE_BUILD_DIR} 1>/dev/null 2>/dev/null
+if [ "$?" != "0" ];then
+ echo "$EAGLE_BUILD_DIR not exist, do nothing"
+else
+ $EAGLE_BUILD_DIR/bin/eagle-service.sh stop
+fi
+echo "Stopping zookeeper"
+$EAGLE_BASE_DIR/eagle-assembly/src/main/bin/kafka-server-stop.sh
+echo "Stopping kafka"
+$EAGLE_BASE_DIR/eagle-assembly/src/main/bin/zookeeper-server-stop.sh
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-examples/eagle-cassandra-example/.gitignore
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-cassandra-example/.gitignore b/eagle-examples/eagle-cassandra-example/.gitignore
new file mode 100644
index 0000000..cdfb689
--- /dev/null
+++ b/eagle-examples/eagle-cassandra-example/.gitignore
@@ -0,0 +1,2 @@
+*.log
+data/eagle
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-examples/eagle-cassandra-example/README.md
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-cassandra-example/README.md b/eagle-examples/eagle-cassandra-example/README.md
new file mode 100644
index 0000000..15bf757
--- /dev/null
+++ b/eagle-examples/eagle-cassandra-example/README.md
@@ -0,0 +1,43 @@
+<!--
+{% comment %}
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to you under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+{% endcomment %}
+-->
+
+Cassandra Security Monitoring Example
+=====================================
+
+How to Start
+------------
+1. Quickly start all services including zookeeper, kafka, webservice and topology with single script
+
+ bin/quick-start.sh
+
+2. Visit eagle web at [http://localhost:9099/eagle-service](http://localhost:9099/eagle-service/ui/#/common/policyList)
+
+3. Send sample data in another terminal with:
+
+ bin/send-sample-querylog.sh
+
+4. Visit alert page at [http://localhost:9099/eagle-service/ui/#/common/alertList](http://localhost:9099/eagle-service/ui/#/common/alertList)
+
+FAQ
+---
+#### 1. UNKNOWN_TOPIC_OR_PARTITION
+
+> storm.kafka.FailedFetchException: Error fetching data from [Partition{host=localhost:6667, partition=2}] for topic [cassandra_querylog_local]: [UNKNOWN_TOPIC_OR_PARTITION]
+
+__Solution__: Execute `eagle-devsupport/clean-all.sh` and retry from first step.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-examples/eagle-cassandra-example/bin/env.sh
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-cassandra-example/bin/env.sh b/eagle-examples/eagle-cassandra-example/bin/env.sh
new file mode 100755
index 0000000..cae44c8
--- /dev/null
+++ b/eagle-examples/eagle-cassandra-example/bin/env.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# The java implementation to use. please use jdk 1.7 or later
+# export JAVA_HOME=${JAVA_HOME}
+# export JAVA_HOME=/usr/java/jdk1.7.0_80/
+
+# EAGLE_SERVICE_HOST, default is `hostname -f`
+export EAGLE_SERVICE_HOST=localhost
+
+# EAGLE_SERVICE_PORT, default is 9099
+export EAGLE_SERVICE_PORT=9099
+
+# EAGLE_SERVICE_USER
+export EAGLE_SERVICE_USER=admin
+
+# EAGLE_SERVICE_PASSWORD
+export EAGLE_SERVICE_PASSWD=secret
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-examples/eagle-cassandra-example/bin/init.sh
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-cassandra-example/bin/init.sh b/eagle-examples/eagle-cassandra-example/bin/init.sh
new file mode 100755
index 0000000..ec98c3e
--- /dev/null
+++ b/eagle-examples/eagle-cassandra-example/bin/init.sh
@@ -0,0 +1,278 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+source $(dirname $0)/env.sh
+
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=SiteApplicationService" \
+ -d '
+ [
+ {
+ "tags":{
+ "site":"sandbox",
+ "application":"cassandraQueryLog"
+ },
+ "enabled": true,
+ "config": "{}"
+ }
+ ]
+ '
+
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=ApplicationDescService" \
+ -d '
+ [
+ {
+ "tags":{
+ "application":"cassandraQueryLog"
+ },
+ "description":"cassandra Query Log Monitoring",
+ "alias":"QueryLogMonitor",
+ "groupName":"Cassandra",
+ "config":"{}",
+ "features":["common","metadata"]
+ }
+ ]
+ '
+## AlertStreamService
+echo ""
+echo "Importing AlertStreamService for HDFS... "
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamService" \
+ -d '
+ [
+ {
+ "tags":{
+ "application":"cassandraQueryLog",
+ "streamName":"cassandraQueryLogStream"
+ },
+ "description":"cassandra query log data source stream"
+ }
+ ]
+ '
+## AlertExecutorService: what alert streams are consumed by alert executor
+echo ""
+echo "Importing AlertExecutorService for HDFS... "
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertExecutorService" \
+ -d '
+ [
+ {
+ "tags":{
+ "application":"cassandraQueryLog",
+ "alertExecutorId":"cassandraQueryLogExecutor",
+ "streamName":"cassandraQueryLogStream"
+ },
+ "description":"executor for cassandra query log stream"
+ }
+ ]
+ '
+## AlertStreamSchemaService: schema for event from alert stream
+echo ""
+echo "Importing AlertStreamSchemaService for HDFS... "
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+"http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamSchemaService" \
+ -d '
+ [
+ {
+ "tags": {
+ "application": "cassandraQueryLog",
+ "streamName": "cassandraQueryLogStream",
+ "attrName": "host"
+ },
+ "attrDescription": "the host that current metric comes form",
+ "attrType": "string",
+ "category": "",
+ "attrValueResolver": ""
+ },
+ {
+ "tags": {
+ "application": "cassandraQueryLog",
+ "streamName": "cassandraQueryLogStream",
+ "attrName": "source"
+ },
+ "attrDescription": "source host",
+ "attrType": "string",
+ "category": "",
+ "attrValueResolver": ""
+ },
+ {
+ "tags": {
+ "application": "cassandraQueryLog",
+ "streamName": "cassandraQueryLogStream",
+ "attrName": "user"
+ },
+ "attrDescription": "query user",
+ "attrType": "string",
+ "category": "",
+ "attrValueResolver": ""
+ },
+ {
+ "tags": {
+ "application": "cassandraQueryLog",
+ "streamName": "cassandraQueryLogStream",
+ "attrName": "timestamp"
+ },
+ "attrDescription": "query timestamp",
+ "attrType": "long",
+ "category": "",
+ "attrValueResolver": ""
+ },
+ {
+ "tags": {
+ "application": "cassandraQueryLog",
+ "streamName": "cassandraQueryLogStream",
+ "attrName": "category"
+ },
+ "attrDescription": "query category",
+ "attrType": "string",
+ "category": "",
+ "attrValueResolver": ""
+ },
+ {
+ "tags": {
+ "application": "cassandraQueryLog",
+ "streamName": "cassandraQueryLogStream",
+ "attrName": "type"
+ },
+ "attrDescription": "query type",
+ "attrType": "string",
+ "category": "",
+ "attrValueResolver": ""
+ },
+ {
+ "tags": {
+ "application": "cassandraQueryLog",
+ "streamName": "cassandraQueryLogStream",
+ "attrName": "ks"
+ },
+ "attrDescription": "query keyspace",
+ "attrType": "string",
+ "category": "",
+ "attrValueResolver": ""
+ },
+ {
+ "tags": {
+ "application": "cassandraQueryLog",
+ "streamName": "cassandraQueryLogStream",
+ "attrName": "cf"
+ },
+ "attrDescription": "query column family",
+ "attrType": "string",
+ "category": "",
+ "attrValueResolver": ""
+ },
+ {
+ "tags": {
+ "application": "cassandraQueryLog",
+ "streamName": "cassandraQueryLogStream",
+ "attrName": "operation"
+ },
+ "attrDescription": "query operation",
+ "attrType": "string",
+ "category": "",
+ "attrValueResolver": ""
+ },
+ {
+ "tags": {
+ "application": "cassandraQueryLog",
+ "streamName": "cassandraQueryLogStream",
+ "attrName": "masked_columns"
+ },
+ "attrDescription": "query masked_columns",
+ "attrType": "string",
+ "category": "",
+ "attrValueResolver": ""
+ },
+ {
+ "tags": {
+ "application": "cassandraQueryLog",
+ "streamName": "cassandraQueryLogStream",
+ "attrName": "other_columns"
+ },
+ "attrDescription": "query other_columns",
+ "attrType": "string",
+ "category": "",
+ "attrValueResolver": ""
+ }
+ ]
+ '
+
+echo "Importing policy: capacityUsedPolicy "
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertDefinitionService" \
+ -d '
+ [
+ {
+ "tags": {
+ "site": "sandbox",
+ "application": "cassandraQueryLog",
+ "policyId": "cf_ customer_details_and_ ks_ dg_keyspace_policy",
+ "alertExecutorId": "cassandraQueryLogExecutor",
+ "policyType": "siddhiCEPEngine"
+ },
+ "description": "Alert[cf_ customer_details_and_ ks_ dg_keyspace_policy]",
+ "policyDef": "{\"expression\":\"from cassandraQueryLogStream[(cf == \\\"customer_details\\\") and (ks == \\\"dg_keyspace\\\")] select * insert into outputStream;\",\"type\":\"siddhiCEPEngine\"}",
+ "dedupeDef": "{\"alertDedupIntervalMin\": 10,\"emailDedupIntervalMin\": 10}",
+ "notificationDef": "[{\"sender\":\"no-reply@eagle.incubator.apache.org\",\"recipients\":\"no-reply@eagle.incubator.apache.org\",\"subject\":\"Alert[cf_ customer_details_and_ ks_ dg_keyspace_policy]\",\"flavor\":\"email\",\"id\":\"email_1\",\"tplFileName\":\"\"}]",
+ "remediationDef": "",
+ "enabled": true,
+ "owner": "admin",
+ "severity": 0,
+ "markdownEnabled": false
+ }
+ ]'
+
+ ## AlertNotificationService : schema for notifcation plugin configuration
+echo ""
+echo "Importing notification plugin configurations ... "
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertNotificationService" \
+ -d '
+ [
+ {
+ "prefix": "alertNotifications",
+ "tags": {
+ "notificationType": "email"
+ },
+ "className": "org.apache.eagle.notification.plugin.AlertEmailPlugin",
+ "description": "send alert to email",
+ "enabled":true
+ },
+ {
+ "prefix": "alertNotifications",
+ "tags": {
+ "notificationType": "kafka"
+ },
+ "className": "org.apache.eagle.notification.plugin.AlertKafkaPlugin",
+ "description": "send alert to kafka bus",
+ "enabled":true
+ },
+ {
+ "prefix": "alertNotifications",
+ "tags": {
+ "notificationType": "eagleStore"
+ },
+ "className": "org.apache.eagle.notification.plugin.AlertEagleStorePlugin",
+ "description": "send alert to eagle store",
+ "enabled":true
+ }
+ ]
+ '
+
+## Finished
+echo ""
+echo "Done."
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-examples/eagle-cassandra-example/bin/quick-start.sh
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-cassandra-example/bin/quick-start.sh b/eagle-examples/eagle-cassandra-example/bin/quick-start.sh
new file mode 100755
index 0000000..9981ac0
--- /dev/null
+++ b/eagle-examples/eagle-cassandra-example/bin/quick-start.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+export EAGLE_CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+export EAGLE_BASE_DIR=$EAGLE_CURRENT_DIR/../../..
+export EAGLE_ASSEMBLY_DIR=${EAGLE_BASE_DIR}/eagle-assembly/target/eagle-*-bin/eagle-*/
+
+ls ${EAGLE_ASSEMBLY_DIR} 1>/dev/null 2>/dev/null
+if [ "$?" != "0" ];then
+ echo "$EAGLE_ASSEMBLY_DIR not exist, build now"
+ cd $EAGLE_BASE_DIR
+ mvn package -DskipTests
+fi
+
+cd $EAGLE_ASSEMBLY_DIR/
+
+bin/eagle-service.sh status
+
+if [ "$?" != "0" ];then
+ echo "Starting eagle service ..."
+ bin/eagle-service.sh start
+ sleep 1
+else
+ echo "Eagle service has already started"
+fi
+
+bin/eagle-topology-init.sh
+
+echo "Starting zookeeper"
+bin/zookeeper-server-start.sh -daemon conf/zookeeper-server.properties
+sleep 1
+
+echo "Starting kafka"
+bin/kafka-server-start.sh -daemon conf/kafka-server.properties
+sleep 1
+
+echo "Creating kafka topic: cassandra_querylog_local"
+bin/kafka-topics.sh --zookeeper localhost:2181 --create --topic cassandra_querylog_local --partitions 3 --replication-factor 1
+
+$EAGLE_CURRENT_DIR/init.sh
+$EAGLE_CURRENT_DIR/send-sample-querylog.sh
+$EAGLE_ASSEMBLY_DIR/bin/kafka-stream-monitor.sh cassandraQueryLogStream cassandraQueryLogExecutor $EAGLE_CURRENT_DIR/../conf/cassandra-security-local.conf
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-examples/eagle-cassandra-example/bin/send-sample-querylog.sh
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-cassandra-example/bin/send-sample-querylog.sh b/eagle-examples/eagle-cassandra-example/bin/send-sample-querylog.sh
new file mode 100755
index 0000000..99d81f6
--- /dev/null
+++ b/eagle-examples/eagle-cassandra-example/bin/send-sample-querylog.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the \"License\"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an \"AS IS\" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+export EAGLE_BASE_DIR=$(dirname $0)/../../../
+export EAGLE_BUILD_DIR=${EAGLE_BASE_DIR}/eagle-assembly/target/eagle-*-bin/eagle-*/
+cd $EAGLE_BUILD_DIR/
+CMD="$(pwd)/bin/kafka-producer.sh --broker-list localhost:6667 --topic cassandra_querylog_local \
+ --data {\"host\":\"/192.168.6.227\",\"source\":\"/192.168.6.227\",\"user\":\"jaspa\",\"timestamp\":1455574202864,\"category\":\"QUERY\",\"type\":\"CQL_SELECT\",\"ks\":\"dg_keyspace\",\"cf\":\"customer_details\",\"operation\":\"CQL_SELECT\",\"masked_columns\":\"bank|ccno|email|ip|name|sal|ssn|tel|url\",\"other_columns\":\"id|npi\"}"
+
+echo "=============="
+echo "Execute: $CMD"
+echo "=============="
+exec $CMD
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-examples/eagle-cassandra-example/conf/cassandra-security-local.conf
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-cassandra-example/conf/cassandra-security-local.conf b/eagle-examples/eagle-cassandra-example/conf/cassandra-security-local.conf
new file mode 100644
index 0000000..bbf6da6
--- /dev/null
+++ b/eagle-examples/eagle-cassandra-example/conf/cassandra-security-local.conf
@@ -0,0 +1,69 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{
+ "envContextConfig" : {
+ "env" : "storm",
+ "mode" : "local",
+ "topologyName" : "cassandrawQueryLogMonitorTopology",
+ "stormConfigFile" : "cassandraw-querlog-storm.yaml",
+ "parallelismConfig" : {
+ "cassandraQueryLogStream" : 1,
+ "cassandraQueryLogExecutor*" : 1
+ }
+ },
+ "dataSourceConfig": {
+ "topic" : "cassandra_querylog_local",
+ "zkConnection" : "localhost:2181",
+ "zkConnectionTimeoutMS" : 15000,
+ "consumerGroupId" : "eagle.consumer",
+ "fetchSize" : 1048586,
+ "deserializerClass" : "org.apache.eagle.datastream.storm.JsonMessageDeserializer",
+ "transactionZKServers" : "localhost",
+ "transactionZKPort" : 2181,
+ "transactionZKRoot" : "/consumers",
+ "transactionStateUpdateMS" : 2000
+ },
+ "alertExecutorConfigs" : {
+ "cassandraQueryLogExecutor" : {
+ "parallelism" : 1,
+ "partitioner" : "org.apache.eagle.policy.DefaultPolicyPartitioner"
+ "needValidation" : "true"
+ }
+ },
+ "eagleProps" : {
+ "site" : "sandbox",
+ "application": "cassandraQueryLog",
+ "dataJoinPollIntervalSec" : 30,
+ "mailHost" : "mailHost.com",
+ "mailSmtpPort":"25",
+ "mailDebug" : "true",
+ "balancePartitionEnabled" : true,
+ #"partitionRefreshIntervalInMin" : 60,
+ #"kafkaStatisticRangeInMin" : 60,
+ "eagleService": {
+ "host": "localhost",
+ "port": 9099,
+ "username": "admin",
+ "password": "secret"
+ }
+ "readHdfsUserCommandPatternFrom" : "file"
+ },
+ "dynamicConfigSource" : {
+ "enabled" : true,
+ "initDelayMillis" : 0,
+ "delayMillis" : 30000
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-examples/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-examples/pom.xml b/eagle-examples/pom.xml
index 61bf948..2869319 100644
--- a/eagle-examples/pom.xml
+++ b/eagle-examples/pom.xml
@@ -30,6 +30,4 @@
<modules>
<module>eagle-topology-example</module>
</modules>
-
-
</project>
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-external/eagle-kafka/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-external/eagle-kafka/pom.xml b/eagle-external/eagle-kafka/pom.xml
new file mode 100644
index 0000000..1758b13
--- /dev/null
+++ b/eagle-external/eagle-kafka/pom.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>eagle-external-parent</artifactId>
+ <groupId>org.apache.eagle</groupId>
+ <version>0.3.0-incubating</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>eagle-kafka</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.kafka</groupId>
+ <artifactId>kafka-clients</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.kafka</groupId>
+ <artifactId>kafka_${scala.version}</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.scalatest</groupId>
+ <artifactId>scalatest_${scala.version}</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <sourceDirectory>src/main/scala</sourceDirectory>
+ <plugins>
+ <plugin>
+ <groupId>org.scala-tools</groupId>
+ <artifactId>maven-scala-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>compile</goal>
+ <goal>testCompile</goal>
+ </goals>
+ <configuration>
+ <args>
+ <arg>-make:transitive</arg>
+ <arg>-dependencyfile</arg>
+ <arg>${project.build.directory}/.scala_dependencies</arg>
+ </args>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <useFile>false</useFile>
+ <disableXmlReport>true</disableXmlReport>
+ <includes>
+ <include>**/*Test.*</include>
+ <include>**/Test*.*</include>
+ <include>**/*Suite.*</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-external/eagle-kafka/src/main/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/eagle-external/eagle-kafka/src/main/resources/log4j.properties b/eagle-external/eagle-kafka/src/main/resources/log4j.properties
new file mode 100644
index 0000000..d59ded6
--- /dev/null
+++ b/eagle-external/eagle-kafka/src/main/resources/log4j.properties
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+log4j.rootLogger=INFO, stdout
+
+# standard output
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %p [%t] %c{2}[%L]: %m%n
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-external/eagle-kafka/src/main/scala/org/apache/eagle/contrib/kafka/ProducerTool.scala
----------------------------------------------------------------------
diff --git a/eagle-external/eagle-kafka/src/main/scala/org/apache/eagle/contrib/kafka/ProducerTool.scala b/eagle-external/eagle-kafka/src/main/scala/org/apache/eagle/contrib/kafka/ProducerTool.scala
new file mode 100644
index 0000000..7b6b7a3
--- /dev/null
+++ b/eagle-external/eagle-kafka/src/main/scala/org/apache/eagle/contrib/kafka/ProducerTool.scala
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.eagle.contrib.kafka
+
+import java.io._
+import java.nio.charset.StandardCharsets
+import java.util.Properties
+
+import joptsimple._
+import kafka.message._
+import kafka.producer.ConsoleProducer.{MessageReader, LineMessageReader}
+import kafka.producer.{KeyedMessage, Producer, ProducerConfig}
+import kafka.serializer._
+import org.apache.commons.io.FileUtils
+
+import scala.collection.JavaConversions._
+
+object ProducerTool {
+ def main(args: Array[String]) {
+ val parser = new OptionParser
+ val topicOpt = parser.accepts("topic", "REQUIRED: The topic id to produce messages to.")
+ .withRequiredArg
+ .describedAs("topic")
+ .ofType(classOf[String])
+ val brokerListOpt = parser.accepts("broker-list", "REQUIRED: The broker list string in the form HOST1:PORT1,HOST2:PORT2.")
+ .withRequiredArg
+ .describedAs("broker-list")
+ .ofType(classOf[String])
+ val syncOpt = parser.accepts("sync", "If set message send requests to the brokers are synchronously, one at a time as they arrive.")
+ val compressOpt = parser.accepts("compress", "If set, messages batches are sent compressed")
+ val batchSizeOpt = parser.accepts("batch-size", "Number of messages to send in a single batch if they are not being sent synchronously.")
+ .withRequiredArg
+ .describedAs("size")
+ .ofType(classOf[java.lang.Integer])
+ .defaultsTo(200)
+ val messageSendMaxRetriesOpt = parser.accepts("message-send-max-retries", "Brokers can fail receiving the message for multiple reasons, and being unavailable transiently is just one of them. This property specifies the number of retires before the producer give up and drop this message.")
+ .withRequiredArg
+ .ofType(classOf[java.lang.Integer])
+ .defaultsTo(3)
+ val retryBackoffMsOpt = parser.accepts("retry-backoff-ms", "Before each retry, the producer refreshes the metadata of relevant topics. Since leader election takes a bit of time, this property specifies the amount of time that the producer waits before refreshing the metadata.")
+ .withRequiredArg
+ .ofType(classOf[java.lang.Long])
+ .defaultsTo(100l)
+ val sendTimeoutOpt = parser.accepts("timeout", "If set and the producer is running in asynchronous mode, this gives the maximum amount of time" +
+ " a message will queue awaiting suffient batch size. The value is given in ms.")
+ .withRequiredArg
+ .describedAs("timeout_ms")
+ .ofType(classOf[java.lang.Long])
+ .defaultsTo(1000l)
+ val queueSizeOpt = parser.accepts("queue-size", "If set and the producer is running in asynchronous mode, this gives the maximum amount of " +
+ " messages will queue awaiting suffient batch size.")
+ .withRequiredArg
+ .describedAs("queue_size")
+ .ofType(classOf[java.lang.Long])
+ .defaultsTo(10000l)
+ val queueEnqueueTimeoutMsOpt = parser.accepts("queue-enqueuetimeout-ms", "Timeout for event enqueue")
+ .withRequiredArg
+ .describedAs("queue enqueuetimeout ms")
+ .ofType(classOf[java.lang.Long])
+ .defaultsTo(Int.MaxValue.toLong)
+ val requestRequiredAcksOpt = parser.accepts("request-required-acks", "The required acks of the producer requests")
+ .withRequiredArg
+ .describedAs("request required acks")
+ .ofType(classOf[java.lang.Integer])
+ .defaultsTo(0)
+ val requestTimeoutMsOpt = parser.accepts("request-timeout-ms", "The ack timeout of the producer requests. Value must be non-negative and non-zero")
+ .withRequiredArg
+ .describedAs("request timeout ms")
+ .ofType(classOf[java.lang.Integer])
+ .defaultsTo(1500)
+ val valueEncoderOpt = parser.accepts("value-serializer", "The class name of the message encoder implementation to use for serializing values.")
+ .withRequiredArg
+ .describedAs("encoder_class")
+ .ofType(classOf[java.lang.String])
+ .defaultsTo(classOf[StringEncoder].getName)
+ val keyEncoderOpt = parser.accepts("key-serializer", "The class name of the message encoder implementation to use for serializing keys.")
+ .withRequiredArg
+ .describedAs("encoder_class")
+ .ofType(classOf[java.lang.String])
+ .defaultsTo(classOf[StringEncoder].getName)
+ val messageReaderOpt = parser.accepts("line-reader", "The class name of the class to use for reading lines from standard in. " +
+ "By default each line is read as a separate message.")
+ .withRequiredArg
+ .describedAs("reader_class")
+ .ofType(classOf[java.lang.String])
+ .defaultsTo(classOf[LineMessageReader].getName)
+ val socketBufferSizeOpt = parser.accepts("socket-buffer-size", "The size of the tcp RECV size.")
+ .withRequiredArg
+ .describedAs("size")
+ .ofType(classOf[java.lang.Integer])
+ .defaultsTo(1024 * 100)
+ val propertyOpt = parser.accepts("property", "A mechanism to pass user-defined properties in the form key=value to the message reader. " +
+ "This allows custom configuration for a user-defined message reader.")
+ .withRequiredArg
+ .describedAs("prop")
+ .ofType(classOf[String])
+
+ val dataOpt = parser.accepts("data", "Input message data content")
+ .withRequiredArg()
+ .describedAs("input message data")
+ .ofType(classOf[String])
+
+ val fileOpt = parser.accepts("file", "Input message file name")
+ .withRequiredArg()
+ .describedAs("input message file")
+ .ofType(classOf[String])
+
+ val options = parser.parse(args: _*)
+ for (arg <- List(topicOpt, brokerListOpt)) {
+ if (!options.has(arg)) {
+ System.err.println("Missing required argument \"" + arg + "\"")
+ parser.printHelpOn(System.err)
+ System.exit(1)
+ }
+ }
+
+ val topic = options.valueOf(topicOpt)
+ val brokerList = options.valueOf(brokerListOpt)
+ val sync = options.has(syncOpt)
+ val compress = options.has(compressOpt)
+ val batchSize = options.valueOf(batchSizeOpt)
+ val sendTimeout = options.valueOf(sendTimeoutOpt)
+ val queueSize = options.valueOf(queueSizeOpt)
+ val queueEnqueueTimeoutMs = options.valueOf(queueEnqueueTimeoutMsOpt)
+ val requestRequiredAcks = options.valueOf(requestRequiredAcksOpt)
+ val requestTimeoutMs = options.valueOf(requestTimeoutMsOpt)
+ val keyEncoderClass = options.valueOf(keyEncoderOpt)
+ val valueEncoderClass = options.valueOf(valueEncoderOpt)
+ val readerClass = options.valueOf(messageReaderOpt)
+ val socketBuffer = options.valueOf(socketBufferSizeOpt)
+ val cmdLineProps = parseLineReaderArgs(options.valuesOf(propertyOpt))
+ val messageData = options.valuesOf(dataOpt)
+ val messageFile = options.valuesOf(fileOpt)
+
+ cmdLineProps.put("topic", topic)
+ val props = new Properties()
+ props.put("metadata.broker.list", brokerList)
+ val codec = if (compress) DefaultCompressionCodec.codec else NoCompressionCodec.codec
+ props.put("compression.codec", codec.toString)
+ props.put("producer.type", if (sync) "sync" else "async")
+ if (options.has(batchSizeOpt))
+ props.put("batch.num.messages", batchSize.toString)
+
+ props.put("message.send.max.retries", options.valueOf(messageSendMaxRetriesOpt).toString)
+ props.put("retry.backoff.ms", options.valueOf(retryBackoffMsOpt).toString)
+ props.put("queue.buffering.max.ms", sendTimeout.toString)
+ props.put("queue.buffering.max.messages", queueSize.toString)
+ props.put("queue.enqueue.timeout.ms", queueEnqueueTimeoutMs.toString)
+ props.put("request.required.acks", requestRequiredAcks.toString)
+ props.put("request.timeout.ms", requestTimeoutMs.toString)
+ props.put("key.serializer.class", keyEncoderClass)
+ props.put("serializer.class", valueEncoderClass)
+ props.put("send.buffer.bytes", socketBuffer.toString)
+
+ val reader = Class.forName(readerClass).newInstance().asInstanceOf[MessageReader[AnyRef, AnyRef]]
+
+ if (messageData.size()>0) {
+ reader.init(new ByteArrayInputStream(messageData.get(0).getBytes(StandardCharsets.UTF_8)), cmdLineProps)
+ } else if (messageFile.size()>0) {
+ reader.init(FileUtils.openInputStream(new File(messageFile.get(0))), cmdLineProps)
+ } else {
+ reader.init(System.in, cmdLineProps)
+ }
+
+ try {
+ val producer = new Producer[AnyRef, AnyRef](new ProducerConfig(props))
+
+ Runtime.getRuntime.addShutdownHook(new Thread() {
+ override def run() {
+ producer.close()
+ }
+ })
+
+ var message: KeyedMessage[AnyRef, AnyRef] = null
+ do {
+ message = reader.readMessage()
+ if (message != null)
+ producer.send(message)
+ } while (message != null)
+ } catch {
+ case e: Exception =>
+ e.printStackTrace()
+ System.exit(1)
+ }
+ System.exit(0)
+ }
+
+ def parseLineReaderArgs(args: Iterable[String]): Properties = {
+ val splits = args.map(_ split "=").filterNot(_ == null).filterNot(_.length == 0)
+ if (!splits.forall(_.length == 2)) {
+ System.err.println("Invalid line reader properties: " + args.mkString(" "))
+ System.exit(1)
+ }
+ val props = new Properties
+ for (a <- splits)
+ props.put(a(0), a(1))
+ props
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-external/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-external/pom.xml b/eagle-external/pom.xml
index 4a16e68..2f9d30c 100644
--- a/eagle-external/pom.xml
+++ b/eagle-external/pom.xml
@@ -32,5 +32,6 @@
<modules>
<module>eagle-log4jkafka</module>
+ <module>eagle-kafka</module>
</modules>
</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-project-preference/eclipse-java-templates.xml
----------------------------------------------------------------------
diff --git a/eagle-project-preference/eclipse-java-templates.xml b/eagle-project-preference/eclipse-java-templates.xml
deleted file mode 100644
index 8ccc558..0000000
--- a/eagle-project-preference/eclipse-java-templates.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><templates><template autoinsert="false" context="newtype_context" deleted="false" description="Newly created files" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.newtype" name="newtype">/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-${package_declaration}
-
-${typecomment}
-${type_declaration}</template></templates>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-project-preference/eclipse-scala-templates.xml
----------------------------------------------------------------------
diff --git a/eagle-project-preference/eclipse-scala-templates.xml b/eagle-project-preference/eclipse-scala-templates.xml
deleted file mode 100644
index 55ce31a..0000000
--- a/eagle-project-preference/eclipse-scala-templates.xml
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><templates><template autoinsert="true" context="org.scala-ide.sdt.core.templates" deleted="false" description="New App template for the new file wizard" enabled="true" id="org.scalaide.core.templates.wizards.app" name="wizard_app">/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-${package_name}
-
-object ${type_name} extends App {
- ${cursor}
-}</template><template autoinsert="true" context="org.scala-ide.sdt.core.templates" deleted="false" description="New class template for the new file wizard" enabled="true" id="org.scalaide.core.templates.wizards.class" name="wizard_class">/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-${package_name}
-
-class ${type_name} {
- ${cursor}
-}</template><template autoinsert="true" context="org.scala-ide.sdt.core.templates" deleted="false" description="New empty file template for the new file wizard" enabled="true" id="org.scalaide.core.templates.wizards.empty" name="wizard_empty">/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- </template><template autoinsert="true" context="org.scala-ide.sdt.core.templates" deleted="false" description="New object template for the new file wizard" enabled="true" id="org.scalaide.core.templates.wizards.object" name="wizard_object">/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-${package_name}
-
-object ${type_name} {
- ${cursor}
-}</template><template autoinsert="true" context="org.scala-ide.sdt.core.templates" deleted="false" description="New package object template for the new file wizard" enabled="true" id="org.scalaide.core.templates.wizards.packageObject" name="wizard_package_object">/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-${package_name}
-
-package object ${type_name} {
- ${cursor}
-}</template><template autoinsert="true" context="org.scala-ide.sdt.core.templates" deleted="false" description="New trait template for the new file wizard" enabled="true" id="org.scalaide.core.templates.wizards.trait" name="wizard_trait">/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-${package_name}
-
-trait ${type_name} {
- ${cursor}
-}</template></templates>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-topology-assembly/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-topology-assembly/pom.xml b/eagle-topology-assembly/pom.xml
index 81649a3..7fc9875 100644
--- a/eagle-topology-assembly/pom.xml
+++ b/eagle-topology-assembly/pom.xml
@@ -58,6 +58,24 @@
<groupId>org.apache.eagle</groupId>
<artifactId>eagle-metric-collection</artifactId>
<version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.ow2.asm</groupId>
+ <artifactId>asm-all</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.ow2.asm</groupId>
+ <artifactId>asm</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>asm</groupId>
+ <artifactId>asm</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>asm</groupId>
+ <artifactId>asm-all</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.eagle</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-webservice/src/main/resources/application-hbase.conf
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/resources/application-hbase.conf b/eagle-webservice/src/main/resources/application-hbase.conf
new file mode 100644
index 0000000..680be0e
--- /dev/null
+++ b/eagle-webservice/src/main/resources/application-hbase.conf
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+eagle{
+ service{
+ storage-type="hbase"
+ hbase-zookeeper-quorum="localhost"
+ hbase-zookeeper-property-clientPort=2181
+ zookeeper-znode-parent="/hbase",
+ springActiveProfile="sandbox"
+ audit-enabled=true
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-webservice/src/main/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/resources/application.conf b/eagle-webservice/src/main/resources/application.conf
index 61a899f..ca936ed 100644
--- a/eagle-webservice/src/main/resources/application.conf
+++ b/eagle-webservice/src/main/resources/application.conf
@@ -16,13 +16,13 @@
eagle {
service {
storage-type="jdbc"
- storage-adapter="mysql"
+ storage-adapter="derby"
storage-username="eagle"
storage-password=eagle
storage-database=eagle
- storage-connection-url="jdbc:mysql://localhost:3306/eagle"
+ storage-connection-url="jdbc:derby:/tmp/eagle-db-dev;create=true"
storage-connection-props="encoding=UTF-8"
- storage-driver-class="com.mysql.jdbc.Driver"
+ storage-driver-class="org.apache.derby.jdbc.EmbeddedDriver"
storage-connection-max=8
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-webservice/src/main/resources/application.conf.bak
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/resources/application.conf.bak b/eagle-webservice/src/main/resources/application.conf.bak
deleted file mode 100644
index 680be0e..0000000
--- a/eagle-webservice/src/main/resources/application.conf.bak
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-eagle{
- service{
- storage-type="hbase"
- hbase-zookeeper-quorum="localhost"
- hbase-zookeeper-property-clientPort=2181
- zookeeper-znode-parent="/hbase",
- springActiveProfile="sandbox"
- audit-enabled=true
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 0d81c84..6caa824 100755
--- a/pom.xml
+++ b/pom.xml
@@ -182,6 +182,7 @@
<commons-httpclient.version>3.1</commons-httpclient.version>
<commons-beanutils.version>1.8.0</commons-beanutils.version>
<commons-collections4.version>4.0</commons-collections4.version>
+ <commons-io.version>2.4</commons-io.version>
<!-- Configuration -->
<archaius.version>0.6.1</archaius.version>
@@ -320,6 +321,11 @@
<version>${commons-dbcp.version}</version>
</dependency>
<dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>${commons-io.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-reflect</artifactId>
<version>${scala-reflect.version}</version>
[2/2] incubator-eagle git commit: EAGLE-232 Fix alert engine related
bugs,
and create local Kafka/Zookeeper/Storm tools for quick-start examples and
development
Posted by ha...@apache.org.
EAGLE-232 Fix alert engine related bugs, and create local Kafka/Zookeeper/Storm tools for quick-start examples and development
Bug Fix
----------
EAGLE-235 Conflicting setter definitions for property "alertContext"
EAGLE-229 java.lang.IncompatibleClassChangeError about `org.objectweb.asm.ClassVisitor`
EAGLE-228 org.apache.eagle.notification.plugin.NotificationPluginManagerImpl
EAGLE-227 java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/CursorableLinkedList$ListIter
EAGLE-224 Column not found to EAGLE_METRIC.SITE in jdbc
EAGLE-240 java.lang.ArrayIndexOutOfBoundsException thrown by MetricKeyCodeDecoder
Improvement
-----------
EAGLE-232 Create local Kafka/Zookeeper/Storm runner tools for
quick-start examples and add related scripts for zookeeper and kafka
EAGLE-225 Create eagle bootstrap scripts for examples like
[eagle-examples/cassandra-security-example/bin/quick-start.sh](https://github.com/haoch/incubator-eagle/blob/EAGLE-229/eagle-examples/cassandra-security-example/bin/quick-start.sh)
EAGLE-237 Add development tools for quickly starting zookeeper, kafka
and webservice without depending on sandbox:
~~~
build.sh start-webservice.sh
clean-all-services.sh start-zk-kafka-webservice.sh
eclipse-java-templates.xml start-zk-kafka.sh
eclipse-scala-templates.xml stop-all-services.sh
~~~
Commits
-------
EAGLE-225 Add eagle-examples/cassandra-security-example for quick start
https://issues.apache.org/jira/browse/EAGLE-225
EAGLE-230 Fix multiple setAlertContex methods in AlertAPIEntity
https://issues.apache.org/jira/browse/EAGLE-230
EAGLE-232 Improve ProducerTool to support send message from pipe, inline or file
EAGLE-224 Fix VARCHAR size (limited by 1024) error
EAGLE-232 Eagle eagle-external/eagle-devtools
EAGLE-232 Refactor eagle-project-preference and eagle-external/eagle-devtools into eagle-devtools
EAGLE-225 Update cassandra-security-example README
EAGLE-232 Package storm-core jar to avoid external dependencies
EAGLE-232 EAGLE-225 Fix cassandra-security-example/bin/quick-start.sh and add devtools for starting/stopping all services
EAGLE-225 Update README.md
EAGLE-232 EAGLE-225 Rename eagle-devsupport and eagle-examples/eagle-cassandra-example
EAGLE-240 Fix java.lang.ArrayIndexOutOfBoundsException thrown by MetricKeyCodeDecoder
EAGLE-237 Enhance development tools
Closes #142.
Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/60325aa2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/60325aa2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/60325aa2
Branch: refs/heads/master
Commit: 60325aa2fccc81d47a3f2e27799bb697a6b06381
Parents: 8e338fe
Author: Hao Chen <ha...@apache.org>
Authored: Mon Apr 11 16:11:30 2016 +0800
Committer: Hao Chen <ha...@apache.org>
Committed: Tue Apr 12 15:14:50 2016 +0800
----------------------------------------------------------------------
eagle-assembly/pom.xml | 6 +-
eagle-assembly/src/assembly/eagle-bin.xml | 26 +-
.../src/main/bin/eagle-create-table.rb | 0
.../src/main/bin/eagle-drop-tables.sh | 0
eagle-assembly/src/main/bin/eagle-env.sh | 11 +-
eagle-assembly/src/main/bin/eagle-run-class.sh | 115 ++++++++
.../src/main/bin/eagle-topology-init.sh | 48 ++--
.../src/main/bin/hadoop-metric-monitor.sh | 0
eagle-assembly/src/main/bin/kafka-producer.sh | 21 ++
.../src/main/bin/kafka-server-start.sh | 51 ++++
.../src/main/bin/kafka-server-status.sh | 24 ++
.../src/main/bin/kafka-server-stop.sh | 23 ++
.../src/main/bin/kafka-stream-monitor.sh | 10 +-
eagle-assembly/src/main/bin/kafka-topics.sh | 17 ++
.../src/main/bin/zookeeper-server-start.sh | 50 ++++
.../src/main/bin/zookeeper-server-status.sh | 24 ++
.../src/main/bin/zookeeper-server-stop.sh | 24 ++
eagle-assembly/src/main/conf/eagle-service.conf | 2 +-
.../src/main/conf/kafka-server.properties | 115 ++++++++
eagle-assembly/src/main/conf/log4j.properties | 4 +-
.../src/main/conf/tools-log4j.properties | 21 ++
.../src/main/conf/zookeeper-server.properties | 20 ++
.../eagle-alert-notification-plugin/pom.xml | 1 -
.../testcases/TestAlertEmailPlugin.java | 2 +-
eagle-core/eagle-metric/pom.xml | 8 +-
.../metric/reportor/MetricKeyCodeDecoder.java | 29 +-
.../eagle/alert/entity/AlertAPIEntity.java | 12 +-
.../eagle/log/entity/GenericMetricEntity.java | 2 +-
.../eagle/storage/jdbc/JdbcConstants.java | 2 +-
.../schema/JdbcEntityDefinitionManager.java | 2 +-
eagle-devsupport/build.sh | 18 ++
eagle-devsupport/clean-all-services.sh | 21 ++
eagle-devsupport/eclipse-java-templates.xml | 20 ++
eagle-devsupport/eclipse-scala-templates.xml | 117 ++++++++
eagle-devsupport/start-webservice.sh | 39 +++
eagle-devsupport/start-zk-kafka-webservice.sh | 49 ++++
eagle-devsupport/start-zk-kafka.sh | 37 +++
eagle-devsupport/stop-all-services.sh | 31 +++
.../eagle-cassandra-example/.gitignore | 2 +
.../eagle-cassandra-example/README.md | 43 +++
.../eagle-cassandra-example/bin/env.sh | 31 +++
.../eagle-cassandra-example/bin/init.sh | 278 +++++++++++++++++++
.../eagle-cassandra-example/bin/quick-start.sh | 55 ++++
.../bin/send-sample-querylog.sh | 26 ++
.../conf/cassandra-security-local.conf | 69 +++++
eagle-examples/pom.xml | 2 -
eagle-external/eagle-kafka/pom.xml | 95 +++++++
.../src/main/resources/log4j.properties | 21 ++
.../eagle/contrib/kafka/ProducerTool.scala | 213 ++++++++++++++
eagle-external/pom.xml | 1 +
.../eclipse-java-templates.xml | 20 --
.../eclipse-scala-templates.xml | 117 --------
eagle-topology-assembly/pom.xml | 18 ++
.../src/main/resources/application-hbase.conf | 25 ++
.../src/main/resources/application.conf | 6 +-
.../src/main/resources/application.conf.bak | 25 --
pom.xml | 6 +
57 files changed, 1825 insertions(+), 230 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-assembly/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-assembly/pom.xml b/eagle-assembly/pom.xml
index 89dfb5f..e62ca81 100644
--- a/eagle-assembly/pom.xml
+++ b/eagle-assembly/pom.xml
@@ -79,8 +79,12 @@
<artifactId>eagle-topology-assembly</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.ow2.asm</groupId>
+ <artifactId>asm</artifactId>
+ <version>4.0</version>
+ </dependency>
</dependencies>
-
<build>
<plugins>
<plugin>
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-assembly/src/assembly/eagle-bin.xml
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/assembly/eagle-bin.xml b/eagle-assembly/src/assembly/eagle-bin.xml
index 2a04fdc..141a6a7 100644
--- a/eagle-assembly/src/assembly/eagle-bin.xml
+++ b/eagle-assembly/src/assembly/eagle-bin.xml
@@ -151,7 +151,13 @@
<include>**</include>
</includes>
</fileSet>
-
+ <fileSet>
+ <directory>${project.basedir}/../eagle-external/eagle-kafka/target</directory>
+ <outputDirectory>lib/share</outputDirectory>
+ <includes>
+ <include>eagle-kafka-*.jar</include>
+ </includes>
+ </fileSet>
<fileSet>
<directory>${project.build.directory}/lib</directory>
<outputDirectory>lib/tomcat/lib</outputDirectory>
@@ -159,7 +165,6 @@
<include>tomcat*</include>
</includes>
</fileSet>
-
<fileSet>
<directory>${project.basedir}/../eagle-webservice/target/eagle-service</directory>
<outputDirectory>lib/tomcat/webapps/eagle-service</outputDirectory>
@@ -210,14 +215,18 @@
<include>scala-library-*</include>
<include>slf4j-*.jar</include>
<include>log4j-*.jar</include>
- <include>commons-math3-3.5.jar</include>
- <include>asm-3.1.jar</include>
+ <include>commons-math3-*.jar</include>
+ <include>slf4j-log4j12-*.jar</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>${project.basedir}/target/lib</directory>
+ <outputDirectory>lib/storm</outputDirectory>
+ <includes>
+ <include>storm-core-*.jar</include>
+ <include>asm-*.jar</include>
</includes>
- <excludes>
- <exclude>slf4j-log4j12-*.jar</exclude>
- </excludes>
</fileSet>
-
<fileSet>
<directory>${project.basedir}/../eagle-external/eagle-ambari</directory>
<outputDirectory>lib/ambari</outputDirectory>
@@ -225,7 +234,6 @@
<include>**</include>
</includes>
</fileSet>
-
<!-- copy hadoop metric configuration to assembly -->
<fileSet>
<directory>${project.basedir}/../eagle-hadoop-metric/src/main/resources</directory>
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-assembly/src/main/bin/eagle-create-table.rb
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/bin/eagle-create-table.rb b/eagle-assembly/src/main/bin/eagle-create-table.rb
old mode 100644
new mode 100755
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-assembly/src/main/bin/eagle-drop-tables.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/bin/eagle-drop-tables.sh b/eagle-assembly/src/main/bin/eagle-drop-tables.sh
old mode 100644
new mode 100755
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-assembly/src/main/bin/eagle-env.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/bin/eagle-env.sh b/eagle-assembly/src/main/bin/eagle-env.sh
index cfffa0d..66d72ae 100755
--- a/eagle-assembly/src/main/bin/eagle-env.sh
+++ b/eagle-assembly/src/main/bin/eagle-env.sh
@@ -43,6 +43,13 @@ for file in $EAGLE_HOME/lib/share/*;do
EAGLE_CLASSPATH=$EAGLE_CLASSPATH:$file
done
-# EAGLE_TABLE_LIST
-export EAGLE_TABLE_LIST='alertdef ipzone streamMetadata alertdetail fileSensitivity eaglehdfs_alert streamdef eagle_metric alertExecutor alertStream alertStreamSchema hiveResourceSensitivity hbaseResourceSensitivity mlmodel userprofile hfdsusercommandpattern appCommand appDefinition serviceAudit aggregatedef alertNotifications eagleSiteDesc eagleSiteApplication eagleApplicationDesc eagleFeatureDesc eagle_metadata'
+# Add eagle storm library jars
+# Separate out of share directory because of asm version conflict
+export EAGLE_STORM_CLASSPATH=$EAGLE_CLASSPATH
+for file in $EAGLE_HOME/lib/storm/*;do
+ EAGLE_STORM_CLASSPATH=$EAGLE_STORM_CLASSPATH:$file
+done
+# EAGLE_TABLE_LIST
+# TODO: Automatically create hbase table when initializing
+export EAGLE_TABLE_LIST='alertdef ipzone streamMetadata alertdetail fileSensitivity eaglehdfs_alert streamdef eagle_metric alertExecutor alertStream alertStreamSchema hiveResourceSensitivity hbaseResourceSensitivity mlmodel userprofile hfdsusercommandpattern appCommand appDefinition serviceAudit aggregatedef alertNotifications eagleSiteDesc eagleSiteApplication eagleApplicationDesc eagleFeatureDesc eagle_metadata'
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-assembly/src/main/bin/eagle-run-class.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/bin/eagle-run-class.sh b/eagle-assembly/src/main/bin/eagle-run-class.sh
new file mode 100755
index 0000000..6828746
--- /dev/null
+++ b/eagle-assembly/src/main/bin/eagle-run-class.sh
@@ -0,0 +1,115 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+if [ $# -lt 1 ];
+then
+ echo "USAGE: $0 [-daemon] [-name servicename] [-loggc] classname [opts]"
+ exit 1
+fi
+
+base_dir=$(dirname $0)/..
+
+source $base_dir/bin/eagle-env.sh
+
+export EAGLE_CLASSPATH=$EAGLE_CLASSPATH:$(ls $EAGLE_HOME/lib/userprofile/eagle-security-userprofile-training-*-assembly.jar)
+export EAGLE_CLASSPATH=$EAGLE_CLASSPATH:$(ls $EAGLE_HOME/lib/topology/eagle-topology-*.jar)
+
+if [ -z "$EAGLE_JMX_OPTS" ]; then
+ export EAGLE_JMX_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false "
+fi
+
+# Log directory to use
+if [ "x$EAGLE_LOG_DIR" = "x" ]; then
+ EAGLE_LOG_DIR="$base_dir/logs"
+fi
+
+# create logs directory
+if [ ! -d "$EAGLE_LOG_DIR" ]; then
+ mkdir -p "$EAGLE_LOG_DIR"
+fi
+
+# Log4j settings
+if [ -z "$EAGLE_LOG4J_OPTS" ]; then
+ # Log to console. This is a tool.
+ EAGLE_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/conf/tools-log4j.properties"
+else
+ # create logs directory
+ if [ ! -d "$EAGLE_LOG_DIR" ]; then
+ mkdir -p "$EAGLE_LOG_DIR"
+ fi
+fi
+
+# Generic jvm settings you want to add
+if [ -z "$EAGLE_OPTS" ]; then
+ EAGLE_OPTS=""
+fi
+
+# Which java to use
+if [ -z "$JAVA_HOME" ]; then
+ JAVA="java"
+else
+ JAVA="$JAVA_HOME/bin/java"
+fi
+
+# Memory options
+if [ -z "$EAGLE_HEAP_OPTS" ]; then
+ EAGLE_HEAP_OPTS="-Xmx256M"
+fi
+
+# JVM performance options
+if [ -z "$EAGLE_JVM_PERFORMANCE_OPTS" ]; then
+ EAGLE_JVM_PERFORMANCE_OPTS="-server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+DisableExplicitGC -Djava.awt.headless=true"
+fi
+
+while [ $# -gt 0 ]; do
+ COMMAND=$1
+ case $COMMAND in
+ -name)
+ DAEMON_NAME=$2
+ CONSOLE_OUTPUT_FILE=$EAGLE_LOG_DIR/$DAEMON_NAME.out
+ shift 2
+ ;;
+ -loggc)
+ if [ -z "$EAGLE_GC_LOG_OPTS" ]; then
+ GC_LOG_ENABLED="true"
+ fi
+ shift
+ ;;
+ -daemon)
+ DAEMON_MODE="true"
+ shift
+ ;;
+ *)
+ break
+ ;;
+ esac
+done
+
+# GC options
+GC_FILE_SUFFIX='-gc.log'
+GC_LOG_FILE_NAME=''
+if [ "x$GC_LOG_ENABLED" = "xtrue" ]; then
+ GC_LOG_FILE_NAME=$DAEMON_NAME$GC_FILE_SUFFIX
+ EAGLE_GC_LOG_OPTS="-Xloggc:$LOG_DIR/$GC_LOG_FILE_NAME -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps "
+fi
+
+# Launch mode
+if [ "x$DAEMON_MODE" = "xtrue" ]; then
+ nohup $JAVA $EAGLE_HEAP_OPTS $EAGLE_JVM_PERFORMANCE_OPTS $EAGLE_GC_LOG_OPTS $EAGLE_JMX_OPTS $EAGLE_LOG4J_OPTS -cp $EAGLE_CLASSPATH $EAGLE_OPTS "$@" > "$CONSOLE_OUTPUT_FILE" 2>&1 < /dev/null &
+else
+ exec $JAVA $EAGLE_HEAP_OPTS $EAGLE_JVM_PERFORMANCE_OPTS $EAGLE_GC_LOG_OPTS $EAGLE_JMX_OPTS $EAGLE_LOG4J_OPTS -cp $EAGLE_CLASSPATH $EAGLE_OPTS "$@"
+fi
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-assembly/src/main/bin/eagle-topology-init.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/bin/eagle-topology-init.sh b/eagle-assembly/src/main/bin/eagle-topology-init.sh
index 2d638bf..efda902 100755
--- a/eagle-assembly/src/main/bin/eagle-topology-init.sh
+++ b/eagle-assembly/src/main/bin/eagle-topology-init.sh
@@ -29,51 +29,51 @@ echo "Begin to initialize HBase tables ..."
echo ""
echo "Importing sample site ..."
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=SiteDescService" -d '[{"prefix":"eagleSiteDesc","tags":{"site" : "sandbox"}, "enabled": true}]'
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=SiteDescService" -d '[{"prefix":"eagleSiteDesc","tags":{"site" : "sandbox"}, "enabled": true}]'
echo ""
echo "Importing applications for sample site ..."
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=SiteApplicationService" -d '[{"prefix":"eagleSiteApplication","tags":{"site" : "sandbox", "application":"hdfsAuditLog"}, "enabled": true, "config" : "web.fs.defaultFS: \"hdfs://sandbox.hortonworks.com:8020\""}]'
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=SiteApplicationService" -d '[{"prefix":"eagleSiteApplication","tags":{"site" : "sandbox", "application":"hdfsAuditLog"}, "enabled": true, "config" : "web.fs.defaultFS: \"hdfs://sandbox.hortonworks.com:8020\""}]'
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=SiteApplicationService" -d '[{"prefix":"eagleSiteApplication","tags":{"site" : "sandbox", "application":"hbaseSecurityLog"}, "enabled": true, "config" : "web.hbase.zookeeper.property.clientPort: \"2181\", web.hbase.zookeeper.quorum: \"localhost\""}]'
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=SiteApplicationService" -d '[{"prefix":"eagleSiteApplication","tags":{"site" : "sandbox", "application":"hbaseSecurityLog"}, "enabled": true, "config" : "web.hbase.zookeeper.property.clientPort: \"2181\", web.hbase.zookeeper.quorum: \"localhost\""}]'
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=SiteApplicationService" -d '[{"prefix":"eagleSiteApplication","tags":{"site" : "sandbox", "application":"hiveQueryLog"}, "enabled": true, "config":"web.accessType:\"metastoredb_jdbc\",web.password:\"hive\",web.user:\"hive\",web.jdbcDriverClassName:\"com.mysql.jdbc.Driver\",web.jdbcUrl:\"jdbc:mysql://sandbox.hortonworks.com/hive?createDatabaseIfNotExist=true\""}]'
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=SiteApplicationService" -d '[{"prefix":"eagleSiteApplication","tags":{"site" : "sandbox", "application":"hiveQueryLog"}, "enabled": true, "config":"web.accessType:\"metastoredb_jdbc\",web.password:\"hive\",web.user:\"hive\",web.jdbcDriverClassName:\"com.mysql.jdbc.Driver\",web.jdbcUrl:\"jdbc:mysql://sandbox.hortonworks.com/hive?createDatabaseIfNotExist=true\""}]'
echo ""
echo "Importing application definitions ..."
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=ApplicationDescService" -d '[{"prefix":"eagleApplicationDesc","tags":{"application":"hdfsAuditLog"},"description":"HDFS audit log security check application","alias":"HDFS","groupName":"DAM","features":["common","classification","userProfile","metadata"],"config":"{\n\t\"view\": {\n\t\t\"prefix\": \"fileSensitivity\",\n\t\t\"service\": \"FileSensitivityService\",\n\t\t\"keys\": [\n\t\t\t\"filedir\",\n\t\t\t\"sensitivityType\"\n\t\t],\n\t\t\"type\": \"folder\",\n\t\t\"api\": \"hdfsResource\"\n\t}\n}"}]'
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=ApplicationDescService" -d '[{"prefix":"eagleApplicationDesc","tags":{"application":"hdfsAuditLog"},"description":"HDFS audit log security check application","alias":"HDFS","groupName":"DAM","features":["common","classification","userProfile","metadata"],"config":"{\n\t\"view\": {\n\t\t\"prefix\": \"fileSensitivity\",\n\t\t\"service\": \"FileSensitivityService\",\n\t\t\"keys\": [\n\t\t\t\"filedir\",\n\t\t\t\"sensitivityType\"\n\t\t],\n\t\t\"type\": \"folder\",\n\t\t\"api\": \"hdfsResource\"\n\t}\n}"}]'
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=ApplicationDescService" -d '[{"prefix":"eagleApplicationDesc","tags":{"application":"hbaseSecurityLog"},"description":"HBASE audit log security check application","alias":"HBASE","groupName":"DAM","features":["common","classification","userProfile","metadata"],"config":"{\n\t\"view\": {\n\t\t\"prefix\": \"hbaseResourceSensitivity\",\n\t\t\"service\": \"HbaseResourceSensitivityService\",\n\t\t\"keys\": [\n\t\t\t\"hbaseResource\",\n\t\t\t\"sensitivityType\"\n\t\t],\n\t\t\"type\": \"table\",\n\t\t\"api\": {\n\t\t\t\"database\": \"hbaseResource/namespaces\",\n\t\t\t\"table\": \"hbaseResource/tables\",\n\t\t\t\"column\": \"hbaseResource/columns\"\n\t\t},\n\t\t\"mapping\": {\n\t\t\t\"database\": \"namespace\",\n\t\t\t\"table\": \"table\",\n\t\t\t\"column\": \"columnFamily\"\n\t\t}\n\t}\n}"}]'
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=ApplicationDescService" -d '[{"prefix":"eagleApplicationDesc","tags":{"application":"hbaseSecurityLog"},"description":"HBASE audit log security check application","alias":"HBASE","groupName":"DAM","features":["common","classification","userProfile","metadata"],"config":"{\n\t\"view\": {\n\t\t\"prefix\": \"hbaseResourceSensitivity\",\n\t\t\"service\": \"HbaseResourceSensitivityService\",\n\t\t\"keys\": [\n\t\t\t\"hbaseResource\",\n\t\t\t\"sensitivityType\"\n\t\t],\n\t\t\"type\": \"table\",\n\t\t\"api\": {\n\t\t\t\"database\": \"hbaseResource/namespaces\",\n\t\t\t\"table\": \"hbaseResource/tables\",\n\t\t\t\"column\": \"hbaseResource/columns\"\n\t\t},\n\t\t\"mapping\": {\n\t\t\t\"database\": \"namespace\",\n\t\t\t\"table\": \"table\",\n\t\t\t\"column\": \"columnFamily\"\n\t\t}\n\t}\n}"}]'
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=ApplicationDescService" -d '[{"prefix":"eagleApplicationDesc","tags":{"application":"hiveQueryLog"},"description":"Hive query log security check application","alias":"HIVE","groupName":"DAM","features":["common","classification","userProfile","metadata"], "config":"{\n\t\"view\": {\n\t\t\"prefix\": \"hiveResourceSensitivity\",\n\t\t\"service\": \"HiveResourceSensitivityService\",\n\t\t\"keys\": [\n\t\t\t\"hiveResource\",\n\t\t\t\"sensitivityType\"\n\t\t],\n\t\t\"type\": \"table\",\n\t\t\"api\": {\n\t\t\t\"database\": \"hiveResource/databases\",\n\t\t\t\"table\": \"hiveResource/tables\",\n\t\t\t\"column\": \"hiveResource/columns\"\n\t\t},\n\t\t\"mapping\": {\n\t\t\t\"database\": \"database\",\n\t\t\t\"table\": \"table\",\n\t\t\t\"column\": \"column\"\n\t\t}\n\t}\n}"}]'
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=ApplicationDescService" -d '[{"prefix":"eagleApplicationDesc","tags":{"application":"hiveQueryLog"},"description":"Hive query log security check application","alias":"HIVE","groupName":"DAM","features":["common","classification","userProfile","metadata"], "config":"{\n\t\"view\": {\n\t\t\"prefix\": \"hiveResourceSensitivity\",\n\t\t\"service\": \"HiveResourceSensitivityService\",\n\t\t\"keys\": [\n\t\t\t\"hiveResource\",\n\t\t\t\"sensitivityType\"\n\t\t],\n\t\t\"type\": \"table\",\n\t\t\"api\": {\n\t\t\t\"database\": \"hiveResource/databases\",\n\t\t\t\"table\": \"hiveResource/tables\",\n\t\t\t\"column\": \"hiveResource/columns\"\n\t\t},\n\t\t\"mapping\": {\n\t\t\t\"database\": \"database\",\n\t\t\t\"table\": \"table\",\n\t\t\t\"column\": \"column\"\n\t\t}\n\t}\n}"}]'
echo ""
echo "Importing feature definitions ..."
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=FeatureDescService" -d '[{"prefix":"eagleFeatureDesc","tags":{"feature":"common"},"description":"Provide the Policy & Alert feature.","version":"v0.3.0"}]'
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=FeatureDescService" -d '[{"prefix":"eagleFeatureDesc","tags":{"feature":"common"},"description":"Provide the Policy & Alert feature.","version":"v0.3.0"}]'
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=FeatureDescService" -d '[{"prefix":"eagleFeatureDesc","tags":{"feature":"classification"},"description":"Sensitivity browser of the data classification.","version":"v0.3.0"}]'
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=FeatureDescService" -d '[{"prefix":"eagleFeatureDesc","tags":{"feature":"classification"},"description":"Sensitivity browser of the data classification.","version":"v0.3.0"}]'
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=FeatureDescService" -d '[{"prefix":"eagleFeatureDesc","tags":{"feature":"userProfile"},"description":"Machine learning of the user profile","version":"v0.3.0"}]'
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=FeatureDescService" -d '[{"prefix":"eagleFeatureDesc","tags":{"feature":"userProfile"},"description":"Machine learning of the user profile","version":"v0.3.0"}]'
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=FeatureDescService" -d '[{"prefix":"eagleFeatureDesc","tags":{"feature":"metadata"},"description":"Stream metadata viewer","version":"v0.3.0"}]'
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=FeatureDescService" -d '[{"prefix":"eagleFeatureDesc","tags":{"feature":"metadata"},"description":"Stream metadata viewer","version":"v0.3.0"}]'
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=FeatureDescService" -d '[{"prefix":"eagleFeatureDesc","tags":{"feature":"metrics"},"description":"Metrics dashboard","version":"v0.3.0"}]'
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=FeatureDescService" -d '[{"prefix":"eagleFeatureDesc","tags":{"feature":"metrics"},"description":"Metrics dashboard","version":"v0.3.0"}]'
## AlertStreamService: alert streams generated from data source
echo ""
echo "Importing AlertStreamService for HDFS... "
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamService" -d '[{"prefix":"alertStream","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream"},"description":"alert event stream from hdfs audit log"}]'
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamService" -d '[{"prefix":"alertStream","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream"},"description":"alert event stream from hdfs audit log"}]'
## AlertExecutorService: what alert streams are consumed by alert executor
echo ""
echo "Importing AlertExecutorService for HDFS... "
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertExecutorService" -d '[{"prefix":"alertExecutor","tags":{"application":"hdfsAuditLog","alertExecutorId":"hdfsAuditLogAlertExecutor","streamName":"hdfsAuditLogEventStream"},"description":"alert executor for hdfs audit log event stream"}]'
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertExecutorService" -d '[{"prefix":"alertExecutor","tags":{"application":"hdfsAuditLog","alertExecutorId":"hdfsAuditLogAlertExecutor","streamName":"hdfsAuditLogEventStream"},"description":"alert executor for hdfs audit log event stream"}]'
## AlertStreamSchemaService: schema for event from alert stream
echo ""
echo "Importing AlertStreamSchemaService for HDFS... "
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamSchemaService" -d '[{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"src"},"attrDescription":"source directory or file, such as /tmp","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hdfs.resolver.HDFSResourceResolver"},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"dst"},"attrDescription":"destination directory, such as /tmp","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hdfs.resolver.HDFSResourceResolver"},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"host"},"attrDescription":"hostname, such as
localhost","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"timestamp"},"attrDescription":"milliseconds of the datetime","attrType":"long","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"allowed"},"attrDescription":"true, false or none","attrType":"bool","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"user"},"attrDescription":"process user","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"cmd"},"attrDescription":"file/directory operation, such as getfileinfo, open, listStatus and so on","attrType":"string","category":"","
attrValueResolver":"org.apache.eagle.service.security.hdfs.resolver.HDFSCommandResolver"},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"sensitivityType"},"attrDescription":"mark such as AUDITLOG, SECURITYLOG","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hdfs.resolver.HDFSSensitivityTypeResolver"},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"securityZone"},"attrDescription":"","attrType":"string","category":"","attrValueResolver":""}]'
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamSchemaService" -d '[{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"src"},"attrDescription":"source directory or file, such as /tmp","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hdfs.resolver.HDFSResourceResolver"},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"dst"},"attrDescription":"destination directory, such as /tmp","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hdfs.resolver.HDFSResourceResolver"},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"host"},"attrDescription":"hostname,
such as localhost","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"timestamp"},"attrDescription":"milliseconds of the datetime","attrType":"long","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"allowed"},"attrDescription":"true, false or none","attrType":"bool","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"user"},"attrDescription":"process user","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"cmd"},"attrDescription":"file/directory operation, such as getfileinfo, open, listStatus and so on","attrType":"string","catego
ry":"","attrValueResolver":"org.apache.eagle.service.security.hdfs.resolver.HDFSCommandResolver"},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"sensitivityType"},"attrDescription":"mark such as AUDITLOG, SECURITYLOG","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hdfs.resolver.HDFSSensitivityTypeResolver"},{"prefix":"alertStreamSchema","tags":{"application":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"securityZone"},"attrDescription":"","attrType":"string","category":"","attrValueResolver":""}]'
#####################################################################
@@ -83,19 +83,19 @@ curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:a
#### AlertStreamService: alert streams generated from data source
echo ""
echo "Importing AlertStreamService for HBASE... "
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamService" -d '[{"prefix":"alertStream","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream"},"description":"alert event stream from hbase security audit log"}]'
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamService" -d '[{"prefix":"alertStream","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream"},"description":"alert event stream from hbase security audit log"}]'
#### AlertExecutorService: what alert streams are consumed by alert executor
echo ""
echo "Importing AlertExecutorService for HBASE... "
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertExecutorService" -d '[{"prefix":"alertExecutor","tags":{"application":"hbaseSecurityLog","alertExecutorId":"hbaseSecurityLogAlertExecutor","streamName":"hbaseSecurityLogEventStream"},"description":"alert executor for hbase security log event stream"}]'
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertExecutorService" -d '[{"prefix":"alertExecutor","tags":{"application":"hbaseSecurityLog","alertExecutorId":"hbaseSecurityLogAlertExecutor","streamName":"hbaseSecurityLogEventStream"},"description":"alert executor for hbase security log event stream"}]'
#### AlertStreamSchemaService: schema for event from alert stream
echo ""
echo "Importing AlertStreamSchemaService for HBASE... "
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamSchemaService" -d '[{"prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"host"},"attrDescription":"remote ip address to access hbase","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"request"},"attrDescription":"","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hbase.resolver.HbaseRequestResolver"},{"prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"status"},"attrDescription":"access status: allowed or denied","attrType":"string","category":"","attrValueResolver":""},{"
prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"user"},"attrDescription":"hbase user","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"timestamp"},"attrDescription":"milliseconds of the datetime","attrType":"long","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"scope"},"attrDescription":"the resources which users are then granted specific permissions (Read, Write, Execute, Create, Admin) against","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hbase.resolver.HbaseMetadataResolver"},{"prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"action"},"attrDe
scription":"action types, such as read, write, create, execute, and admin","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hbase.resolver.HbaseActionResolver"},{"prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"sensitivityType"},"attrDescription":"","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hbase.resolver.HbaseSensitivityTypeResolver"}]'
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamSchemaService" -d '[{"prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"host"},"attrDescription":"remote ip address to access hbase","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"request"},"attrDescription":"","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hbase.resolver.HbaseRequestResolver"},{"prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"status"},"attrDescription":"access status: allowed or denied","attrType":"string","category":"","attrValueResolver
":""},{"prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"user"},"attrDescription":"hbase user","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"timestamp"},"attrDescription":"milliseconds of the datetime","attrType":"long","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"scope"},"attrDescription":"the resources which users are then granted specific permissions (Read, Write, Execute, Create, Admin) against","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hbase.resolver.HbaseMetadataResolver"},{"prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"action"}
,"attrDescription":"action types, such as read, write, create, execute, and admin","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hbase.resolver.HbaseActionResolver"},{"prefix":"alertStreamSchema","tags":{"application":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"sensitivityType"},"attrDescription":"","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hbase.resolver.HbaseSensitivityTypeResolver"}]'
#####################################################################
@@ -105,17 +105,17 @@ curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:a
## AlertStreamService: alert streams generated from data source
echo ""
echo "Importing AlertStreamService for HIVE... "
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamService" -d '[{"prefix":"alertStream","tags":{"application":"hiveQueryLog","streamName":"hiveAccessLogStream"},"description":"alert event stream from hive query"}]'
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamService" -d '[{"prefix":"alertStream","tags":{"application":"hiveQueryLog","streamName":"hiveAccessLogStream"},"description":"alert event stream from hive query"}]'
## AlertExecutorService: what alert streams are consumed by alert executor
echo ""
echo "Importing AlertExecutorService for HIVE... "
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertExecutorService" -d '[{"prefix":"alertExecutor","tags":{"application":"hiveQueryLog","alertExecutorId":"hiveAccessAlertByRunningJob","streamName":"hiveAccessLogStream"},"description":"alert executor for hive query log event stream"}]'
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertExecutorService" -d '[{"prefix":"alertExecutor","tags":{"application":"hiveQueryLog","alertExecutorId":"hiveAccessAlertByRunningJob","streamName":"hiveAccessLogStream"},"description":"alert executor for hive query log event stream"}]'
## AlertStreamSchemaServiceService: schema for event from alert stream
echo ""
echo "Importing AlertStreamSchemaService for HIVE... "
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamSchemaService" -d '[{"prefix":"alertStreamSchema","category":"","attrType":"string","attrDescription":"process user","attrValueResolver":"","tags":{"application":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"user"}},{"prefix":"alertStreamSchema","category":"","attrType":"string","attrDescription":"hive sql command, such as SELECT, INSERT and DELETE","attrValueResolver":"org.apache.eagle.service.security.hive.resolver.HiveCommandResolver","tags":{"application":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"command"}},{"prefix":"alertStreamSchema","category":"","attrType":"long","attrDescription":"milliseconds of the datetime","attrValueResolver":"","tags":{"application":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"timestamp"}},{"prefix":"al
ertStreamSchema","category":"","attrType":"string","attrDescription":"/database/table/column or /database/table/*","attrValueResolver":"org.apache.eagle.service.security.hive.resolver.HiveMetadataResolver","tags":{"application":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"resource"}},{"prefix":"alertStreamSchema","category":"","attrType":"string","attrDescription":"mark such as PHONE_NUMBER","attrValueResolver":"org.apache.eagle.service.security.hive.resolver.HiveSensitivityTypeResolver","tags":{"application":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"sensitivityType"}}]'
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamSchemaService" -d '[{"prefix":"alertStreamSchema","category":"","attrType":"string","attrDescription":"process user","attrValueResolver":"","tags":{"application":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"user"}},{"prefix":"alertStreamSchema","category":"","attrType":"string","attrDescription":"hive sql command, such as SELECT, INSERT and DELETE","attrValueResolver":"org.apache.eagle.service.security.hive.resolver.HiveCommandResolver","tags":{"application":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"command"}},{"prefix":"alertStreamSchema","category":"","attrType":"long","attrDescription":"milliseconds of the datetime","attrValueResolver":"","tags":{"application":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"timestamp"}},{"pre
fix":"alertStreamSchema","category":"","attrType":"string","attrDescription":"/database/table/column or /database/table/*","attrValueResolver":"org.apache.eagle.service.security.hive.resolver.HiveMetadataResolver","tags":{"application":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"resource"}},{"prefix":"alertStreamSchema","category":"","attrType":"string","attrDescription":"mark such as PHONE_NUMBER","attrValueResolver":"org.apache.eagle.service.security.hive.resolver.HiveSensitivityTypeResolver","tags":{"application":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"sensitivityType"}}]'
#####################################################################
# Import stream metadata for UserProfile
@@ -124,17 +124,17 @@ curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:a
echo ""
echo "Importing AlertDefinitionService for USERPROFILE"
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H "Content-Type: application/json" "http://$EAGLE_SERVICE_HOST:$EAGLE_SERVICE_PORT/eagle-service/rest/entities?serviceName=AlertDefinitionService" \
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H "Content-Type: application/json" "http://$EAGLE_SERVICE_HOST:$EAGLE_SERVICE_PORT/eagle-service/rest/entities?serviceName=AlertDefinitionService" \
-d '[ { "prefix": "alertdef", "tags": { "site": "sandbox", "application": "userProfile", "alertExecutorId": "userProfileAnomalyDetectionExecutor", "policyId": "userProfile", "policyType": "MachineLearning" }, "description": "user profile anomaly detection", "policyDef": "{\"type\":\"MachineLearning\",\"alertContext\":{\"site\":\"sandbox\",\"application\":\"userProfile\",\"component\":\"testComponent\",\"description\":\"ML based user profile anomaly detection\",\"severity\":\"WARNING\",\"notificationByEmail\":\"true\"},\"algorithms\":[{\"name\":\"EigenDecomposition\",\"evaluator\":\"org.apache.eagle.security.userprofile.impl.UserProfileAnomalyEigenEvaluator\",\"description\":\"EigenBasedAnomalyDetection\",\"features\":\"getfileinfo, open, listStatus, setTimes, setPermission, rename, mkdirs, create, setReplication, contentSummary, delete, setOwner, fsck\"},{\"name\":\"KDE\",\"evaluator\":\"org.apache.eagle.security.userprofile.impl.UserProfileAnomalyKDEEvaluator\",\"description\"
:\"DensityBasedAnomalyDetection\",\"features\":\"getfileinfo, open, listStatus, setTimes, setPermission, rename, mkdirs, create, setReplication, contentSummary, delete, setOwner, fsck\"}]}", "dedupeDef": "{\"alertDedupIntervalMin\":\"0\",\"emailDedupIntervalMin\":\"0\"}", "notificationDef": "", "remediationDef": "", "enabled": true } ]'
echo ""
echo "Importing AlertExecutorService for USERPROFILE"
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H "Content-Type: application/json" "http://$EAGLE_SERVICE_HOST:$EAGLE_SERVICE_PORT/eagle-service/rest/entities?serviceName=AlertExecutorService" \
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H "Content-Type: application/json" "http://$EAGLE_SERVICE_HOST:$EAGLE_SERVICE_PORT/eagle-service/rest/entities?serviceName=AlertExecutorService" \
-d '[ { "prefix": "alertExecutor", "tags":{ "site":"sandbox", "application":"userProfile", "alertExecutorId" : "userProfileAnomalyDetectionExecutor", "streamName":"userActivity" }, "description": "user activity data source" } ]'
echo ""
echo "Importing AlertStreamService for USERPROFILE"
-curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H "Content-Type: application/json" "http://$EAGLE_SERVICE_HOST:$EAGLE_SERVICE_PORT/eagle-service/rest/entities?serviceName=AlertStreamService" \
+curl -silent -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H "Content-Type: application/json" "http://$EAGLE_SERVICE_HOST:$EAGLE_SERVICE_PORT/eagle-service/rest/entities?serviceName=AlertStreamService" \
-d '[ { "prefix": "alertStream", "tags": { "streamName": "userActivity", "site":"sandbox", "application":"userProfile" }, "alertExecutorIdList": [ "userProfileAnomalyDetectionExecutor" ] } ]'
## Finished
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-assembly/src/main/bin/hadoop-metric-monitor.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/bin/hadoop-metric-monitor.sh b/eagle-assembly/src/main/bin/hadoop-metric-monitor.sh
old mode 100644
new mode 100755
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-assembly/src/main/bin/kafka-producer.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/bin/kafka-producer.sh b/eagle-assembly/src/main/bin/kafka-producer.sh
new file mode 100755
index 0000000..3366de0
--- /dev/null
+++ b/eagle-assembly/src/main/bin/kafka-producer.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+if [ "x$EAGLE_HEAP_OPTS" = "x" ]; then
+ export EAGLE_HEAP_OPTS="-Xmx512M"
+fi
+
+exec $(dirname $0)/eagle-run-class.sh org.apache.eagle.contrib.kafka.ProducerTool "$@"
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-assembly/src/main/bin/kafka-server-start.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/bin/kafka-server-start.sh b/eagle-assembly/src/main/bin/kafka-server-start.sh
new file mode 100755
index 0000000..ce37610
--- /dev/null
+++ b/eagle-assembly/src/main/bin/kafka-server-start.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+if [ $# -lt 1 ];
+then
+ echo "USAGE: $0 [-daemon] conf/kafka-server.properties [--override property=value]*"
+ exit 1
+fi
+
+base_dir=$(dirname $0)
+
+if [ "x$EAGLE_LOG4J_OPTS" = "x" ]; then
+ export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../conf/log4j.properties"
+fi
+
+if [ "x$EAGLE_HEAP_OPTS" = "x" ]; then
+ export EAGLE_HEAP_OPTS="-Xmx1G -Xms1G"
+fi
+
+EXTRA_ARGS="-name kafkaServer -loggc"
+
+COMMAND=$1
+case $COMMAND in
+ -daemon)
+ EXTRA_ARGS="-daemon "$EXTRA_ARGS
+ shift
+ ;;
+ *)
+ ;;
+esac
+
+$base_dir/kafka-server-status.sh 1>/dev/null 2>&1
+if [ "$?" == "" ];then
+ echo "Kafka is still running, please stop firstly before starting"
+ exit 0
+else
+ exec $base_dir/eagle-run-class.sh $EXTRA_ARGS kafka.Kafka "$@"
+fi
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-assembly/src/main/bin/kafka-server-status.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/bin/kafka-server-status.sh b/eagle-assembly/src/main/bin/kafka-server-status.sh
new file mode 100755
index 0000000..c794425
--- /dev/null
+++ b/eagle-assembly/src/main/bin/kafka-server-status.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+PIDS=$(ps ax | grep -i 'kafka\.Kafka' | grep java | grep -v grep | awk '{print $1}')
+
+if [ -z "$PIDS" ]; then
+ echo "No kafka server is running"
+ exit 1
+else
+ echo "Kafka server is running at $PIDS"
+ exit 0
+fi
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-assembly/src/main/bin/kafka-server-stop.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/bin/kafka-server-stop.sh b/eagle-assembly/src/main/bin/kafka-server-stop.sh
new file mode 100755
index 0000000..9de6d76
--- /dev/null
+++ b/eagle-assembly/src/main/bin/kafka-server-stop.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+PIDS=$(ps ax | grep -i 'kafka\.Kafka' | grep java | grep -v grep | awk '{print $1}')
+
+if [ -z "$PIDS" ]; then
+ echo "No kafka server to stop"
+ exit 1
+else
+ kill -s TERM $PIDS
+fi
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-assembly/src/main/bin/kafka-stream-monitor.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/bin/kafka-stream-monitor.sh b/eagle-assembly/src/main/bin/kafka-stream-monitor.sh
old mode 100644
new mode 100755
index bf9181b..50dce87
--- a/eagle-assembly/src/main/bin/kafka-stream-monitor.sh
+++ b/eagle-assembly/src/main/bin/kafka-stream-monitor.sh
@@ -41,15 +41,7 @@ if [ "$#" == "2" ];then
alert_executor="${alert_stream}Executor"
fi
-which storm >/dev/null 2>&1
-if [ $? != 0 ];then
- echo "ERROR: storm not found"
- exit 1
-else
- export EAGLE_CLASSPATH=$EAGLE_CLASSPATH:$jar_name:`storm classpath`
-fi
-
-cmd="java -cp $EAGLE_CLASSPATH $main_class -D eagle.stream.name=$alert_stream -D eagle.stream.executor=$alert_executor -D config.file=$config_file -D envContextConfig.jarFile=$jar_name"
+cmd="java -cp $EAGLE_STORM_CLASSPATH:$jar_name $main_class -D eagle.stream.name=$alert_stream -D eagle.stream.executor=$alert_executor -D config.file=$config_file -D envContextConfig.jarFile=$jar_name"
echo "=========="
echo "Alert Stream: $alert_stream"
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-assembly/src/main/bin/kafka-topics.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/bin/kafka-topics.sh b/eagle-assembly/src/main/bin/kafka-topics.sh
new file mode 100755
index 0000000..3c0b23d
--- /dev/null
+++ b/eagle-assembly/src/main/bin/kafka-topics.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+exec $(dirname $0)/eagle-run-class.sh kafka.admin.TopicCommand "$@"
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-assembly/src/main/bin/zookeeper-server-start.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/bin/zookeeper-server-start.sh b/eagle-assembly/src/main/bin/zookeeper-server-start.sh
new file mode 100755
index 0000000..d0fbd3d
--- /dev/null
+++ b/eagle-assembly/src/main/bin/zookeeper-server-start.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+if [ $# -lt 1 ];
+then
+ echo "USAGE: $0 [-daemon] conf/zookeeper-server.properties"
+ exit 1
+fi
+base_dir=$(dirname $0)
+
+if [ "x$EAGLE_LOG4J_OPTS" = "x" ]; then
+ export EAGLE_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../conf/log4j.properties"
+fi
+
+if [ "x$EAGLE_HEAP_OPTS" = "x" ]; then
+ export EAGLE_HEAP_OPTS="-Xmx512M -Xms512M"
+fi
+
+EXTRA_ARGS="-name zookeeper -loggc"
+
+COMMAND=$1
+case $COMMAND in
+ -daemon)
+ EXTRA_ARGS="-daemon "$EXTRA_ARGS
+ shift
+ ;;
+ *)
+ ;;
+esac
+
+$base_dir/zookeeper-server-status.sh 1>/dev/null 2>&1
+if [ "$?" == "" ];then
+ echo "Zookeeper is still running, please stop firstly before starting"
+ exit 0
+else
+ exec $base_dir/eagle-run-class.sh $EXTRA_ARGS org.apache.zookeeper.server.quorum.QuorumPeerMain "$@"
+fi
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-assembly/src/main/bin/zookeeper-server-status.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/bin/zookeeper-server-status.sh b/eagle-assembly/src/main/bin/zookeeper-server-status.sh
new file mode 100755
index 0000000..223a310
--- /dev/null
+++ b/eagle-assembly/src/main/bin/zookeeper-server-status.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+PIDS=$(ps ax | grep java | grep -i QuorumPeerMain | grep -v grep | awk '{print $1}')
+
+if [ -z "$PIDS" ]; then
+ echo "No zookeeper server is running"
+ exit 1
+else
+ echo "Zookeeper server is running at $PIDS"
+ exit 0
+fi
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-assembly/src/main/bin/zookeeper-server-stop.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/bin/zookeeper-server-stop.sh b/eagle-assembly/src/main/bin/zookeeper-server-stop.sh
new file mode 100755
index 0000000..4155182
--- /dev/null
+++ b/eagle-assembly/src/main/bin/zookeeper-server-stop.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+PIDS=$(ps ax | grep java | grep -i QuorumPeerMain | grep -v grep | awk '{print $1}')
+
+if [ -z "$PIDS" ]; then
+ echo "No zookeeper server to stop"
+ exit 1
+else
+ kill -s TERM $PIDS
+fi
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-assembly/src/main/conf/eagle-service.conf
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/conf/eagle-service.conf b/eagle-assembly/src/main/conf/eagle-service.conf
index 9b97545..152b90d 100644
--- a/eagle-assembly/src/main/conf/eagle-service.conf
+++ b/eagle-assembly/src/main/conf/eagle-service.conf
@@ -21,7 +21,7 @@ eagle {
storage-password=eagle
storage-database=eagle
# Derby database location: $TOMCAT_HOME/data/eagle
- storage-connection-url="jdbc:derby:data/eagle;create=true"
+ storage-connection-url="jdbc:derby:/tmp/eagle-db-local;create=true"
storage-connection-props="encoding=UTF-8"
storage-driver-class="org.apache.derby.jdbc.EmbeddedDriver"
storage-connection-max=8
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-assembly/src/main/conf/kafka-server.properties
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/conf/kafka-server.properties b/eagle-assembly/src/main/conf/kafka-server.properties
new file mode 100644
index 0000000..684c81f
--- /dev/null
+++ b/eagle-assembly/src/main/conf/kafka-server.properties
@@ -0,0 +1,115 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# see kafka.server.KafkaConfig for additional details and defaults
+
+############################# Server Basics #############################
+
+# The id of the broker. This must be set to a unique integer for each broker.
+broker.id=0
+
+############################# Socket Server Settings #############################
+
+# The address the socket server listens on. It will get the value returned from
+# java.net.InetAddress.getCanonicalHostName() if not configured.
+# FORMAT:
+# listeners = security_protocol://host_name:port
+# EXAMPLE:
+# listeners = PLAINTEXT://your.host.name:9092
+#listeners=PLAINTEXT://:9092
+
+# Hostname and port the broker will advertise to producers and consumers. If not set,
+# it uses the value for "listeners" if configured. Otherwise, it will use the value
+# returned from java.net.InetAddress.getCanonicalHostName().
+#advertised.listeners=PLAINTEXT://your.host.name:9092
+
+# The number of threads handling network requests
+num.network.threads=3
+
+# The number of threads doing disk I/O
+num.io.threads=8
+
+# The send buffer (SO_SNDBUF) used by the socket server
+socket.send.buffer.bytes=102400
+
+# The receive buffer (SO_RCVBUF) used by the socket server
+socket.receive.buffer.bytes=102400
+
+# The maximum size of a request that the socket server will accept (protection against OOM)
+socket.request.max.bytes=104857600
+
+
+############################# Log Basics #############################
+
+# A comma seperated list of directories under which to store log files
+log.dirs=/tmp/eagle-kafka-logs
+
+# The default number of log partitions per topic. More partitions allow greater
+# parallelism for consumption, but this will also result in more files across
+# the brokers.
+num.partitions=1
+
+# The number of threads per data directory to be used for log recovery at startup and flushing at shutdown.
+# This value is recommended to be increased for installations with data dirs located in RAID array.
+num.recovery.threads.per.data.dir=1
+
+############################# Log Flush Policy #############################
+
+# Messages are immediately written to the filesystem but by default we only fsync() to sync
+# the OS cache lazily. The following configurations control the flush of data to disk.
+# There are a few important trade-offs here:
+# 1. Durability: Unflushed data may be lost if you are not using replication.
+# 2. Latency: Very large flush intervals may lead to latency spikes when the flush does occur as there will be a lot of data to flush.
+# 3. Throughput: The flush is generally the most expensive operation, and a small flush interval may lead to exceessive seeks.
+# The settings below allow one to configure the flush policy to flush data after a period of time or
+# every N messages (or both). This can be done globally and overridden on a per-topic basis.
+
+# The number of messages to accept before forcing a flush of data to disk
+#log.flush.interval.messages=10000
+
+# The maximum amount of time a message can sit in a log before we force a flush
+#log.flush.interval.ms=1000
+
+############################# Log Retention Policy #############################
+
+# The following configurations control the disposal of log segments. The policy can
+# be set to delete segments after a period of time, or after a given size has accumulated.
+# A segment will be deleted whenever *either* of these criteria are met. Deletion always happens
+# from the end of the log.
+
+# The minimum age of a log file to be eligible for deletion
+log.retention.hours=168
+
+# A size-based retention policy for logs. Segments are pruned from the log as long as the remaining
+# segments don't drop below log.retention.bytes.
+#log.retention.bytes=1073741824
+
+# The maximum size of a log segment file. When this size is reached a new log segment will be created.
+log.segment.bytes=1073741824
+
+# The interval at which log segments are checked to see if they can be deleted according
+# to the retention policies
+log.retention.check.interval.ms=300000
+
+############################# Zookeeper #############################
+
+# Zookeeper connection string (see zookeeper docs for details).
+# This is a comma separated host:port pairs, each corresponding to a zk
+# server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002".
+# You can also append an optional chroot string to the urls to specify the
+# root directory for all kafka znodes.
+zookeeper.connect=localhost:2181
+
+# Timeout in ms for connecting to zookeeper
+zookeeper.connection.timeout.ms=6000
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-assembly/src/main/conf/log4j.properties
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/conf/log4j.properties b/eagle-assembly/src/main/conf/log4j.properties
index 25331ab..f28e48a 100644
--- a/eagle-assembly/src/main/conf/log4j.properties
+++ b/eagle-assembly/src/main/conf/log4j.properties
@@ -15,8 +15,8 @@
log4j.rootLogger=INFO, stdout
- eagle.log.dir=../logs
- eagle.log.file=eagle.log
+eagle.log.dir=../logs
+eagle.log.file=eagle.log
# standard output
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-assembly/src/main/conf/tools-log4j.properties
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/conf/tools-log4j.properties b/eagle-assembly/src/main/conf/tools-log4j.properties
new file mode 100644
index 0000000..d59ded6
--- /dev/null
+++ b/eagle-assembly/src/main/conf/tools-log4j.properties
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+log4j.rootLogger=INFO, stdout
+
+# standard output
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %p [%t] %c{2}[%L]: %m%n
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-assembly/src/main/conf/zookeeper-server.properties
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/conf/zookeeper-server.properties b/eagle-assembly/src/main/conf/zookeeper-server.properties
new file mode 100644
index 0000000..c27b558
--- /dev/null
+++ b/eagle-assembly/src/main/conf/zookeeper-server.properties
@@ -0,0 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# the directory where the snapshot is stored.
+dataDir=/tmp/eagle-zookeeper-data
+# the port at which the clients will connect
+clientPort=2181
+# disable the per-ip limit on the number of connections since this is a non-production config
+maxClientCnxns=0
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-core/eagle-alert/eagle-alert-notification-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-notification-plugin/pom.xml b/eagle-core/eagle-alert/eagle-alert-notification-plugin/pom.xml
index 103da5e..8c58946 100644
--- a/eagle-core/eagle-alert/eagle-alert-notification-plugin/pom.xml
+++ b/eagle-core/eagle-alert/eagle-alert-notification-plugin/pom.xml
@@ -70,7 +70,6 @@
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
</dependency>
-
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/test/java/org/apache/eagle/notifications/testcases/TestAlertEmailPlugin.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/test/java/org/apache/eagle/notifications/testcases/TestAlertEmailPlugin.java b/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/test/java/org/apache/eagle/notifications/testcases/TestAlertEmailPlugin.java
index b44c238..447150d 100644
--- a/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/test/java/org/apache/eagle/notifications/testcases/TestAlertEmailPlugin.java
+++ b/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/test/java/org/apache/eagle/notifications/testcases/TestAlertEmailPlugin.java
@@ -49,7 +49,7 @@ public class TestAlertEmailPlugin {
alert.setTags(new HashMap<String, String>());
alert.getTags().put(Constants.POLICY_ID, "testPolicyId");
alert.setDescription("");
- alert.setAlertContext(new AlertContext());
+ alert.setDecodedAlertContext(new AlertContext());
plugin.onAlert(alert);
Assert.assertTrue(plugin.getStatus().successful);
}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-core/eagle-metric/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metric/pom.xml b/eagle-core/eagle-metric/pom.xml
index f49f4e2..210dad6 100644
--- a/eagle-core/eagle-metric/pom.xml
+++ b/eagle-core/eagle-metric/pom.xml
@@ -46,6 +46,10 @@
<artifactId>eagle-client-base</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
-</project>
-
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-core/eagle-metric/src/main/java/org/apache/eagle/metric/reportor/MetricKeyCodeDecoder.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metric/src/main/java/org/apache/eagle/metric/reportor/MetricKeyCodeDecoder.java b/eagle-core/eagle-metric/src/main/java/org/apache/eagle/metric/reportor/MetricKeyCodeDecoder.java
index 7f798fb..3ee55a3 100644
--- a/eagle-core/eagle-metric/src/main/java/org/apache/eagle/metric/reportor/MetricKeyCodeDecoder.java
+++ b/eagle-core/eagle-metric/src/main/java/org/apache/eagle/metric/reportor/MetricKeyCodeDecoder.java
@@ -22,33 +22,50 @@ package org.apache.eagle.metric.reportor;
import java.util.HashMap;
import java.util.Map;
+/**
+ * TODO: Refactor metric implementation, which is not very solid.
+ *
+ * metricKey = metricName[/[key=char|whitespace]*]*
+ */
+@Deprecated
public class MetricKeyCodeDecoder {
-
+ private final static String SEPERATOR = "/";
public static String codeMetricKey(String metricName, Map<String, String> tags) {
StringBuilder sb = new StringBuilder();
sb.append(metricName);
for (Map.Entry<String, String> entry : tags.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
- sb.append(" " + key + ":" + value);
+ if(key.contains(SEPERATOR)||value.contains(SEPERATOR)){
+ throw new IllegalStateException("Invalid metric tag pair <"+key+":"+value+"> which contains reserved char: "+SEPERATOR);
+ }
+ sb.append(SEPERATOR).append(key).append(":").append(value);
}
return sb.toString();
}
+ /**
+ * @param name metricName[/[key=char|whitespace]*]*
+ * @return
+ */
public static EagleMetricKey decodeMetricKey(String name) {
EagleMetricKey metricName = new EagleMetricKey();
- String[] parts = name.split(" ");
+ String[] parts = name.split(SEPERATOR);
metricName.metricName = parts[0];
metricName.tags = new HashMap<>();
for (int i = 1; i < parts.length; i++) {
String[] keyValue = parts[i].split(":");
- metricName.tags.put(keyValue[0], keyValue[1]);
+ if(keyValue.length >1) {
+ metricName.tags.put(keyValue[0], keyValue[1]);
+ } else {
+ throw new IllegalStateException("Failed to decode metric name '"+name+"', because '"+parts[i]+"' is invalid, expected in format: 'key:value'");
+ }
}
return metricName;
}
public static String addTimestampToMetricKey(long timestamp, String metricKey) {
- return timestamp + " " + metricKey;
+ return timestamp + SEPERATOR + metricKey;
}
public static String codeTSMetricKey(long timestamp, String metricName, Map<String, String> tags) {
@@ -56,7 +73,7 @@ public class MetricKeyCodeDecoder {
}
public static EagleMetricKey decodeTSMetricKey(String name) {
- Integer index = name.indexOf(" ");
+ Integer index = name.indexOf(SEPERATOR);
EagleMetricKey metricKey = decodeMetricKey(name.substring(index + 1));
metricKey.timestamp = Long.valueOf(name.substring(0, index));
return metricKey;
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertAPIEntity.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertAPIEntity.java b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertAPIEntity.java
index e4a64ab..0a96f6d 100644
--- a/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertAPIEntity.java
+++ b/eagle-core/eagle-policy/eagle-policy-base/src/main/java/org/apache/eagle/alert/entity/AlertAPIEntity.java
@@ -30,7 +30,15 @@ import org.codehaus.jackson.map.annotate.JsonSerialize;
@Service(Constants.ALERT_SERVICE_ENDPOINT_NAME)
@TimeSeries(true)
@JsonIgnoreProperties(ignoreUnknown = true)
-@Tags({"site", "hostname", "application", "policyId", "sourceStreams", "alertSource", "alertExecutorId"})
+@Tags({
+ "site",
+ "hostname",
+ "application",
+ "policyId",
+ "sourceStreams",
+ "alertSource",
+ "alertExecutorId"
+})
public class AlertAPIEntity extends TaggedLogAPIEntity{
@Column("description")
private String description;
@@ -83,7 +91,7 @@ public class AlertAPIEntity extends TaggedLogAPIEntity{
_pcs.firePropertyChange("alertContext", null, null);
}
- public void setAlertContext(AlertContext alertContext) {
+ public void setDecodedAlertContext(AlertContext alertContext) {
if(alertContext != null) this.alertContext = alertContext.toJsonString();
_pcs.firePropertyChange("alertContext", null, null);
}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-core/eagle-query/eagle-entity-base/src/main/java/org/apache/eagle/log/entity/GenericMetricEntity.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-entity-base/src/main/java/org/apache/eagle/log/entity/GenericMetricEntity.java b/eagle-core/eagle-query/eagle-entity-base/src/main/java/org/apache/eagle/log/entity/GenericMetricEntity.java
index ef7d967..90db780 100755
--- a/eagle-core/eagle-query/eagle-entity-base/src/main/java/org/apache/eagle/log/entity/GenericMetricEntity.java
+++ b/eagle-core/eagle-query/eagle-entity-base/src/main/java/org/apache/eagle/log/entity/GenericMetricEntity.java
@@ -33,7 +33,7 @@ import org.codehaus.jackson.map.annotate.JsonSerialize;
@Metric(interval=60000)
@ServicePath(path = "/metric")
// TODO:
-@Tags({"site","application","policyId"})
+@Tags({"site","application","policyId","alertExecutorId", "streamName","source","partitionSeq"})
public class GenericMetricEntity extends TaggedLogAPIEntity {
public static final String GENERIC_METRIC_SERVICE = "GenericMetricService";
public static final String GENERIC_METRIC_PREFIX_PLACE_HOLDER = "GENERIC_METRIC_PREFIX_PLACEHODLER";
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/JdbcConstants.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/JdbcConstants.java b/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/JdbcConstants.java
index af5be8f..a6d0c93 100644
--- a/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/JdbcConstants.java
+++ b/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/JdbcConstants.java
@@ -28,7 +28,7 @@ public class JdbcConstants {
public static final String ROW_KEY_COLUMN_NAME = "uuid";
public static final int DEFAULT_TYPE_FOR_COMPLEX_TYPE = Types.BLOB;
- public static final int DEFAULT_VARCHAR_SIZE =1024;
+ public static final int DEFAULT_VARCHAR_SIZE =30000;
// Eagle JDBC Storage Configuration
public final static String EAGLE_DB_USERNAME = "eagle.service.storage-username";
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/60325aa2/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/schema/JdbcEntityDefinitionManager.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/schema/JdbcEntityDefinitionManager.java b/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/schema/JdbcEntityDefinitionManager.java
index 418f552..15810b2 100644
--- a/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/schema/JdbcEntityDefinitionManager.java
+++ b/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/schema/JdbcEntityDefinitionManager.java
@@ -150,7 +150,7 @@ public class JdbcEntityDefinitionManager {
// Intially bind basic java types with SQL types
//================================================
static {
- registerJdbcType(String.class, Types.VARCHAR);
+ registerJdbcType(String.class, Types.LONGVARCHAR);
registerJdbcType(Integer.class, Types.INTEGER);
registerJdbcType(Double.class, Types.DOUBLE);
registerJdbcType(Float.class, Types.FLOAT);