public int createLogs ( String topic , final int partitions , final boolean forceEnlarge ) { TopicNameValidator . validate ( topic ) ; synchronized ( logCreationLock ) { final int configPartitions = getPartition ( topic ) ; if ( configPartitions >= partitions || ! forceEnlarge ) { return configPartitions ; } topicPartitionsMap . put ( topic , partitions ) ; if ( config . getEnableZookeeper ( ) ) { if ( getLogPool ( topic , 0 ) != null ) { //created already topicRegisterTasks . add ( new TopicTask ( TopicTask . TaskType . ENLARGE , topic ) ) ; } else { topicRegisterTasks . add ( new TopicTask ( TopicTask . TaskType . CREATE , topic ) ) ; } } return partitions ; } }
create logs with given partition number