[50/50] incubator-eagle git commit: [EAGLE-635] Refactor policy parser and validator for richer plan details and better performance
[EAGLE-635] Refactor policy parser and validator for richer plan details and better performance ## Changes * Refactor policy parser and validator for richer plan details and better performance * Decouple PolicyExecutionPlan and PolicyValidation ## API * Parse API ~~~ POST /metadata/policies/parse Accept-Type: text from HDFS_AUDIT_LOG_ENRICHED_STREAM_SANDBOX#window.timeBatch(2 min) select cmd, user, count() as total_count group by cmd,user insert into HDFS_AUDIT_LOG_ENRICHED_STREAM_SANDBOX_OUT" ~~~ * Validation API ~~~ POST /metadata/policies/validate Accept-Type: application/json { "name": "hdfsPolicy", "description": "hdfsPolicy", "inputStreams": [ "HDFS_AUDIT_LOG_ENRICHED_STREAM_SANDBOX" ], "outputStreams": [ "HDFS_AUDIT_LOG_ENRICHED_STREAM_SANDBOX_OUT" ], "definition": { "type": "siddhi", "value": "from HDFS_AUDIT_LOG_ENRICHED_STREAM_SANDBOX#window.timeBatch(2 min) select cmd, user, count() as total_count group by cmd,user insert into HDFS_AUDIT_LOG_ENRICHED_STREAM_SANDBOX_OUT " }, "partitionSpec": [ { "streamId": "hdfs_audit_log_enriched_stream", "type": "GROUPBY", "columns" : [ "cmd" ] } ], "parallelismHint": 2 } ~~~ Author: Hao ChenCloses #529 from haoch/RefactorPolicyValidator. Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/6dbdb4f7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/6dbdb4f7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/6dbdb4f7 Branch: refs/heads/master Commit: 6dbdb4f72ec5adf89f4f7a13bf766e01e3ff6705 Parents: adc2ba9 Author: Hao Chen Authored: Wed Oct 19 10:28:09 2016 +0800 Committer: Hao Chen Committed: Wed Oct 19 10:28:09 2016 +0800 -- .../conf/sandbox-userprofile-scheduler.conf | 2 +- .../eagle-alert/alert-common/pom.xml| 8 - .../eagle-alert/alert-engine/pom.xml| 10 +- .../evaluator/impl/SiddhiDefinitionAdapter.java | 13 + .../alert-metadata-service/pom.xml | 13 - .../metadata/resource/MetadataResource.java | 10 +- .../metadata/resource/PolicyCompiler.java | 235 +++ .../metadata/resource/PolicyExecutionPlan.java | 100 .../metadata/resource/PolicyParseResult.java| 65 + .../metadata/resource/PolicyValidation.java | 97 .../resource/PolicyValidationResult.java| 76 ++ .../metadata/resource/PolicyValidator.java | 124 -- .../metadata/resource/PolicyCompilerTest.java | 195 +++ .../metadata/resource/PolicyValidatorTest.java | 187 --- 14 files changed, 699 insertions(+), 436 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6dbdb4f7/eagle-assembly/src/main/conf/sandbox-userprofile-scheduler.conf -- diff --git a/eagle-assembly/src/main/conf/sandbox-userprofile-scheduler.conf b/eagle-assembly/src/main/conf/sandbox-userprofile-scheduler.conf index f54162d..4593a7e 100644 --- a/eagle-assembly/src/main/conf/sandbox-userprofile-scheduler.conf +++ b/eagle-assembly/src/main/conf/sandbox-userprofile-scheduler.conf @@ -63,4 +63,4 @@ akka { # Filter of log events that is used by the LoggingAdapter before # publishing log events to the eventStream. logging-filter = "akka.event.slf4j.Slf4jLoggingFilter" -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6dbdb4f7/eagle-core/eagle-alert-parent/eagle-alert/alert-common/pom.xml -- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/pom.xml b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/pom.xml index 57a0157..fd3eccd 100644 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/pom.xml +++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/pom.xml @@ -63,10 +63,6 @@ slf4j-api -org.slf4j -slf4j-log4j12 - - org.apache.curator curator-framework @@ -82,10 +78,6 @@ com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider - - - - joda-time joda-time http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6dbdb4f7/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/pom.xml -- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/pom.xml
incubator-eagle git commit: [EAGLE-635] Refactor policy parser and validator for richer plan details and better performance
Repository: incubator-eagle Updated Branches: refs/heads/master adc2ba900 -> 6dbdb4f72 [EAGLE-635] Refactor policy parser and validator for richer plan details and better performance ## Changes * Refactor policy parser and validator for richer plan details and better performance * Decouple PolicyExecutionPlan and PolicyValidation ## API * Parse API ~~~ POST /metadata/policies/parse Accept-Type: text from HDFS_AUDIT_LOG_ENRICHED_STREAM_SANDBOX#window.timeBatch(2 min) select cmd, user, count() as total_count group by cmd,user insert into HDFS_AUDIT_LOG_ENRICHED_STREAM_SANDBOX_OUT" ~~~ * Validation API ~~~ POST /metadata/policies/validate Accept-Type: application/json { "name": "hdfsPolicy", "description": "hdfsPolicy", "inputStreams": [ "HDFS_AUDIT_LOG_ENRICHED_STREAM_SANDBOX" ], "outputStreams": [ "HDFS_AUDIT_LOG_ENRICHED_STREAM_SANDBOX_OUT" ], "definition": { "type": "siddhi", "value": "from HDFS_AUDIT_LOG_ENRICHED_STREAM_SANDBOX#window.timeBatch(2 min) select cmd, user, count() as total_count group by cmd,user insert into HDFS_AUDIT_LOG_ENRICHED_STREAM_SANDBOX_OUT " }, "partitionSpec": [ { "streamId": "hdfs_audit_log_enriched_stream", "type": "GROUPBY", "columns" : [ "cmd" ] } ], "parallelismHint": 2 } ~~~ Author: Hao ChenCloses #529 from haoch/RefactorPolicyValidator. Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/6dbdb4f7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/6dbdb4f7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/6dbdb4f7 Branch: refs/heads/master Commit: 6dbdb4f72ec5adf89f4f7a13bf766e01e3ff6705 Parents: adc2ba9 Author: Hao Chen Authored: Wed Oct 19 10:28:09 2016 +0800 Committer: Hao Chen Committed: Wed Oct 19 10:28:09 2016 +0800 -- .../conf/sandbox-userprofile-scheduler.conf | 2 +- .../eagle-alert/alert-common/pom.xml| 8 - .../eagle-alert/alert-engine/pom.xml| 10 +- .../evaluator/impl/SiddhiDefinitionAdapter.java | 13 + .../alert-metadata-service/pom.xml | 13 - .../metadata/resource/MetadataResource.java | 10 +- .../metadata/resource/PolicyCompiler.java | 235 +++ .../metadata/resource/PolicyExecutionPlan.java | 100 .../metadata/resource/PolicyParseResult.java| 65 + .../metadata/resource/PolicyValidation.java | 97 .../resource/PolicyValidationResult.java| 76 ++ .../metadata/resource/PolicyValidator.java | 124 -- .../metadata/resource/PolicyCompilerTest.java | 195 +++ .../metadata/resource/PolicyValidatorTest.java | 187 --- 14 files changed, 699 insertions(+), 436 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6dbdb4f7/eagle-assembly/src/main/conf/sandbox-userprofile-scheduler.conf -- diff --git a/eagle-assembly/src/main/conf/sandbox-userprofile-scheduler.conf b/eagle-assembly/src/main/conf/sandbox-userprofile-scheduler.conf index f54162d..4593a7e 100644 --- a/eagle-assembly/src/main/conf/sandbox-userprofile-scheduler.conf +++ b/eagle-assembly/src/main/conf/sandbox-userprofile-scheduler.conf @@ -63,4 +63,4 @@ akka { # Filter of log events that is used by the LoggingAdapter before # publishing log events to the eventStream. logging-filter = "akka.event.slf4j.Slf4jLoggingFilter" -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6dbdb4f7/eagle-core/eagle-alert-parent/eagle-alert/alert-common/pom.xml -- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/pom.xml b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/pom.xml index 57a0157..fd3eccd 100644 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/pom.xml +++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/pom.xml @@ -63,10 +63,6 @@ slf4j-api -org.slf4j -slf4j-log4j12 - - org.apache.curator curator-framework @@ -82,10 +78,6 @@ com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider - - - - joda-time joda-time http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6dbdb4f7/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/pom.xml -- diff --git