Skip to content

Instantly share code, notes, and snippets.

@starblood
starblood / KafkaTopicTest.scala
Created September 1, 2017 09:08
find topic and partitions info from ZkUtils
import kafka.utils.ZkUtils
object KafkaTopicTest {
def createZkUtils(): ZkUtils = {
val zookeepers = "localhost:2181"
val timeout = 10000
ZkUtils(zookeepers, timeout, timeout, isZkSecurityEnabled = false)
}
def getPartitionsForTopics(topics: Seq[String]): Map[String, Seq[Int]] = {
@starblood
starblood / check_kafka_lag.sh
Last active November 28, 2016 08:44
check lag for specified topic from kafka
#!/bin/bash
kafka_home=$1
zookeeper=$2
group_name=$3
lag_threshold=$4
lag_data_sampling_count=$5
if [ ! -z $6 ] ; then
lag_data_file=$6
else