[ https://issues.apache.org/jira/browse/EAGLE-1046?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Zhao, Qingwen updated EAGLE-1046: --------------------------------- Description: 1. load policies to new site "sandbox" from policy prototypes by {{POST /rest/policyProto/loadToSite/sandbox}} {code} [ { "policyProto": { "name": "JobRpcThroughput", "description": "Policy for MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT", "inputStreams": [ "MAP_REDUCE_JOB_STREAM" ], "outputStreams": [ "MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT" ], "siteId": null, "definition": { "type": "siddhi", "value": "from MAP_REDUCE_JOB_STREAM[mapOpsPerSecond > 1000 or reduceOpsPerSecond > 1000 or avgOpsPerMapTask > 50 or avgOpsPerReduceTask > 50] select * insert into MAP_REDUCE_JOB_STREAM_RPC_THROUGHPUT_OUT;", "handlerClass": null, "properties": {}, "inputStreams": [], "outputStreams": [] }, "stateDefinition": null, "policyStatus": "DISABLED", "alertDefinition": { "templateType": "TEXT", "subject": "$site job rpc", "body": "$site job rpc throughput", "severity": "WARNING", "category": "JPM" }, "alertDeduplications": [ { "outputStreamId": "MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT", "dedupIntervalMin": "0", "dedupFields": [] } ], "partitionSpec": [ { "streamId": "MAP_REDUCE_JOB_STREAM_SANDBOX", "type": "SHUFFLE", "columns": [], "sortSpec": null } ], "dedicated": false, "parallelismHint": 5, "alertSeverity": "WARNING", "alertCategory": "JPM" }, "alertPublishmentIds": [] } ] {code} 2. create a new policy prototype with an existing policy by {{ POST /rest/policyProto/saveAsProto}} {code} { "policyProto": { "name": "JobRpcThroughput", "description": "Policy for MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT", "inputStreams": [ "MAP_REDUCE_JOB_STREAM_SANDBOX" ], "outputStreams": [ "MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT" ], "siteId": "sandbox", "definition": { "type": "siddhi", "value": "from MAP_REDUCE_JOB_STREAM_SANDBOX[mapOpsPerSecond > 1000 or reduceOpsPerSecond > 1000 or avgOpsPerMapTask > 50 or avgOpsPerReduceTask > 50] select * insert into MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT;", "handlerClass": null, "properties": {}, "inputStreams": [], "outputStreams": [] }, "stateDefinition": null, "policyStatus": "DISABLED", "alertDefinition": { "templateType": "TEXT", "subject": "$site job rpc", "body": "$site job rpc throughput", "severity": "WARNING", "category": "JPM" }, "alertDeduplications": [ { "outputStreamId": "MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT", "dedupIntervalMin": "0", "dedupFields": [] } ], "partitionSpec": [ { "streamId": "MAP_REDUCE_JOB_STREAM_SANDBOX", "type": "SHUFFLE", "columns": [], "sortSpec": null } ], "dedicated": false, "parallelismHint": 5, "alertSeverity": "WARNING", "alertCategory": "JPM" } } {code} 3. update or create a policy prototype by by {{ POST /rest/policyProto}} {code} { "policyProto": { "name": "JobRpcThroughput", "description": "Policy for MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT", "inputStreams": [ "MAP_REDUCE_JOB_STREAM" ], "outputStreams": [ "MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT" ], "siteId": null, "definition": { "type": "siddhi", "value": "from MAP_REDUCE_JOB_STREAM[mapOpsPerSecond > 1000 or reduceOpsPerSecond > 1000 or avgOpsPerMapTask > 50 or avgOpsPerReduceTask > 50] select * insert into MAP_REDUCE_JOB_STREAM_RPC_THROUGHPUT_OUT;", "handlerClass": null, "properties": {}, "inputStreams": [], "outputStreams": [] }, "stateDefinition": null, "policyStatus": "DISABLED", "alertDefinition": { "templateType": "TEXT", "subject": "$site job rpc", "body": "$site job rpc throughput", "severity": "WARNING", "category": "JPM" }, "alertDeduplications": [ { "outputStreamId": "MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT", "dedupIntervalMin": "0", "dedupFields": [] } ], "partitionSpec": [ { "streamId": "MAP_REDUCE_JOB_STREAM_SANDBOX", "type": "SHUFFLE", "columns": [], "sortSpec": null } ], "dedicated": false, "parallelismHint": 5, "alertSeverity": "WARNING", "alertCategory": "JPM" }, "alertPublishmentIds": [] } {code} 4. get all policy prototypes by {{GET /rest/policyProto}} 5. delete a policy prototype by {{ DELETE /rest/policyProto/\{uuid\} }} was: 1. load policies to new site "sandbox" from policy prototypes by {{POST /rest/policyProto/loadToSite/sandbox}} {code} [ { "policyProto": { "name": "JobRpcThroughput", "description": "Policy for MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT", "inputStreams": [ "MAP_REDUCE_JOB_STREAM" ], "outputStreams": [ "MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT" ], "siteId": null, "definition": { "type": "siddhi", "value": "from MAP_REDUCE_JOB_STREAM[mapOpsPerSecond > 1000 or reduceOpsPerSecond > 1000 or avgOpsPerMapTask > 50 or avgOpsPerReduceTask > 50] select * insert into MAP_REDUCE_JOB_STREAM_RPC_THROUGHPUT_OUT;", "handlerClass": null, "properties": {}, "inputStreams": [], "outputStreams": [] }, "stateDefinition": null, "policyStatus": "DISABLED", "alertDefinition": { "templateType": "TEXT", "subject": "$site job rpc", "body": "$site job rpc throughput", "severity": "WARNING", "category": "JPM" }, "alertDeduplications": [ { "outputStreamId": "MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT", "dedupIntervalMin": "0", "dedupFields": [] } ], "partitionSpec": [ { "streamId": "MAP_REDUCE_JOB_STREAM_SANDBOX", "type": "SHUFFLE", "columns": [], "sortSpec": null } ], "dedicated": false, "parallelismHint": 5, "alertSeverity": "WARNING", "alertCategory": "JPM" }, "alertPublishmentIds": [] } ] {code} 2. create a new policy prototype with an existing policy by {{ POST /rest/policyProto/saveAsProto}} {code} { "policyProto": { "name": "JobRpcThroughput", "description": "Policy for MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT", "inputStreams": [ "MAP_REDUCE_JOB_STREAM_SANDBOX" ], "outputStreams": [ "MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT" ], "siteId": "sandbox", "definition": { "type": "siddhi", "value": "from MAP_REDUCE_JOB_STREAM_SANDBOX[mapOpsPerSecond > 1000 or reduceOpsPerSecond > 1000 or avgOpsPerMapTask > 50 or avgOpsPerReduceTask > 50] select * insert into MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT;", "handlerClass": null, "properties": {}, "inputStreams": [], "outputStreams": [] }, "stateDefinition": null, "policyStatus": "DISABLED", "alertDefinition": { "templateType": "TEXT", "subject": "$site job rpc", "body": "$site job rpc throughput", "severity": "WARNING", "category": "JPM" }, "alertDeduplications": [ { "outputStreamId": "MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT", "dedupIntervalMin": "0", "dedupFields": [] } ], "partitionSpec": [ { "streamId": "MAP_REDUCE_JOB_STREAM_SANDBOX", "type": "SHUFFLE", "columns": [], "sortSpec": null } ], "dedicated": false, "parallelismHint": 5, "alertSeverity": "WARNING", "alertCategory": "JPM" } } {code} 3. update or create a policy prototype by by {{ POST /rest/policyProto}} {code} { "policyProto": { "name": "JobRpcThroughput", "description": "Policy for MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT", "inputStreams": [ "MAP_REDUCE_JOB_STREAM" ], "outputStreams": [ "MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT" ], "siteId": null, "definition": { "type": "siddhi", "value": "from MAP_REDUCE_JOB_STREAM[mapOpsPerSecond > 1000 or reduceOpsPerSecond > 1000 or avgOpsPerMapTask > 50 or avgOpsPerReduceTask > 50] select * insert into MAP_REDUCE_JOB_STREAM_RPC_THROUGHPUT_OUT;", "handlerClass": null, "properties": {}, "inputStreams": [], "outputStreams": [] }, "stateDefinition": null, "policyStatus": "DISABLED", "alertDefinition": { "templateType": "TEXT", "subject": "$site job rpc", "body": "$site job rpc throughput", "severity": "WARNING", "category": "JPM" }, "alertDeduplications": [ { "outputStreamId": "MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT", "dedupIntervalMin": "0", "dedupFields": [] } ], "partitionSpec": [ { "streamId": "MAP_REDUCE_JOB_STREAM_SANDBOX", "type": "SHUFFLE", "columns": [], "sortSpec": null } ], "dedicated": false, "parallelismHint": 5, "alertSeverity": "WARNING", "alertCategory": "JPM" }, "alertPublishmentIds": [] } {code} 4. get all policy prototypes by {{GET /rest/policyProto}} 5. delete a policy prototype by {{DELETE /rest/policyProto/\{uuid\} }} > Eagle supports policies import to a new site from a policy prototype > -------------------------------------------------------------------- > > Key: EAGLE-1046 > URL: https://issues.apache.org/jira/browse/EAGLE-1046 > Project: Eagle > Issue Type: New Feature > Affects Versions: v0.6.0 > Reporter: Zhao, Qingwen > Assignee: Jilin, Jiang > > 1. load policies to new site "sandbox" from policy prototypes by {{POST > /rest/policyProto/loadToSite/sandbox}} > {code} > [ { "policyProto": { > "name": "JobRpcThroughput", > "description": "Policy for > MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT", > "inputStreams": [ > "MAP_REDUCE_JOB_STREAM" > ], > "outputStreams": [ > "MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT" > ], > "siteId": null, > "definition": { > "type": "siddhi", > "value": "from MAP_REDUCE_JOB_STREAM[mapOpsPerSecond > > 1000 or reduceOpsPerSecond > 1000 or avgOpsPerMapTask > 50 or > avgOpsPerReduceTask > 50] select * insert into > MAP_REDUCE_JOB_STREAM_RPC_THROUGHPUT_OUT;", > "handlerClass": null, > "properties": {}, > "inputStreams": [], > "outputStreams": [] > }, > "stateDefinition": null, > "policyStatus": "DISABLED", > "alertDefinition": { > "templateType": "TEXT", > "subject": "$site job rpc", > "body": "$site job rpc throughput", > "severity": "WARNING", > "category": "JPM" > }, > "alertDeduplications": [ > { > "outputStreamId": > "MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT", > "dedupIntervalMin": "0", > "dedupFields": [] > } > ], > "partitionSpec": [ > { > "streamId": "MAP_REDUCE_JOB_STREAM_SANDBOX", > "type": "SHUFFLE", > "columns": [], > "sortSpec": null > } > ], > "dedicated": false, > "parallelismHint": 5, > "alertSeverity": "WARNING", > "alertCategory": "JPM" > }, > "alertPublishmentIds": [] > } > ] > {code} > 2. create a new policy prototype with an existing policy by {{ POST > /rest/policyProto/saveAsProto}} > {code} > { "policyProto": { > "name": "JobRpcThroughput", > "description": "Policy for > MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT", > "inputStreams": [ > "MAP_REDUCE_JOB_STREAM_SANDBOX" > ], > "outputStreams": [ > "MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT" > ], > "siteId": "sandbox", > "definition": { > "type": "siddhi", > "value": "from MAP_REDUCE_JOB_STREAM_SANDBOX[mapOpsPerSecond > > 1000 or reduceOpsPerSecond > 1000 or avgOpsPerMapTask > 50 or > avgOpsPerReduceTask > 50] select * insert into > MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT;", > "handlerClass": null, > "properties": {}, > "inputStreams": [], > "outputStreams": [] > }, > "stateDefinition": null, > "policyStatus": "DISABLED", > "alertDefinition": { > "templateType": "TEXT", > "subject": "$site job rpc", > "body": "$site job rpc throughput", > "severity": "WARNING", > "category": "JPM" > }, > "alertDeduplications": [ > { > "outputStreamId": > "MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT", > "dedupIntervalMin": "0", > "dedupFields": [] > } > ], > "partitionSpec": [ > { > "streamId": "MAP_REDUCE_JOB_STREAM_SANDBOX", > "type": "SHUFFLE", > "columns": [], > "sortSpec": null > } > ], > "dedicated": false, > "parallelismHint": 5, > "alertSeverity": "WARNING", > "alertCategory": "JPM" > } > } > {code} > 3. update or create a policy prototype by by {{ POST /rest/policyProto}} > {code} > { > "policyProto": { > "name": "JobRpcThroughput", > "description": "Policy for > MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT", > "inputStreams": [ > "MAP_REDUCE_JOB_STREAM" > ], > "outputStreams": [ > "MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT" > ], > "siteId": null, > "definition": { > "type": "siddhi", > "value": "from MAP_REDUCE_JOB_STREAM[mapOpsPerSecond > 1000 > or reduceOpsPerSecond > 1000 or avgOpsPerMapTask > 50 or avgOpsPerReduceTask > > 50] select * insert into MAP_REDUCE_JOB_STREAM_RPC_THROUGHPUT_OUT;", > "handlerClass": null, > "properties": {}, > "inputStreams": [], > "outputStreams": [] > }, > "stateDefinition": null, > "policyStatus": "DISABLED", > "alertDefinition": { > "templateType": "TEXT", > "subject": "$site job rpc", > "body": "$site job rpc throughput", > "severity": "WARNING", > "category": "JPM" > }, > "alertDeduplications": [ > { > "outputStreamId": > "MAP_REDUCE_JOB_STREAM_SANDBOX_RPC_THROUGHPUT_OUT", > "dedupIntervalMin": "0", > "dedupFields": [] > } > ], > "partitionSpec": [ > { > "streamId": "MAP_REDUCE_JOB_STREAM_SANDBOX", > "type": "SHUFFLE", > "columns": [], > "sortSpec": null > } > ], > "dedicated": false, > "parallelismHint": 5, > "alertSeverity": "WARNING", > "alertCategory": "JPM" > }, > "alertPublishmentIds": [] > } > {code} > 4. get all policy prototypes by {{GET /rest/policyProto}} > 5. delete a policy prototype by {{ DELETE /rest/policyProto/\{uuid\} }} -- This message was sent by Atlassian JIRA (v6.4.14#64029)