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 2015/11/19 11:47:57 UTC
[50/55] [abbrv] [partial] incubator-eagle git commit: [EAGLE-46]
Rename package name as "org.apache.eagle"
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/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 a58bf81..88b756a 100644
--- a/eagle-assembly/src/main/bin/eagle-topology-init.sh
+++ b/eagle-assembly/src/main/bin/eagle-topology-init.sh
@@ -42,7 +42,7 @@ curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:a
## 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":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"src"},"attrDescription":"source directory or file, such as /tmp","attrType":"string","category":"","attrValueResolver":"eagle.service.security.hdfs.resolver.HDFSResourceResolver"},{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"dst"},"attrDescription":"destination directory, such as /tmp","attrType":"string","category":"","attrValueResolver":"eagle.service.security.hdfs.resolver.HDFSResourceResolver"},{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"host"},"attrDescription":"hostname, such as localhost","attrType":"st
ring","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"timestamp"},"attrDescription":"milliseconds of the datetime","attrType":"long","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"allowed"},"attrDescription":"true, false or none","attrType":"bool","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"user"},"attrDescription":"process user","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"cmd"},"attrDescription":"file/directory operation, such as getfileinfo, open, listStatus and so on","attrType":"string","category":"","attrValueResolver":"eagle.ser
vice.security.hdfs.resolver.HDFSCommandResolver"},{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"sensitivityType"},"attrDescription":"mark such as AUDITLOG, SECURITYLOG","attrType":"string","category":"","attrValueResolver":"eagle.service.security.hdfs.resolver.HDFSSensitivityTypeResolver"},{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"securityZone"},"attrDescription":"","attrType":"string","category":"","attrValueResolver":""}]'
+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":{"dataSource":"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":{"dataSource":"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":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"host"},"attrDescription":"hostname, such as loc
alhost","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"timestamp"},"attrDescription":"milliseconds of the datetime","attrType":"long","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"allowed"},"attrDescription":"true, false or none","attrType":"bool","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"user"},"attrDescription":"process user","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"cmd"},"attrDescription":"file/directory operation, such as getfileinfo, open, listStatus and so on","attrType":"string","category":"","attrVal
ueResolver":"org.apache.eagle.service.security.hdfs.resolver.HDFSCommandResolver"},{"prefix":"alertStreamSchema","tags":{"dataSource":"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":{"dataSource":"hdfsAuditLog","streamName":"hdfsAuditLogEventStream","attrName":"securityZone"},"attrDescription":"","attrType":"string","category":"","attrValueResolver":""}]'
#####################################################################
# Import stream metadata for HIVE
@@ -66,7 +66,7 @@ curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:a
## 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":{"dataSource":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"user"}},{"prefix":"alertStreamSchema","category":"","attrType":"string","attrDescription":"hive sql command, such as SELECT, INSERT and DELETE","attrValueResolver":"eagle.service.security.hive.resolver.HiveCommandResolver","tags":{"dataSource":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"command"}},{"prefix":"alertStreamSchema","category":"","attrType":"long","attrDescription":"milliseconds of the datetime","attrValueResolver":"","tags":{"dataSource":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"timestamp"}},{"prefix":"alertStreamSchem
a","category":"","attrType":"string","attrDescription":"/database/table/column or /database/table/*","attrValueResolver":"eagle.service.security.hive.resolver.HiveMetadataResolver","tags":{"dataSource":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"resource"}},{"prefix":"alertStreamSchema","category":"","attrType":"string","attrDescription":"mark such as PHONE_NUMBER","attrValueResolver":"eagle.service.security.hive.resolver.HiveSensitivityTypeResolver","tags":{"dataSource":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"sensitivityType"}}]'
+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":{"dataSource":"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":{"dataSource":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"command"}},{"prefix":"alertStreamSchema","category":"","attrType":"long","attrDescription":"milliseconds of the datetime","attrValueResolver":"","tags":{"dataSource":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"timestamp"}},{"prefix":"alert
StreamSchema","category":"","attrType":"string","attrDescription":"/database/table/column or /database/table/*","attrValueResolver":"org.apache.eagle.service.security.hive.resolver.HiveMetadataResolver","tags":{"dataSource":"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":{"dataSource":"hiveQueryLog","streamName":"hiveAccessLogStream","attrName":"sensitivityType"}}]'
#####################################################################
# Import stream metadata for UserProfile
@@ -78,7 +78,7 @@ 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" \
- -d '[ { "prefix": "alertdef", "tags": { "site": "sandbox", "dataSource": "userProfile", "alertExecutorId": "userProfileAnomalyDetectionExecutor", "policyId": "userProfile", "policyType": "MachineLearning" }, "desc": "user profile anomaly detection", "policyDef": "{\"type\":\"MachineLearning\",\"alertContext\":{\"site\":\"sandbox\",\"dataSource\":\"userProfile\",\"component\":\"testComponent\",\"description\":\"ML based user profile anomaly detection\",\"severity\":\"WARNING\",\"notificationByEmail\":\"true\"},\"algorithms\":[{\"name\":\"EigenDecomposition\",\"evaluator\":\"eagle.security.userprofile.impl.UserProfileAnomalyEigenEvaluator\",\"description\":\"EigenBasedAnomalyDetection\",\"features\":\"getfileinfo, open, listStatus, setTimes, setPermission, rename, mkdirs, create, setReplication, contentSummary, delete, setOwner, fsck\"},{\"name\":\"KDE\",\"evaluator\":\"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 } ]'
+ -d '[ { "prefix": "alertdef", "tags": { "site": "sandbox", "dataSource": "userProfile", "alertExecutorId": "userProfileAnomalyDetectionExecutor", "policyId": "userProfile", "policyType": "MachineLearning" }, "desc": "user profile anomaly detection", "policyDef": "{\"type\":\"MachineLearning\",\"alertContext\":{\"site\":\"sandbox\",\"dataSource\":\"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\":\"Densit
yBasedAnomalyDetection\",\"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"
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-assembly/src/main/bin/eagle-topology.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/bin/eagle-topology.sh b/eagle-assembly/src/main/bin/eagle-topology.sh
index 410e36c..c8625e0 100755
--- a/eagle-assembly/src/main/bin/eagle-topology.sh
+++ b/eagle-assembly/src/main/bin/eagle-topology.sh
@@ -23,7 +23,7 @@ function print_help() {
echo "Usage: $0 options {start | stop | status}"
echo "Options: Description:"
echo " --jar <jar path> Default is $EAGLE_HOME/lib/topology/eagle-topology-0.1.0-assembly.jar"
- echo " --main <main class> Default is eagle.security.auditlog.HdfsAuditLogProcessorMain"
+ echo " --main <main class> Default is org.apache.eagle.security.auditlog.HdfsAuditLogProcessorMain"
echo " --topology <topology name> Default is sandbox-hdfsAuditLog-topology"
echo " --config <file path> Default is $EAGLE_HOME/conf/sandbox-hdfsAuditLog-application.conf"
echo " --storm-ui <storm ui url> Execute through storm UI API, default: http://localhost:8744"
@@ -115,7 +115,7 @@ if [ -z "$jarName" ]; then
fi
if [ -z "$mainClass" ]; then
- mainClass="eagle.security.auditlog.HdfsAuditLogProcessorMain"
+ mainClass="org.apache.eagle.security.auditlog.HdfsAuditLogProcessorMain"
fi
if [ -z "$topologyName" ]; then
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-assembly/src/main/bin/eagle-userprofile-scheduler.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/bin/eagle-userprofile-scheduler.sh b/eagle-assembly/src/main/bin/eagle-userprofile-scheduler.sh
index 41d0cd7..fb74513 100755
--- a/eagle-assembly/src/main/bin/eagle-userprofile-scheduler.sh
+++ b/eagle-assembly/src/main/bin/eagle-userprofile-scheduler.sh
@@ -36,7 +36,7 @@ source $(dirname $0)/eagle-env.sh
[ ! -e $EAGLE_HOME/temp ] && mkdir -p $EAGLE_HOME/temp
SCHEDULER_JAR=$(ls $EAGLE_HOME/lib/userprofile/eagle-security-userprofile-training-*-assembly.jar)
-SCHEDULER_CLASS="eagle.security.userprofile.daemon.Scheduler"
+SCHEDULER_CLASS="org.apache.eagle.security.userprofile.daemon.Scheduler"
SCHEDULER_JVM_OPTS="-server"
SCHDULER_LOG_DIR=$(dirname $0)/logs/
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-assembly/src/main/bin/eagle-userprofile-training.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/bin/eagle-userprofile-training.sh b/eagle-assembly/src/main/bin/eagle-userprofile-training.sh
index 204b515..209570c 100755
--- a/eagle-assembly/src/main/bin/eagle-userprofile-training.sh
+++ b/eagle-assembly/src/main/bin/eagle-userprofile-training.sh
@@ -19,7 +19,7 @@ function usage() {
echo "Usage: $0 --jar <jarName> --main <mainClass> --site <sitename> --input <inputschema> --output <outputschema>"
echo "--site <siteName> Must be given"
echo "--jar <jarName> Default is $EAGLE_HOME/lib/userprofile/eagle-security-userprofile-training-0.1.0-assembly.jar"
- echo "--main <mainClass> Default is eagle.security.userprofile.UserProfileTrainingCLI"
+ echo "--main <mainClass> Default is org.apache.eagle.security.userprofile.UserProfileTrainingCLI"
echo "--input Default is /tmp/userprofile/hdfs-audit.log"
echo "--output Default is eagle://localhost:9099. When modelSink is hdfs, the value is hdfs:///tmp/userprofile/output"
echo "Example: $0 --jar <jarName> --main <mainClass> --site <sitename> --input <input> --output <output>"
@@ -96,7 +96,7 @@ if [ -z "$site" ];then
fi
if [ -z "$main" ] ; then
- main="eagle.security.userprofile.UserProfileTrainingCLI"
+ main="org.apache.eagle.security.userprofile.UserProfileTrainingCLI"
fi
if [ -z "$jar" ] ; then
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-assembly/src/main/bin/hbase-securitylog-schema-create.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/bin/hbase-securitylog-schema-create.sh b/eagle-assembly/src/main/bin/hbase-securitylog-schema-create.sh
index a7a4b17..7cdd6de 100644
--- a/eagle-assembly/src/main/bin/hbase-securitylog-schema-create.sh
+++ b/eagle-assembly/src/main/bin/hbase-securitylog-schema-create.sh
@@ -31,7 +31,7 @@ curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:a
#### AlertStreamSchemaService: schema for event from alert stream
-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":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"host"},"attrDescription":"remote ip address to access hbase","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"request"},"attrDescription":"","attrType":"string","category":"","attrValueResolver":"eagle.service.security.hbase.resolver.HbaseRequestResolver"},{"prefix":"alertStreamSchema","tags":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"status"},"attrDescription":"access status: allowed or denied","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alert
StreamSchema","tags":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"user"},"attrDescription":"hbase user","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"timestamp"},"attrDescription":"milliseconds of the datetime","attrType":"long","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"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":"eagle.service.security.hbase.resolver.HbaseMetadataResolver"},{"prefix":"alertStreamSchema","tags":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"action"},"attrDescription":"action types, suc
h as read, write, create, execute, and admin","attrType":"string","category":"","attrValueResolver":"eagle.service.security.hbase.resolver.HbaseActionResolver"},{"prefix":"alertStreamSchema","tags":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"sensitivityType"},"attrDescription":"","attrType":"string","category":"","attrValueResolver":"eagle.service.security.hbase.resolver.HbaseSensitivityTypeResolver"}]'
+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":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"host"},"attrDescription":"remote ip address to access hbase","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"request"},"attrDescription":"","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hbase.resolver.HbaseRequestResolver"},{"prefix":"alertStreamSchema","tags":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"status"},"attrDescription":"access status: allowed or denied","attrType":"string","category":"","attrValueResolver":""},{"pre
fix":"alertStreamSchema","tags":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"user"},"attrDescription":"hbase user","attrType":"string","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"timestamp"},"attrDescription":"milliseconds of the datetime","attrType":"long","category":"","attrValueResolver":""},{"prefix":"alertStreamSchema","tags":{"dataSource":"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":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"action"},"attrDescripti
on":"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":{"dataSource":"hbaseSecurityLog","streamName":"hbaseSecurityLogEventStream","attrName":"sensitivityType"},"attrDescription":"","attrType":"string","category":"","attrValueResolver":"org.apache.eagle.service.security.hbase.resolver.HbaseSensitivityTypeResolver"}]'
echo ""
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-assembly/src/main/conf/sandbox-hbaseSecurityLog-application.conf
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/conf/sandbox-hbaseSecurityLog-application.conf b/eagle-assembly/src/main/conf/sandbox-hbaseSecurityLog-application.conf
index 6f7ebf0..dfab25a 100644
--- a/eagle-assembly/src/main/conf/sandbox-hbaseSecurityLog-application.conf
+++ b/eagle-assembly/src/main/conf/sandbox-hbaseSecurityLog-application.conf
@@ -15,7 +15,7 @@
"zkConnectionTimeoutMS" : 15000,
"consumerGroupId" : "EagleConsumer",
"fetchSize" : 1048586,
- "deserializerClass" : "eagle.security.hbase.parse.HbaseAuditLogKafkaDeserializer",
+ "deserializerClass" : "org.apache.eagle.security.hbase.parse.HbaseAuditLogKafkaDeserializer",
"transactionZKServers" : "127.0.0.1",
"transactionZKPort" : 2181,
"transactionZKRoot" : "/consumers",
@@ -25,7 +25,7 @@
"alertExecutorConfigs" : {
"hbaseSecurityLogAlertExecutor" : {
"parallelism" : 1,
- "partitioner" : "eagle.alert.policy.DefaultPolicyPartitioner"
+ "partitioner" : "org.apache.eagle.alert.policy.DefaultPolicyPartitioner"
"needValidation" : "true"
}
},
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-assembly/src/main/conf/sandbox-hdfsAuditLog-application.conf
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/conf/sandbox-hdfsAuditLog-application.conf b/eagle-assembly/src/main/conf/sandbox-hdfsAuditLog-application.conf
index 131737b..04a0466 100644
--- a/eagle-assembly/src/main/conf/sandbox-hdfsAuditLog-application.conf
+++ b/eagle-assembly/src/main/conf/sandbox-hdfsAuditLog-application.conf
@@ -14,7 +14,7 @@
"zkConnection" : "127.0.0.1:2181",
"zkConnectionTimeoutMS" : 15000,
"fetchSize" : 1048586,
- "deserializerClass" : "eagle.security.auditlog.HdfsAuditLogKafkaDeserializer",
+ "deserializerClass" : "org.apache.eagle.security.auditlog.HdfsAuditLogKafkaDeserializer",
"transactionZKServers" : "127.0.0.1",
"transactionZKPort" : 2181,
"transactionZKRoot" : "/consumers",
@@ -24,7 +24,7 @@
"alertExecutorConfigs" : {
"hdfsAuditLogAlertExecutor" : {
"parallelism" : 1,
- "partitioner" : "eagle.alert.policy.DefaultPolicyPartitioner",
+ "partitioner" : "org.apache.eagle.alert.policy.DefaultPolicyPartitioner",
"needValidation" : "true"
}
},
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-assembly/src/main/conf/sandbox-hiveQueryLog-application.conf
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/conf/sandbox-hiveQueryLog-application.conf b/eagle-assembly/src/main/conf/sandbox-hiveQueryLog-application.conf
index 4a6ac10..86dcde7 100644
--- a/eagle-assembly/src/main/conf/sandbox-hiveQueryLog-application.conf
+++ b/eagle-assembly/src/main/conf/sandbox-hiveQueryLog-application.conf
@@ -17,7 +17,7 @@
"zkRetryInterval" : 2000,
"RMEndPoints" : "http://localhost:8088/",
"HSEndPoint" : "http://localhost:19888/",
- "partitionerCls" : "eagle.job.DefaultJobPartitionerImpl"
+ "partitionerCls" : "org.apache.eagle.job.DefaultJobPartitionerImpl"
},
"eagleProps" : {
"site" : "sandbox",
@@ -35,7 +35,7 @@
"alertExecutorConfigs" : {
"hiveAccessAlertByRunningJob" : {
"parallelism" : 1,
- "partitioner" : "eagle.alert.policy.DefaultPolicyPartitioner",
+ "partitioner" : "org.apache.eagle.alert.policy.DefaultPolicyPartitioner",
"needValidation" : "true"
}
},
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-assembly/src/main/conf/sandbox-userprofile-topology.conf
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/conf/sandbox-userprofile-topology.conf b/eagle-assembly/src/main/conf/sandbox-userprofile-topology.conf
index b7f8e23..8b432de 100644
--- a/eagle-assembly/src/main/conf/sandbox-userprofile-topology.conf
+++ b/eagle-assembly/src/main/conf/sandbox-userprofile-topology.conf
@@ -18,7 +18,7 @@
"zkConnectionTimeoutMS" : 15000,
"consumerGroupId" : "eagle.userprofile.consumer",
"fetchSize" : 1048586,
- "deserializerClass" : "eagle.security.auditlog.HdfsAuditLogKafkaDeserializer",
+ "deserializerClass" : "org.apache.eagle.security.auditlog.HdfsAuditLogKafkaDeserializer",
"transactionZKServers" : "localhost",
"transactionZKPort" : 2181,
"transactionZKRoot" : "/brokers/topics",
@@ -37,7 +37,7 @@
"alertExecutorConfigs" : {
"userProfileAnomalyDetectionExecutor" : {
"parallelism" : 1,
- "partitioner" : "eagle.alert.policy.DefaultPolicyPartitioner",
+ "partitioner" : "org.apache.eagle.alert.policy.DefaultPolicyPartitioner",
"needValidation":true
}
},
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-assembly/src/main/examples/eagle-sandbox-starter.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/examples/eagle-sandbox-starter.sh b/eagle-assembly/src/main/examples/eagle-sandbox-starter.sh
index 0ad0f2b..286bc87 100644
--- a/eagle-assembly/src/main/examples/eagle-sandbox-starter.sh
+++ b/eagle-assembly/src/main/examples/eagle-sandbox-starter.sh
@@ -127,10 +127,10 @@ ${EAGLE_HOME}/examples/sample-sensitivity-resource-create.sh
[ $? != 0 ] && exit 1
${EAGLE_HOME}/examples/sample-policy-create.sh
[ $? != 0 ] && exit 1
-$eagle_bin/eagle-topology.sh --main eagle.security.auditlog.HdfsAuditLogProcessorMain --config ${EAGLE_HOME}/conf/sandbox-hdfsAuditLog-application.conf start
+$eagle_bin/eagle-topology.sh --main org.apache.eagle.security.auditlog.HdfsAuditLogProcessorMain --config ${EAGLE_HOME}/conf/sandbox-hdfsAuditLog-application.conf start
[ $? != 0 ] && exit 1
-$eagle_bin/eagle-topology.sh --main eagle.security.hive.jobrunning.HiveJobRunningMonitoringMain --config ${EAGLE_HOME}/conf/sandbox-hiveQueryLog-application.conf start
+$eagle_bin/eagle-topology.sh --main org.apache.eagle.security.hive.jobrunning.HiveJobRunningMonitoringMain --config ${EAGLE_HOME}/conf/sandbox-hiveQueryLog-application.conf start
[ $? != 0 ] && exit 1
-$eagle_bin/eagle-topology.sh --main eagle.security.userprofile.UserProfileDetectionMain --config ${EAGLE_HOME}/conf/sandbox-userprofile-topology.conf start
+$eagle_bin/eagle-topology.sh --main org.apache.eagle.security.userprofile.UserProfileDetectionMain --config ${EAGLE_HOME}/conf/sandbox-userprofile-topology.conf start
[ $? != 0 ] && exit 1
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/common/AlertConstants.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/common/AlertConstants.java b/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/common/AlertConstants.java
deleted file mode 100644
index e388cf0..0000000
--- a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/common/AlertConstants.java
+++ /dev/null
@@ -1,64 +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.
- */
-package eagle.alert.common;
-
-public class AlertConstants {
- public final static String ALERT_SERVICE_ENDPOINT_NAME = "AlertService";
- public final static String ALERT_DEFINITION_SERVICE_ENDPOINT_NAME = "AlertDefinitionService";
- public final static String ALERT_STREAM_SCHEMA_SERVICE_ENDPOINT_NAME = "AlertStreamSchemaService";
- public final static String ALERT_DATA_SOURCE_SERVICE_ENDPOINT_NAME = "AlertDataSourceService";
- public final static String ALERT_EXECUTOR_SERVICE_ENDPOINT_NAME = "AlertExecutorService";
- public final static String ALERT_STREAM_SERVICE_ENDPOINT_NAME = "AlertStreamService";
- public static final String ALERT_EMAIL_ORIGIN_PROPERTY = "alertEmailOrigin";
- public static final String ALERT_TIMESTAMP_PROPERTY = "alertTimestamp";
-
- public static final String ALERT_EMAIL_TIME_PROPERTY = "timestamp";
- public static final String ALERT_EMAIL_COUNT_PROPERTY = "count";
- public static final String ALERT_EMAIL_ALERTLIST_PROPERTY = "alertList";
-
- public static final String URL = "url";
- public static final String ALERT_SOURCE = "alertSource";
- public static final String ALERT_MESSAGE = "alertMessage";
- public static final String SUBJECT = "subject";
- public static final String ALERT_EXECUTOR_ID = "alertExecutorId";
- public static final String POLICY_NAME = "policyName";
- public static final String POLICY_ID = "policyId";
- public static final String SOURCE_STREAMS = "sourceStreams";
- public static final String ALERT_EVENT = "alertEvent";
- public static final String POLICY_DETAIL_URL = "policyDetailUrl";
- public static final String ALERT_DETAIL_URL = "alertDetailUrl";
-
- public static final String POLICY_DEFINITION = "policyDefinition";
- public static final String POLICY_TYPE = "policyType";
- public static final String STREAM_NAME = "streamName";
- public static final String ATTR_NAME = "attrName";
-
- public static final String ALERT_EXECUTOR_CONFIGS = "alertExecutorConfigs";
- public static final String PARALLELISM = "parallelism";
- public static final String PARTITIONER = "partitioner";
- public static final String SOURCE = "source";
- public static final String PARTITIONSEQ = "partitionSeq";
-
- public enum policyType {
- siddhiCEPEngine,
- MachineLearning;
-
- policyType() {
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/common/AlertEmailSender.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/common/AlertEmailSender.java b/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/common/AlertEmailSender.java
deleted file mode 100644
index 7620625..0000000
--- a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/common/AlertEmailSender.java
+++ /dev/null
@@ -1,158 +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.
- */
-package eagle.alert.common;
-
-import java.lang.management.ManagementFactory;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.velocity.VelocityContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import eagle.alert.email.AlertEmailComponent;
-import eagle.alert.email.AlertEmailContext;
-import eagle.common.DateTimeUtil;
-import eagle.common.email.EagleMailClient;
-import com.netflix.config.ConcurrentMapConfiguration;
-import com.typesafe.config.ConfigObject;
-
-public class AlertEmailSender implements Runnable {
-
- protected final List<Map<String, String>> alertContexts = new ArrayList<Map<String, String>>();
- protected final String configFileName;
- protected final String subject;
- protected final String sender;
- protected final String recipents;
- protected final String cc;
- protected final String origin;
- protected boolean sentSuccessfully = false;
-
- private final static Logger LOG = LoggerFactory.getLogger(AlertEmailSender.class);
- private final static int MAX_RETRY_COUNT = 3;
-
- private static final String MAIL_HOST = "mail.host";
- private static final String MAIL_PORT = "mail.smtp.port";
- private static final String MAIL_DEBUG = "mail.debug";
-
- private static final String CONF_KEY_MAIL_HOST = "mailHost";
- private static final String CONF_KEY_MAIL_PORT = "mailSmtpPort";
- private static final String CONF_KEY_MAIL_DEBUG = "mailDebug";
-
- private ConfigObject eagleProps;
-
-
- private String threadName;
- /**
- * Derived class may have some additional context properties to add
- * @param context velocity context
- * @param env environment
- */
- protected void additionalContext(VelocityContext context, String env) {
- // By default there's no additional context added
- }
-
- public AlertEmailSender(AlertEmailContext alertEmail){
- this.recipents = alertEmail.getRecipients();
- this.configFileName = alertEmail.getVelocityTplFile();
- this.subject = alertEmail.getSubject();
- this.sender = alertEmail.getSender();
- this.cc = alertEmail.getCc();
- for(AlertEmailComponent bean : alertEmail.getComponents()){
- this.alertContexts.add(bean.getAlertContext().getProperties());
- }
- String tmp = ManagementFactory.getRuntimeMXBean().getName();
- this.origin = tmp.split("@")[1] + "(pid:" + tmp.split("@")[0] + ")";
- threadName = Thread.currentThread().getName();
- LOG.info("Initialized "+threadName+": origin is : " + this.origin+", recipient of the email: " + this.recipents+", velocity TPL file: " + this.configFileName);
- }
-
- public AlertEmailSender(AlertEmailContext alertEmail, ConfigObject eagleProps){
- this(alertEmail);
- this.eagleProps = eagleProps;
- }
-
- @Override
- public void run() {
- int count = 0;
- boolean success = false;
- while(count++ < MAX_RETRY_COUNT && !success){
- LOG.info("Sending email, tried: " + count+", max: "+MAX_RETRY_COUNT);
- try {
- final EagleMailClient client;
- if (eagleProps != null) {
- ConcurrentMapConfiguration con = new ConcurrentMapConfiguration();
- con.addProperty(MAIL_HOST, eagleProps.get(CONF_KEY_MAIL_HOST).unwrapped());
- con.addProperty(MAIL_PORT, eagleProps.get(CONF_KEY_MAIL_PORT).unwrapped());
- if (eagleProps.get(CONF_KEY_MAIL_DEBUG) != null) {
- con.addProperty(MAIL_DEBUG, eagleProps.get(CONF_KEY_MAIL_DEBUG).unwrapped());
- }
- client = new EagleMailClient(con);
- }
- else {
- client = new EagleMailClient();
- }
- String env = "prod";
- if (eagleProps != null && eagleProps.get("env") != null) {
- env = (String) eagleProps.get("env").unwrapped();
- }
- LOG.info("Env is: " + env);
- final VelocityContext context = new VelocityContext();
- generateCommonContext(context);
- LOG.info("After calling generateCommonContext...");
- additionalContext(context, env);
-
- if (recipents == null || recipents.equals("")) {
- LOG.error("Recipients is null, skip sending emails ");
- return;
- }
- String title = subject;
- if (!env.trim().equals("prod")) {
- title = "[" + env + "]" + title;
- }
- success = client.send(sender, recipents, cc, title, configFileName, context, null);
- LOG.info("Success of sending email: " + success);
- if(!success && count < MAX_RETRY_COUNT) {
- LOG.info("Sleep for a while before retrying");
- Thread.sleep(10*1000);
- }
- }
- catch (Exception e){
- LOG.warn("Sending mail exception", e);
- }
- }
-
- if(success){
- sentSuccessfully = true;
- LOG.info(String.format("Successfully send email, thread: %s",threadName));
- }else{
- LOG.warn(String.format("Fail sending email after tries %s times, thread: %s",MAX_RETRY_COUNT,threadName));
- }
- }
-
- private void generateCommonContext(VelocityContext context) {
- context.put(AlertConstants.ALERT_EMAIL_TIME_PROPERTY, DateTimeUtil.millisecondsToHumanDateWithSeconds( System.currentTimeMillis() ));
- context.put(AlertConstants.ALERT_EMAIL_COUNT_PROPERTY, alertContexts.size());
- context.put(AlertConstants.ALERT_EMAIL_ALERTLIST_PROPERTY, alertContexts);
- context.put(AlertConstants.ALERT_EMAIL_ORIGIN_PROPERTY, origin);
- }
-
- public boolean sentSuccessfully(){
- return this.sentSuccessfully;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertDataSourceDAO.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertDataSourceDAO.java b/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertDataSourceDAO.java
deleted file mode 100644
index ed27663..0000000
--- a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertDataSourceDAO.java
+++ /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.
- */
-package eagle.alert.dao;
-
-import eagle.alert.entity.AlertDataSourceEntity;
-
-import java.util.List;
-
-public interface AlertDataSourceDAO {
- List<AlertDataSourceEntity> findAlertDataSourceBySite(String site) throws Exception;
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertDataSourceDAOImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertDataSourceDAOImpl.java b/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertDataSourceDAOImpl.java
deleted file mode 100644
index 42b65cf..0000000
--- a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertDataSourceDAOImpl.java
+++ /dev/null
@@ -1,83 +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.
- */
-package eagle.alert.dao;
-
-import com.typesafe.config.Config;
-import eagle.alert.common.AlertConstants;
-import eagle.alert.entity.AlertDataSourceEntity;
-import eagle.log.entity.GenericServiceAPIResponseEntity;
-import eagle.service.client.IEagleServiceClient;
-import eagle.service.client.impl.EagleServiceClientImpl;
-import org.apache.commons.lang.time.DateUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import eagle.common.config.*;
-
-import java.util.List;
-
-public class AlertDataSourceDAOImpl implements AlertDataSourceDAO{
- private final Logger LOG = LoggerFactory.getLogger(AlertDataSourceDAOImpl.class);
-
- private final String eagleServiceHost;
- private final Integer eagleServicePort;
- private String username;
- private String password;
-
- public AlertDataSourceDAOImpl(String eagleServiceHost, Integer eagleServicePort, String username, String password) {
- this.eagleServiceHost = eagleServiceHost;
- this.eagleServicePort = eagleServicePort;
- this.username = username;
- this.password = password;
- }
-
- public AlertDataSourceDAOImpl(String eagleServiceHost, Integer eagleServicePort) {
- this(eagleServiceHost,eagleServicePort, null, null);
- }
-
- public AlertDataSourceDAOImpl(Config config) {
- this.eagleServiceHost = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.HOST);
- this.eagleServicePort = config.getInt(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PORT);
- if (config.hasPath(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.USERNAME) &&
- config.hasPath(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PASSWORD)) {
- this.username = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.USERNAME);
- this.password = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PASSWORD);
- }
- }
-
- @Override
- public List<AlertDataSourceEntity> findAlertDataSourceBySite(String site) throws Exception{
- try {
- IEagleServiceClient client = new EagleServiceClientImpl(eagleServiceHost, eagleServicePort, username, password);
- String query = AlertConstants.ALERT_STREAM_SERVICE_ENDPOINT_NAME + "[@site=\"" + site + "\"]{*}";
- GenericServiceAPIResponseEntity<AlertDataSourceEntity> response = client.search()
- .startTime(0)
- .endTime(10 * DateUtils.MILLIS_PER_DAY)
- .pageSize(Integer.MAX_VALUE)
- .query(query)
- .send();
- client.close();
- if (response.getException() != null) {
- throw new Exception("Got an exception when query eagle service: " + response.getException());
- }
- return response.getObj();
- }
- catch (Exception ex) {
- LOG.error("Got an exception when query stream metadata service ", ex);
- throw new IllegalStateException(ex);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertDefinitionDAO.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertDefinitionDAO.java b/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertDefinitionDAO.java
deleted file mode 100644
index 3016168..0000000
--- a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertDefinitionDAO.java
+++ /dev/null
@@ -1,39 +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.
- */
-package eagle.alert.dao;
-
-import java.io.Serializable;
-import java.util.List;
-import java.util.Map;
-
-import eagle.alert.entity.AlertDefinitionAPIEntity;
-
-public interface AlertDefinitionDAO extends Serializable{
- /**
- * find list of active alert definitions for one specific site and dataSource
- * @return
- */
- List<AlertDefinitionAPIEntity> findActiveAlertDefs(String site, String dataSource) throws Exception;
-
- /**
- * find map from alertExecutorId to map from policy Id to alert definition for one specific site and dataSource
- * Map from alertExecutorId to map from policyId to policy definition
- (site,dataSource) => Map[alertExecutorId,Map[policyId,alertDefinition]]
- * @return
- */
- Map<String, Map<String, AlertDefinitionAPIEntity>> findActiveAlertDefsGroupbyAlertExecutorId(String site, String dataSource) throws Exception;
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertDefinitionDAOImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertDefinitionDAOImpl.java b/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertDefinitionDAOImpl.java
deleted file mode 100644
index f53425a..0000000
--- a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertDefinitionDAOImpl.java
+++ /dev/null
@@ -1,104 +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.
- */
-package eagle.alert.dao;
-
-import com.typesafe.config.Config;
-import eagle.alert.common.AlertConstants;
-import eagle.alert.entity.AlertDefinitionAPIEntity;
-import eagle.common.config.EagleConfigConstants;
-import eagle.log.entity.GenericServiceAPIResponseEntity;
-import eagle.service.client.IEagleServiceClient;
-import eagle.service.client.impl.EagleServiceClientImpl;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Utility methods to load alert definitions for a program
- */
-public class AlertDefinitionDAOImpl implements AlertDefinitionDAO {
- private final String eagleServiceHost;
- private final Integer eagleServicePort;
- private String username;
- private String password;
- private final Logger LOG = LoggerFactory.getLogger(AlertDefinitionDAOImpl.class);
-
- public AlertDefinitionDAOImpl(String eagleServiceHost, Integer eagleServicePort) {
- this(eagleServiceHost, eagleServicePort, null, null);
- }
-
- public AlertDefinitionDAOImpl(String eagleServiceHost, Integer eagleServicePort, String username, String password) {
- this.eagleServiceHost = eagleServiceHost;
- this.eagleServicePort = eagleServicePort;
- this.username = username;
- this.password = password;
- }
-
- public AlertDefinitionDAOImpl(Config config){
- this.eagleServiceHost = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.HOST);
- this.eagleServicePort = config.getInt(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PORT);
- if (config.hasPath(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.USERNAME) &&
- config.hasPath(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PASSWORD)) {
- this.username = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.USERNAME);
- this.password = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PASSWORD);
- }
- }
-
- @Override
- public List<AlertDefinitionAPIEntity> findActiveAlertDefs(String site, String dataSource) throws Exception {
- try {
- IEagleServiceClient client = new EagleServiceClientImpl(eagleServiceHost, eagleServicePort, username, password);
- String query = AlertConstants.ALERT_DEFINITION_SERVICE_ENDPOINT_NAME + "[@site=\"" + site + "\" AND @dataSource=\"" + dataSource + "\"]{*}";
- GenericServiceAPIResponseEntity<AlertDefinitionAPIEntity> response = client.search()
- .pageSize(Integer.MAX_VALUE)
- .query(query)
- .send();
- client.close();
- if (response.getException() != null) {
- throw new Exception("Got an exception when query eagle service: " + response.getException());
- }
- List<AlertDefinitionAPIEntity> list = response.getObj();
- List<AlertDefinitionAPIEntity> enabledList = new ArrayList<AlertDefinitionAPIEntity>();
- for (AlertDefinitionAPIEntity entity : list) {
- if (entity.isEnabled()) enabledList.add(entity);
- }
- return enabledList;
- }
- catch (Exception ex) {
- LOG.error("Got an exception when query alert Def service", ex);
- throw new IllegalStateException(ex);
- }
- }
-
- @Override
- public Map<String, Map<String, AlertDefinitionAPIEntity>> findActiveAlertDefsGroupbyAlertExecutorId(String site, String dataSource) throws Exception {
- List<AlertDefinitionAPIEntity> list = findActiveAlertDefs(site, dataSource);
- Map<String, Map<String, AlertDefinitionAPIEntity>> map = new HashMap<String, Map<String, AlertDefinitionAPIEntity>>();
- for (AlertDefinitionAPIEntity entity : list) {
- String executorID = entity.getTags().get(AlertConstants.ALERT_EXECUTOR_ID);
- if (map.get(executorID) == null) {
- map.put(executorID, new HashMap<String, AlertDefinitionAPIEntity>());
- }
- map.get(executorID).put(entity.getTags().get("policyId"), entity);
- }
- return map;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertExecutorDAO.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertExecutorDAO.java b/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertExecutorDAO.java
deleted file mode 100644
index fc1f1f1..0000000
--- a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertExecutorDAO.java
+++ /dev/null
@@ -1,26 +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.
- */
-package eagle.alert.dao;
-
-import eagle.alert.entity.AlertExecutorEntity;
-
-import java.util.List;
-
-public interface AlertExecutorDAO {
- List<AlertExecutorEntity> findAlertExecutorByDataSource(String dataSource) throws Exception;
- List<AlertExecutorEntity> findAlertExecutor(String dataSource, String alertExecutorId) throws Exception;
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertExecutorDAOImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertExecutorDAOImpl.java b/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertExecutorDAOImpl.java
deleted file mode 100644
index feffe3b..0000000
--- a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertExecutorDAOImpl.java
+++ /dev/null
@@ -1,108 +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.
- */
-package eagle.alert.dao;
-
-import com.typesafe.config.Config;
-import eagle.alert.common.AlertConstants;
-import eagle.alert.entity.AlertExecutorEntity;
-import eagle.common.config.EagleConfigConstants;
-import eagle.log.entity.GenericServiceAPIResponseEntity;
-import eagle.service.client.IEagleServiceClient;
-import eagle.service.client.impl.EagleServiceClientImpl;
-import org.apache.commons.lang.time.DateUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.List;
-
-public class AlertExecutorDAOImpl implements AlertExecutorDAO{
- private final Logger LOG = LoggerFactory.getLogger(AlertDataSourceDAOImpl.class);
-
- private final String eagleServiceHost;
- private final Integer eagleServicePort;
- private String username;
- private String password;
-
- public AlertExecutorDAOImpl(String eagleServiceHost, Integer eagleServicePort) {
- this(eagleServiceHost, eagleServicePort, null, null);
- }
-
- public AlertExecutorDAOImpl(String eagleServiceHost, Integer eagleServicePort, String username, String password) {
- this.eagleServiceHost = eagleServiceHost;
- this.eagleServicePort = eagleServicePort;
- this.username = username;
- this.password = password;
- }
-
- public AlertExecutorDAOImpl(Config config) {
- this.eagleServiceHost = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.HOST);
- this.eagleServicePort = config.getInt(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PORT);
- if (config.hasPath(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.USERNAME) &&
- config.hasPath(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PASSWORD)) {
- this.username = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.USERNAME);
- this.password = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PASSWORD);
- }
- }
-
- @Override
- public List<AlertExecutorEntity> findAlertExecutorByDataSource(String dataSource) throws Exception{
- try {
- IEagleServiceClient client = new EagleServiceClientImpl(eagleServiceHost, eagleServicePort, username, password);
- String query = AlertConstants.ALERT_EXECUTOR_SERVICE_ENDPOINT_NAME + "[@dataSource=\"" + dataSource + "\"]{*}";
- GenericServiceAPIResponseEntity<AlertExecutorEntity> response = client.search()
- .startTime(0)
- .endTime(10 * DateUtils.MILLIS_PER_DAY)
- .pageSize(Integer.MAX_VALUE)
- .query(query)
- .send();
- client.close();
- if (response.getException() != null) {
- throw new Exception("Got an exception when query eagle service: " + response.getException());
- }
- return response.getObj();
- }
- catch (Exception ex) {
- LOG.error("Got an exception when query stream metadata service ", ex);
- throw new IllegalStateException(ex);
- }
- }
-
- @Override
- public List<AlertExecutorEntity> findAlertExecutor(String dataSource, String alertExecutorId) throws Exception{
- try {
- IEagleServiceClient client = new EagleServiceClientImpl(eagleServiceHost, eagleServicePort, username, password);
- String query = AlertConstants.ALERT_EXECUTOR_SERVICE_ENDPOINT_NAME + "[@dataSource=\"" + dataSource + "\""
- + " AND @alertExecutorId=\"" + alertExecutorId + "\""
- + "]{*}";
- GenericServiceAPIResponseEntity<AlertExecutorEntity> response = client.search()
- .startTime(0)
- .endTime(10 * DateUtils.MILLIS_PER_DAY)
- .pageSize(Integer.MAX_VALUE)
- .query(query)
- .send();
- client.close();
- if (response.getException() != null) {
- throw new Exception("Got an exception when query eagle service: " + response.getException());
- }
- return response.getObj();
- }
- catch (Exception ex) {
- LOG.error("Got an exception when query stream metadata service ", ex);
- throw new IllegalStateException(ex);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertStreamDAO.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertStreamDAO.java b/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertStreamDAO.java
deleted file mode 100644
index 5c9ae68..0000000
--- a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertStreamDAO.java
+++ /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.
- */
-package eagle.alert.dao;
-
-import eagle.alert.entity.AlertStreamEntity;
-
-import java.util.List;
-
-public interface AlertStreamDAO {
- List<AlertStreamEntity> findAlertStreamByDataSource(String dataSource) throws Exception;
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertStreamDAOImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertStreamDAOImpl.java b/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertStreamDAOImpl.java
deleted file mode 100644
index 283545e..0000000
--- a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertStreamDAOImpl.java
+++ /dev/null
@@ -1,82 +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.
- */
-package eagle.alert.dao;
-
-import com.typesafe.config.Config;
-import eagle.alert.common.AlertConstants;
-import eagle.alert.entity.AlertStreamEntity;
-import eagle.common.config.EagleConfigConstants;
-import eagle.log.entity.GenericServiceAPIResponseEntity;
-import eagle.service.client.IEagleServiceClient;
-import eagle.service.client.impl.EagleServiceClientImpl;
-import org.apache.commons.lang.time.DateUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.List;
-
-public class AlertStreamDAOImpl implements AlertStreamDAO{
- private final Logger LOG = LoggerFactory.getLogger(AlertStreamDAOImpl.class);
-
- private final String eagleServiceHost;
- private final Integer eagleServicePort;
- private String username;
- private String password;
-
- public AlertStreamDAOImpl(String eagleServiceHost, Integer eagleServicePort) {
- this(eagleServiceHost, eagleServicePort, null, null);
- }
-
- public AlertStreamDAOImpl(String eagleServiceHost, Integer eagleServicePort, String username, String password) {
- this.eagleServiceHost = eagleServiceHost;
- this.eagleServicePort = eagleServicePort;
- this.username = username;
- this.password = password;
- }
-
- public AlertStreamDAOImpl(Config config) {
- this.eagleServiceHost = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.HOST);
- this.eagleServicePort = config.getInt(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PORT);
- if (config.hasPath(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.USERNAME) &&
- config.hasPath(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PASSWORD)) {
- this.username = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.USERNAME);
- this.password = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PASSWORD);
- }
- }
-
- public List<AlertStreamEntity> findAlertStreamByDataSource(String dataSource) throws Exception{
- try {
- IEagleServiceClient client = new EagleServiceClientImpl(eagleServiceHost, eagleServicePort, username, password);
- String query = AlertConstants.ALERT_STREAM_SERVICE_ENDPOINT_NAME + "[@dataSource=\"" + dataSource + "\"]{*}";
- GenericServiceAPIResponseEntity<AlertStreamEntity> response = client.search()
- .startTime(0)
- .endTime(10 * DateUtils.MILLIS_PER_DAY)
- .pageSize(Integer.MAX_VALUE)
- .query(query)
- .send();
- client.close();
- if (response.getException() != null) {
- throw new Exception("Got an exception when query eagle service: " + response.getException());
- }
- return response.getObj();
- }
- catch (Exception ex) {
- LOG.error("Got an exception when query stream metadata service ", ex);
- throw new IllegalStateException(ex);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertStreamSchemaDAO.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertStreamSchemaDAO.java b/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertStreamSchemaDAO.java
deleted file mode 100644
index f894757..0000000
--- a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertStreamSchemaDAO.java
+++ /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.
- */
-package eagle.alert.dao;
-
-import java.util.List;
-
-import eagle.alert.entity.AlertStreamSchemaEntity;
-
-public interface AlertStreamSchemaDAO {
- List<AlertStreamSchemaEntity> findAlertStreamSchemaByDataSource(String dataSource) throws Exception;
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertStreamSchemaDAOImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertStreamSchemaDAOImpl.java b/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertStreamSchemaDAOImpl.java
deleted file mode 100644
index 1ef4328..0000000
--- a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/dao/AlertStreamSchemaDAOImpl.java
+++ /dev/null
@@ -1,83 +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.
- */
-package eagle.alert.dao;
-
-import com.typesafe.config.Config;
-import eagle.alert.common.AlertConstants;
-import eagle.alert.entity.AlertStreamSchemaEntity;
-import eagle.common.config.EagleConfigConstants;
-import eagle.log.entity.GenericServiceAPIResponseEntity;
-import eagle.service.client.IEagleServiceClient;
-import eagle.service.client.impl.EagleServiceClientImpl;
-import org.apache.commons.lang.time.DateUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.List;
-
-public class AlertStreamSchemaDAOImpl implements AlertStreamSchemaDAO {
- private final Logger LOG = LoggerFactory.getLogger(AlertStreamSchemaDAOImpl.class);
-
- private final String eagleServiceHost;
- private final Integer eagleServicePort;
- private String username;
- private String password;
-
- public AlertStreamSchemaDAOImpl(String eagleServiceHost, Integer eagleServicePort) {
- this(eagleServiceHost, eagleServicePort, null, null);
- }
-
- public AlertStreamSchemaDAOImpl(String eagleServiceHost, Integer eagleServicePort, String username, String password) {
- this.eagleServiceHost = eagleServiceHost;
- this.eagleServicePort = eagleServicePort;
- this.username = username;
- this.password = password;
- }
-
- public AlertStreamSchemaDAOImpl(Config config) {
- this.eagleServiceHost = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.HOST);
- this.eagleServicePort = config.getInt(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PORT);
- if (config.hasPath(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.USERNAME) &&
- config.hasPath(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PASSWORD)) {
- this.username = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.USERNAME);
- this.password = config.getString(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PASSWORD);
- }
- }
-
- @Override
- public List<AlertStreamSchemaEntity> findAlertStreamSchemaByDataSource(String dataSource) throws Exception {
- try {
- IEagleServiceClient client = new EagleServiceClientImpl(eagleServiceHost, eagleServicePort, username, password);
- String query = AlertConstants.ALERT_STREAM_SCHEMA_SERVICE_ENDPOINT_NAME + "[@dataSource=\"" + dataSource + "\"]{*}";
- GenericServiceAPIResponseEntity<AlertStreamSchemaEntity> response = client.search()
- .startTime(0)
- .endTime(10 * DateUtils.MILLIS_PER_DAY)
- .pageSize(Integer.MAX_VALUE)
- .query(query)
- .send();
- client.close();
- if (response.getException() != null) {
- throw new Exception("Got an exception when query eagle service: " + response.getException());
- }
- return response.getObj();
- }
- catch (Exception ex) {
- LOG.error("Got an exception when query stream metadata service ", ex);
- throw new IllegalStateException(ex);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/email/AlertEmailComponent.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/email/AlertEmailComponent.java b/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/email/AlertEmailComponent.java
deleted file mode 100644
index d508882..0000000
--- a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/email/AlertEmailComponent.java
+++ /dev/null
@@ -1,32 +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.
- */
-package eagle.alert.email;
-
-import eagle.common.metric.AlertContext;
-
-/**
- * Alert email component is one part of an email, which could be an individual alert
- */
-public class AlertEmailComponent {
- private AlertContext alertContext;
- public AlertContext getAlertContext() {
- return alertContext;
- }
- public void setAlertContext(AlertContext alertContext) {
- this.alertContext = alertContext;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/email/AlertEmailContext.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/email/AlertEmailContext.java b/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/email/AlertEmailContext.java
deleted file mode 100644
index 2f1063c..0000000
--- a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/email/AlertEmailContext.java
+++ /dev/null
@@ -1,69 +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.
- */
-package eagle.alert.email;
-
-import java.util.List;
-
-/**
- * alert email bean
- * one email consists of a list of email component
- */
-public class AlertEmailContext {
- private List<AlertEmailComponent> components;
- private String sender;
- private String subject;
- private String recipients;
- private String velocityTplFile;
- private String cc;
-
- public List<AlertEmailComponent> getComponents() {
- return components;
- }
- public void setComponents(List<AlertEmailComponent> components) {
- this.components = components;
- }
- public String getVelocityTplFile() {
- return velocityTplFile;
- }
- public void setVelocityTplFile(String velocityTplFile) {
- this.velocityTplFile = velocityTplFile;
- }
- public String getRecipients() {
- return recipients;
- }
- public void setRecipients(String recipients) {
- this.recipients = recipients;
- }
- public String getSender() {
- return sender;
- }
- public void setSender(String sender) {
- this.sender = sender;
- }
- public String getSubject() {
- return subject;
- }
- public void setSubject(String subject) {
- this.subject = subject;
- }
- public String getCc() {
- return cc;
- }
- public void setCc(String cc) {
- this.cc = cc;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/entity/AlertAPIEntity.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/entity/AlertAPIEntity.java b/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/entity/AlertAPIEntity.java
deleted file mode 100644
index 4747fc6..0000000
--- a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/entity/AlertAPIEntity.java
+++ /dev/null
@@ -1,84 +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.
- */
-package eagle.alert.entity;
-
-import eagle.alert.common.AlertConstants;
-import eagle.common.metric.AlertContext;
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-import eagle.log.base.taggedlog.TaggedLogAPIEntity;
-import eagle.log.entity.meta.Column;
-import eagle.log.entity.meta.ColumnFamily;
-import eagle.log.entity.meta.Prefix;
-import eagle.log.entity.meta.Service;
-import eagle.log.entity.meta.Table;
-import eagle.log.entity.meta.TimeSeries;
-
-@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
-@Table("alertdetail")
-@ColumnFamily("f")
-@Prefix("hadoop")
-@Service(AlertConstants.ALERT_SERVICE_ENDPOINT_NAME)
-@TimeSeries(true)
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class AlertAPIEntity extends TaggedLogAPIEntity{
- @Column("description")
- private String description;
- @Column("remediationID")
- private String remediationID;
- @Column("remediationCallback")
- private String remediationCallback;
- @Column("alertContext")
- private AlertContext alertContext;
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- _pcs.firePropertyChange("description", null, null);
- }
-
- public String getRemediationID() {
- return remediationID;
- }
-
- public void setRemediationID(String remediationID) {
- this.remediationID = remediationID;
- _pcs.firePropertyChange("remediationID", null, null);
- }
-
- public String getRemediationCallback() {
- return remediationCallback;
- }
-
- public void setRemediationCallback(String remediationCallback) {
- this.remediationCallback = remediationCallback;
- _pcs.firePropertyChange("remediationCallback", null, null);
- }
-
- public AlertContext getAlertContext() {
- return alertContext;
- }
-
- public void setAlertContext(AlertContext alertContext) {
- this.alertContext = alertContext;
- _pcs.firePropertyChange("alertContext", null, null);
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/entity/AlertContextSerDeser.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/entity/AlertContextSerDeser.java b/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/entity/AlertContextSerDeser.java
deleted file mode 100644
index 7d3215b..0000000
--- a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/entity/AlertContextSerDeser.java
+++ /dev/null
@@ -1,98 +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.
- */
-package eagle.alert.entity;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import eagle.common.metric.AlertContext;
-import org.apache.hadoop.hbase.util.Bytes;
-
-import eagle.log.entity.meta.EntitySerDeser;
-
-public class AlertContextSerDeser implements EntitySerDeser<AlertContext> {
-
- @Override
- public AlertContext deserialize(byte[] bytes) {
- AlertContext context = new AlertContext();
- Map<String, String> properties = new HashMap<String, String>();
- final int length = bytes.length;
- if (length < 4) { return context; }
- int size = Bytes.toInt(bytes, 0, 4);
-
- int offset = 4;
- for (int i = 0; i < size; i++) {
- int keySize = Bytes.toInt(bytes, offset, 4);
- offset += 4;
- int valueSize = Bytes.toInt(bytes, offset, 4);
- offset += 4;
- String key = Bytes.toString(bytes, offset, keySize);
- offset += keySize;
- String value =Bytes.toString(bytes, offset, valueSize);
- offset += valueSize;
- properties.put(key, value);
- }
- context.addAll(properties);
- return context;
- }
-
- @Override
- public byte[] serialize(AlertContext context) {
-
- final Map<String, String> pair = context.getProperties();
- int totalSize = 4;
- for (Entry<String, String> entry : pair.entrySet()) {
- String key = entry.getKey();
- String value = entry.getValue();
- int keySize = 0;
- if(key!=null) keySize = key.getBytes().length;
- int valueSize = 0;
- if(value!=null) valueSize = value.getBytes().length;
- totalSize += keySize + valueSize + 8;
- }
- byte[] buffer = new byte[totalSize];
-
- Bytes.putInt(buffer, 0, pair.size());
- int offset = 4;
- for (Entry<String, String> entry : pair.entrySet()) {
- String key = entry.getKey();
- String value = entry.getValue();
-
- int keySize = key !=null ? key.getBytes().length : 0;
- int valueSize = value != null ? value.getBytes().length:0;
-
- Bytes.putInt(buffer, offset, keySize);
- offset += 4;
- Bytes.putInt(buffer, offset, valueSize);
- offset += 4;
-
-
- Bytes.putBytes(buffer, offset, key != null ? key.getBytes() : new byte[0], 0, keySize);
- offset += keySize;
- Bytes.putBytes(buffer, offset, value != null ? value.getBytes() : new byte[0], 0, valueSize);
- offset += valueSize;
- }
- return buffer;
- }
-
-
- @Override
- public Class<AlertContext> type(){
- return AlertContext.class;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/afe86834/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/entity/AlertDataSourceEntity.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/entity/AlertDataSourceEntity.java b/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/entity/AlertDataSourceEntity.java
deleted file mode 100644
index 2d0c842..0000000
--- a/eagle-core/eagle-alert/eagle-alert-base/src/main/java/eagle/alert/entity/AlertDataSourceEntity.java
+++ /dev/null
@@ -1,67 +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.
- */
-package eagle.alert.entity;
-
-import eagle.alert.common.AlertConstants;
-import eagle.log.base.taggedlog.TaggedLogAPIEntity;
-import eagle.log.entity.meta.*;
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
-@Table("alertDataSource")
-@ColumnFamily("f")
-@Prefix("alertDataSource")
-@Service(AlertConstants.ALERT_DATA_SOURCE_SERVICE_ENDPOINT_NAME)
-@JsonIgnoreProperties(ignoreUnknown = true)
-@TimeSeries(false)
-@Tags({"site", "dataSource"})
-public class AlertDataSourceEntity extends TaggedLogAPIEntity{
- @Column("a")
- private boolean enabled;
- @Column("b")
- private String config;
- @Column("c")
- private String desc;
-
- public String getConfig() {
- return config;
- }
-
- public void setConfig(String config) {
- this.config = config;
- valueChanged("config");
- }
-
- public boolean isEnabled() {
- return enabled;
- }
-
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- valueChanged("enabled");
- }
-
- public String getDesc() {
- return desc;
- }
-
- public void setDesc(String desc) {
- this.desc = desc;
- valueChanged("desc");
- }
-}