package com.DemandCube.KafkaSphere.kafka;

import com.DemandCube.KafkaSphere.kafka.Metadata;

import kafka.javaapi.TopicMetadata;
import kafka.javaapi.TopicMetadataRequest;
import kafka.javaapi.consumer.SimpleConsumer;

import java.util.*;

/**
 * Created by stites on 7/8/14.
 */
public class Offsets {

}

@@ -298,10 +298,708 @@
 sets %7B%0A%0A
+  public static void main(String%5B%5D args) %7B%0A    TopicLeaders();%0A  %7D%0A%0A%0A  public static HashMap%3CString, String%3E TopicLeaders()%7B%0A    HashMap%3CString, HashMap%3CString, String%3E%3E metadata = Metadata.getDetails();%0A    HashMap%3CString, String%3E topicLeaders = new HashMap%3C%3E();%0A%0A    // iterate through the items so that we can get the topic leaders%0A    Iterator it = metadata.entrySet().iterator();%0A    while (it.hasNext()) %7B%0A      Map.Entry pairs = (Map.Entry)it.next();%0A      String topic = pairs.getKey().toString();%0A      HashMap%3CString, String%3E topicData = (HashMap)pairs.getValue();%0A      String leader = topicData.get(%22leader%22);%0A      topicLeaders.put(topic, leader);%0A    %7D%0A%0A    return topicLeaders;%0A  %7D;%0A
 %7D%0A

add - TopicLeaders