in src/main/java/ScalingClient.java [155:205]
private void run() throws Exception {
loadParams();
ScalingOperationReport report = null;
switch (this.scalingAction) {
case scaleUp:
switch (this.scaleBy) {
case count:
report = scaler.scaleUp(this.streamName, this.scaleCount, this.minShards, this.maxShards, this.doWait);
break;
case pct:
report = scaler.scaleUp(this.streamName, this.scalePct, this.minShards, this.maxShards, this.doWait);
break;
default:
break;
}
break;
case scaleDown:
switch (this.scaleBy) {
case count:
report = scaler.scaleDown(this.streamName, this.scaleCount, this.minShards, this.maxShards,
this.doWait);
break;
case pct:
report = scaler.scaleDown(this.streamName, this.scalePct, this.minShards, this.maxShards, this.doWait);
break;
default:
break;
}
break;
case resize:
switch (this.scaleBy) {
case count:
report = scaler.resize(this.streamName, this.scaleCount, this.minShards, this.maxShards, this.doWait);
break;
case pct:
throw new Exception("Cannot resize by a Percentage");
default:
break;
}
break;
case report:
report = scaler.reportFor(ScalingCompletionStatus.ReportOnly, this.streamName, 0, ScaleDirection.NONE);
default:
break;
}
System.out.println("Scaling Operation Complete");
System.out.println(report.toString());
}