public int getNumPartitions(String topicName) {
        List<PartitionInfo> partitionList = getPartitionInfo(topicName);
        return partitionList != null ? partitionList.size() : 0;
    }
public int getNumPartitions ( String topicName ) { List < PartitionInfo > partitionList = getPartitionInfo ( topicName ) ; return partitionList != null ? partitionList . size ( ) : 0 ; }
Gets number of partitions of a topic.

@param topicName
@return topic's number of partitions, or {@code 0} if the topic does not
exist
@since 1.2.0