if (!command.equals("delete_committed_offsets")) {
throw new IllegalArgumentException(
"command has to be one of \"delete_committed_offsets\"");
}
SecorConfig config = SecorConfig.load();
ZookeeperConnector zookeeperConnector = new ZookeeperConnector(config);
String topic = commandLine.getOptionValue("topic");
if (commandLine.hasOption("partition")) {
int partition =
((Number) commandLine.getParsedOptionValue("partition")).intValue();
TopicPartition topicPartition = new TopicPartition(topic, partition);
zookeeperConnector.deleteCommittedOffsetPartitionCount(topicPartition);
} else {
zookeeperConnector.deleteCommittedOffsetTopicCount(topic);
}
} catch (Throwable t) {
LOG.error("Zookeeper client failed", t);
System.exit(1);
}