SOLR-10339: New set-trigger and remove-trigger APIs for autoscaling

This commit is contained in:
Shalin Shekhar Mangar 2017-03-24 13:11:10 +05:30
parent a4f5dc5711
commit 6904e04468
4 changed files with 48 additions and 24 deletions

View File

@ -71,6 +71,8 @@ New Features
* SOLR-10393: Adds UUID Streaming Evaluator (Dennis Gove)
* SOLR-10339: New set-trigger and remove-trigger APIs for autoscaling. (shalin)
Bug Fixes
----------------------
* SOLR-9262: Connection and read timeouts are being ignored by UpdateShardHandler after SOLR-4509.

View File

@ -19,8 +19,6 @@ package org.apache.solr.cloud.autoscaling;
import java.util.Date;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.function.Predicate;
public class AutoScaling {

View File

@ -41,15 +41,39 @@
"actions": {
"type": "array",
"description": "The actions to be performed in sequence when the trigger is activated",
"items": {
"type": "object"
"event": {
"type": "string",
"description": "The event type on which to set a trigger"
},
"waitFor": {
"type": "string",
"description": "The amount of time to wait after the trigger condition is satisfied before trigger is activated"
},
"lowerBound": {
"type": "number",
"description": "The lower bound of the condition below which the trigger is activated"
},
"upperBound": {
"type": "number",
"description": "The upper bound of the condition below which the trigger is activated"
},
"enabled": {
"type": "boolean",
"description": "The state of the trigger"
},
"actions": {
"type": "array",
"description": "The actions to be performed in sequence when the trigger is activated",
"items": {
"type": "object"
}
}
}
},
"required": [
"name",
"event"
]
},
"required": [
"name",
"event"
]
}
},
"remove-trigger": {
"description": "Remove a trigger",
@ -82,21 +106,21 @@
},
"stage": {
"type": "array",
"description": "The stage of the trigger for which to listen"
"description": "The stage of the trigger for which to listen",
"items": {
"type" : "string"
}
},
"beforeAction": {
"type": "array",
"description": "The name of the action before which the listener should be notified"
"description": "The name of the action before which the listener should be notified",
"items": {
"type" : "string"
}
},
"afterAction": {
"type": "array",
"description": "The name of the action after which the listener should be notified"
"description": "The name of the action after which the listener should be notified",
"items": {
"type" : "string"
}

View File

@ -195,16 +195,16 @@ public class AutoScalingHandlerTest extends SolrCloudTestCase {
"\t\t\"waitFor\" : \"10m\",\n" +
"\t\t\"enabled\" : \"true\",\n" +
"\t\t\"actions\" : [\n" +
"\t\t\t{\n" +
"\t\t\t\t\"name\" : \"compute_plan\",\n" +
"\t\t\t\t\"class\" : \"solr.ComputePlanAction\"\n" +
"\t\t\t},\n" +
"\t\t\t{\n" +
"\t\t\t\t\"name\" : \"log_plan\",\n" +
"\t\t\t\t\"class\" : \"solr.LogPlanAction\",\n" +
"\t\t\t\t\"collection\" : \".system\"\n" +
"\t\t\t}\n" +
"\t\t]\n" +
"\t\t\t{\n" +
"\t\t\t\t\"name\" : \"compute_plan\",\n" +
"\t\t\t\t\"class\" : \"solr.ComputePlanAction\"\n" +
"\t\t\t},\n" +
"\t\t\t{\n" +
"\t\t\t\t\"name\" : \"log_plan\",\n" +
"\t\t\t\t\"class\" : \"solr.LogPlanAction\",\n" +
"\t\t\t\t\"collection\" : \".system\"\n" +
"\t\t\t}\n" +
"\t\t]\n" +
"\t}\n" +
"}";
SolrRequest req = new AutoScalingRequest(SolrRequest.METHOD.POST, path, setTriggerCommand);
@ -358,4 +358,4 @@ public class AutoScalingHandlerTest extends SolrCloudTestCase {
return null;
}
}
}
}