public static void postSchedule(IMetadataServiceClient client, ScheduleState state, ConfigBusProducer producer) {
client.addScheduleState(state);
ConfigValue value = new ConfigValue();
value.setValue(state.getVersion());
value.setValueVersionId(true);
for (String topo : state.getSpoutSpecs().keySet()) {
producer.send(MessageFormat.format(ZK_ALERT_CONFIG_SPOUT, topo), value);
}
for (String topo : state.getGroupSpecs().keySet()) {
producer.send(MessageFormat.format(ZK_ALERT_CONFIG_ROUTER, topo), value);
}
for (String topo : state.getAlertSpecs().keySet()) {
producer.send(MessageFormat.format(ZK_ALERT_CONFIG_ALERT, topo), value);
}
for (String topo : state.getPublishSpecs().keySet()) {
producer.send(MessageFormat.format(ZK_ALERT_CONFIG_PUBLISHER, topo), value);
}
}