private Kafka09TableSource createSource(Map<String, String> props) { TableProperties properties = new TableProperties(); properties.putProperties(props); RichTableSchema schema = properties.readSchemaFromProperties(null); String topicStr = properties.getString(KafkaOptions.TOPIC); String topicPatternStr = properties.getString(KafkaOptions.TOPIC_PATTERN); Properties prop = getProperties( Kafka09Options.ESSENTIAL_CONSUMER_KEYS, Kafka09Options.OPTIONAL_CONSUMER_KEYS, properties); // TODO: support batch mode. boolean isBatchMode = false; if (!StringUtils.isNullOrWhitespaceOnly(topicStr)) { List<String> topics = Arrays.asList(topicStr.split(",")); return new Kafka09TableSource(topics, null, prop, getStartupMode(properties), -1, isBatchMode, TypeConverters.toBaseRowTypeInfo(schema.getResultType())); } else if (!StringUtils.isNullOrWhitespaceOnly(topicPatternStr)) { return new Kafka09TableSource(null, topicPatternStr, prop, getStartupMode(properties), -1, isBatchMode, TypeConverters.toBaseRowTypeInfo(schema.getResultType())); } else { throw new RuntimeException("No sufficient parameters for Kafka09." + "topic or topic pattern needed."); } }
List<String> topics = Arrays.asList(topicStr.split(",")); return new Kafka011TableSource(topics, null, prop, getStartupMode(properties), startInMs, isBatchMode, TypeConverters.toBaseRowTypeInfo(schema.getResultType())); } else if (!StringUtils.isNullOrWhitespaceOnly(topicPatternStr)) { return new Kafka011TableSource(null, topicPatternStr, prop, getStartupMode(properties), startInMs, isBatchMode, TypeConverters.toBaseRowTypeInfo(schema.getResultType())); } else { throw new RuntimeException("No sufficient parameters for Kafka011, " +
List<String> topics = Arrays.asList(topicStr.split(",")); return new Kafka010TableSource(topics, null, prop, getStartupMode(properties), startInMs, isBatchMode, TypeConverters.toBaseRowTypeInfo(schema.getResultType())); } else if (!StringUtils.isNullOrWhitespaceOnly(topicPatternStr)) { return new Kafka010TableSource(null, topicPatternStr, prop, getStartupMode(properties), startInMs, isBatchMode, TypeConverters.toBaseRowTypeInfo(schema.getResultType())); } else { throw new RuntimeException("No sufficient parameters for Kafka010." +