Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
Permit the ability to scale down (#1433)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Graham authored Sep 26, 2016
1 parent 6a999d0 commit ae21add
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,6 @@ PackingPlans.PackingPlan buildNewPackingPlan(PackingPlans.PackingPlan currentPro
Map<String, Integer> componentCounts = currentPackingPlan.getComponentCounts();
Map<String, Integer> componentChanges = parallelismDelta(componentCounts, changeRequests);

for (String componentName : componentChanges.keySet()) {
Integer change = componentChanges.get(componentName);
if (change < 0) {
throw new IllegalArgumentException(String.format(
"Request made to change component %s parallelism by %d. Scaling component "
+ "parallelism down is not currently supported.", componentName, change));
}
}
// Create an instance of the packing class
String repackingClass = Context.repackingClass(config);
IRepacking packing;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public void testUpdateTopologyHandler() throws Exception {
PowerMockito.when(Runtime.schedulerStateManagerAdaptor(runtime)).thenReturn(manager);

RoundRobinPacking packing = new RoundRobinPacking();
String newParallelism = "foo:3,bar:6";
String newParallelism = "testSpout:1,testBolt:4";

PackingPlans.PackingPlan currentPlan =
PackingTestUtils.testProtoPackingPlan(TOPOLOGY_NAME, packing);
Expand All @@ -173,24 +173,6 @@ public void testUpdateTopologyHandler() throws Exception {
verify(client, Mockito.times(1)).updateTopology(updateTopologyRequest);
}

@Test(expected = IllegalArgumentException.class)
public void testScaleDownNotSupported() {
RuntimeManagerRunner runner = newRuntimeManagerRunner(Command.UPDATE);

PackingPlans.PackingPlan currentPlan =
PackingTestUtils.testProtoPackingPlan(TOPOLOGY_NAME, new RoundRobinPacking());

try {
runner.buildNewPackingPlan(
currentPlan, runner.parseNewParallelismParam("testSpout:1,testBolt:4"), null);
} catch (IllegalArgumentException e) {
Assert.assertEquals(e.getMessage(),
"Request made to change component testSpout parallelism by -1. Scaling component "
+ "parallelism down is not currently supported.");
throw e;
}
}

@Test
public void testParseNewParallelismParam() {
RuntimeManagerRunner runner = newRuntimeManagerRunner(Command.SUBMIT);
Expand Down

0 comments on commit ae21add

Please sign in to comment.