public class TopicManager
{
/*
This class deals with all topic related operations-
creation, deletion and maybe modification in future
*/
private static ZkClient zkClient = null;
private static ZkUtils zkUtils = null;
public static void createTopic(String topicName) throws Exception
{
Properties topicConfiguration = new Properties();
MessageLogger.debugAlways(KafkaConstants.COMPONENT_NAME,"Creating topic with name: " + topicName);
runAdminUtilsCommand( zkUtils ->
{
AdminUtils.createTopic(zkUtils, topicName, 0, 3, topicConfiguration,new RackAwareMode.Disabled$());
return true;
});
}
public static void deleteTopic(String topicName) throws Exception
{
// Please complete this method
}
}