(map->tp-om-map m)
Takes a Clojure map (see below for example) and converts it to a java.util.Map made of TopicPartition as keys and OffsetAndMetadata as values
{{:topic "test", :partition 77} {:offset 34, :metadata "data data"}, {:topic "prod", :partition 4} {:offset 24, :metadata "more data"}, {:topic "dev", :partition 1} {:offset 234, :metadata "loads of data"}, {:topic "dev", :partition 7} {:offset 23, :metadata "mega data"}}
Takes a Clojure map (see below for example) and converts it to a java.util.Map made of TopicPartition as keys and OffsetAndMetadata as values {{:topic "test", :partition 77} {:offset 34, :metadata "data data"}, {:topic "prod", :partition 4} {:offset 24, :metadata "more data"}, {:topic "dev", :partition 1} {:offset 234, :metadata "loads of data"}, {:topic "dev", :partition 7} {:offset 23, :metadata "mega data"}}
(metrics->map m)
Returns a sequence of maps, with each map representing a metric. The composition of each map is :group :name :description :tags :value
Usage : (metrics->map m) ;; => [{:group "consumer-coordinator-metrics", ;; :name "sync-time-max", ;; :description "The max time taken for a group sync", ;; :tags {"client-id" "consumer-3"}, ;; :value 0.0} ;; {:group "consumer-fetch-manager-metrics", ;; :name "bytes-consumed-rate", ;; :description "The average number of bytes consumed per second", ;; :tags {"client-id" "consumer-3"}, ;; :value 0.0}]
Returns a sequence of maps, with each map representing a metric. The composition of each map is :group :name :description :tags :value Usage : (metrics->map m) ;; => [{:group "consumer-coordinator-metrics", ;; :name "sync-time-max", ;; :description "The max time taken for a group sync", ;; :tags {"client-id" "consumer-3"}, ;; :value 0.0} ;; {:group "consumer-fetch-manager-metrics", ;; :name "bytes-consumed-rate", ;; :description "The average number of bytes consumed per second", ;; :tags {"client-id" "consumer-3"}, ;; :value 0.0}]
(str-pi-map->map str-pi)
Takes a java.util.Map made of Strings as keys and java.util.List <PartitionInfo> as values, converts it to a Map with the keys being the topic name and the values being a vector of maps (each map representing information about a topic partition) e.g
{ "topic-a" [{:topic "topic-a", :partition 1, :leader {:id 1, :host "172.17.0.3", :port 9092}, :replicas [{:id 1, :host "172.17.0.3", :port 9092} {:id 2, :host "172.17.0.2", :port 9093} {:id 3, :host "172.17.0.4", :port 9094}], :in-sync-replicas [{:id 1, :host "172.17.0.3", :port 9092} {:id 2, :host "172.17.0.2", :port 9093} {:id 3, :host "172.17.0.4", :port 9094}]} {:topic "topic-a", :partition 0, :leader {:id 3, :host "172.17.0.4", :port 9094}, :replicas [{:id 3, :host "172.17.0.4", :port 9094} {:id 1, :host "172.17.0.3", :port 9092} {:id 2, :host "172.17.0.2", :port 9093}], :in-sync-replicas [{:id 3, :host "172.17.0.4", :port 9094} {:id 1, :host "172.17.0.3", :port 9092} {:id 2, :host "172.17.0.2", :port 9093}]}],
"topic-b" [{:topic "topic-b", :partition 0, :leader {:id 3, :host "172.17.0.4", :port 9094}, :replicas [{:id 3, :host "172.17.0.4", :port 9094} {:id 1, :host "172.17.0.3", :port 9092} {:id 2, :host "172.17.0.2", :port 9093}], :in-sync-replicas [{:id 3, :host "172.17.0.4", :port 9094} {:id 1, :host "172.17.0.3", :port 9092} {:id 2, :host "172.17.0.2", :port 9093}]}]}
Takes a java.util.Map made of Strings as keys and java.util.List <PartitionInfo> as values, converts it to a Map with the keys being the topic name and the values being a vector of maps (each map representing information about a topic partition) e.g { "topic-a" [{:topic "topic-a", :partition 1, :leader {:id 1, :host "172.17.0.3", :port 9092}, :replicas [{:id 1, :host "172.17.0.3", :port 9092} {:id 2, :host "172.17.0.2", :port 9093} {:id 3, :host "172.17.0.4", :port 9094}], :in-sync-replicas [{:id 1, :host "172.17.0.3", :port 9092} {:id 2, :host "172.17.0.2", :port 9093} {:id 3, :host "172.17.0.4", :port 9094}]} {:topic "topic-a", :partition 0, :leader {:id 3, :host "172.17.0.4", :port 9094}, :replicas [{:id 3, :host "172.17.0.4", :port 9094} {:id 1, :host "172.17.0.3", :port 9092} {:id 2, :host "172.17.0.2", :port 9093}], :in-sync-replicas [{:id 3, :host "172.17.0.4", :port 9094} {:id 1, :host "172.17.0.3", :port 9092} {:id 2, :host "172.17.0.2", :port 9093}]}], "topic-b" [{:topic "topic-b", :partition 0, :leader {:id 3, :host "172.17.0.4", :port 9094}, :replicas [{:id 3, :host "172.17.0.4", :port 9094} {:id 1, :host "172.17.0.3", :port 9092} {:id 2, :host "172.17.0.2", :port 9093}], :in-sync-replicas [{:id 3, :host "172.17.0.4", :port 9094} {:id 1, :host "172.17.0.3", :port 9092} {:id 2, :host "172.17.0.2", :port 9093}]}]}
(to-clojure x)
Converts type to Clojure structure
Converts type to Clojure structure
(tp-om-map->map tp-om)
Takes a java.util.Map made of TopicPartition as keys and OffsetAndMetadata as values, converts them to the following clojure equivalent data structure
{{:topic "test", :partition 77} {:offset 34, :metadata "data data"}, {:topic "prod", :partition 4} {:offset 24, :metadata "more data"}, {:topic "dev", :partition 1} {:offset 234, :metadata "loads of data"}, {:topic "dev", :partition 7} {:offset 23, :metadata "mega data"}}
Takes a java.util.Map made of TopicPartition as keys and OffsetAndMetadata as values, converts them to the following clojure equivalent data structure {{:topic "test", :partition 77} {:offset 34, :metadata "data data"}, {:topic "prod", :partition 4} {:offset 24, :metadata "more data"}, {:topic "dev", :partition 1} {:offset 234, :metadata "loads of data"}, {:topic "dev", :partition 7} {:offset 23, :metadata "mega data"}}
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close