private MessageStore getOrCreateMessageStoreInner(final String topic, final int partition, final long offsetIfCreate)
throws IOException {
if (!this.isLegalTopic(topic)) {
throw new IllegalTopicException("The server do not accept topic " + topic);
}
if (partition < 0 || partition >= this.getNumPartitions(topic)) {
log.warn("Wrong partition " + partition + ",valid partitions (0," + (this.getNumPartitions(topic) - 1)
+ ")");
throw new WrongPartitionException("wrong partition " + partition);