Yes it is possible. You must access the AdminUtils scala class in kafka_2.11-0.9.0.1.jar to add sections.
AdminUtils supports the number of sections in a topic just to increase. You may need banks kafka_2.11-0.9.0.1.jar , zk-client-0.8.jar , scala-library-2.11.8.jar and scala-parser-combinators_2.11-1.0.4.jar in your class path .
Parts of the code below are borrowed / inspired by kafka-cloudera examples.
package org.apache.kafka.examples; import java.io.Closeable; import org.I0Itec.zkclient.ZkClient; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import kafka.admin.AdminOperationException; import kafka.admin.AdminUtils; import kafka.admin.RackAwareMode.Enforced$; import kafka.utils.ZKStringSerializer$; import kafka.utils.ZkUtils; public class Test { static final Logger logger = LogManager.getLogger(); public Test() {
source share