use of com.hortonworks.streamline.common.exception.ComponentConfigException in project streamline by hortonworks.
the class CustomProcessorBoltFluxComponent method validateConfig.
@Override
public void validateConfig() throws ComponentConfigException {
super.validateConfig();
validateStringFields();
String fieldToValidate = TopologyLayoutConstants.JSON_KEY_OUTPUT_STREAMS_SCHEMA;
try {
Map<String, Map> outputSchema = (Map) conf.get(fieldToValidate);
if (outputSchema == null || outputSchema.keySet().isEmpty()) {
throw new ComponentConfigException(String.format(TopologyLayoutConstants.ERR_MSG_MISSING_INVALID_CONFIG, fieldToValidate));
}
for (Map.Entry<String, Map> entry : outputSchema.entrySet()) {
Utils.getSchemaFromConfig(entry.getValue());
}
this.validateCustomConfigFields();
} catch (ClassCastException | IOException e) {
throw new ComponentConfigException(String.format(TopologyLayoutConstants.ERR_MSG_MISSING_INVALID_CONFIG, fieldToValidate));
}
}
Aggregations