in src/main/java/com/amazonaws/services/kinesis/scaling/auto/AutoscalingConfiguration.java [201:236]
public void validate() throws InvalidConfigurationException {
if (this.streamName == null || this.streamName.equals("")) {
throw new InvalidConfigurationException("Stream Name must be specified");
}
if (this.scaleUp == null && this.scaleDown == null) {
throw new InvalidConfigurationException("Must provide at least one scale up or scale down configuration");
}
if ((this.scaleUp != null && this.scaleUp.getScalePct() == null) || this.scaleUp.getScalePct() < 0) {
throw new InvalidConfigurationException(
String.format("Scale Up Percentage of %s is invalid or null", this.scaleUp.getScalePct()));
}
if ((this.scaleDown != null && this.scaleDown.getScalePct() == null) || this.scaleDown.getScalePct() < 0) {
throw new InvalidConfigurationException(
String.format("Scale Down Percentage of %s is invalid or null", this.scaleDown.getScalePct()));
}
if (this.minShards != null && this.maxShards != null && this.minShards > this.maxShards) {
throw new InvalidConfigurationException("Min Shard Count must be less than Max Shard Count");
}
// set the default operation types to 'all' if none were provided
if (this.scaleOnOperations == null || this.scaleOnOperations.size() == 0) {
this.scaleOnOperations = Arrays.asList(KinesisOperationType.values());
}
// set a 0 cool off if none was provided
if (this.scaleDown.getCoolOffMins() == null) {
this.scaleDown.setCoolOffMins(0);
}
if (this.scaleUp.getCoolOffMins() == null) {
this.scaleUp.setCoolOffMins(0);
}
}