Creating a Topic with a Specified Number of Partitions

Call the Admin.createTopic(String streamPathAndName, String topicName, int npartitions) method.

Example

public void createTopicWithPartitionsUtilFunction(String streamPathAndName, String topicName, int npartitions) throws IOException{
	Admin streamAdmin = Streams.newAdmin(conf);
	streamAdmin.createTopic(streamPathAndName, topicName, npartitions);
	streamAdmin.close();			
}

The Javadoc is located here.