[ https://issues.apache.org/jira/browse/STORM-1914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15343735#comment-15343735 ]
ASF GitHub Bot commented on STORM-1914: --------------------------------------- Github user HeartSaVioR commented on a diff in the pull request: https://github.com/apache/storm/pull/1501#discussion_r67996913 --- Diff: external/storm-kafka/src/jvm/org/apache/storm/kafka/bolt/selector/FieldNameTopicSelector.java --- @@ -0,0 +1,52 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.storm.kafka.bolt.selector; + +import org.apache.storm.tuple.Tuple; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Using field name select topic name from tuple . + * When the field not found ,message will write to default topic. + */ +public class FieldNameTopicSelector implements KafkaTopicSelector { + private static final Logger LOG = LoggerFactory.getLogger(FieldNameTopicSelector.class); + + private final String fieldName; + private final String defaultTopicName; + + public FieldNameTopicSelector(String fieldName, String defaultTopicName) { + this.fieldName = fieldName; + this.defaultTopicName = defaultTopicName; + } + + public FieldNameTopicSelector(String fieldName) { --- End diff -- We can have only one constructor forcing users to input default topic. We shouldn't define our own default. > Storm Kafka Field Topic Selector > -------------------------------- > > Key: STORM-1914 > URL: https://issues.apache.org/jira/browse/STORM-1914 > Project: Apache Storm > Issue Type: New Feature > Components: storm-kafka > Affects Versions: 1.0.0, 1.0.1, 1.0.2 > Reporter: darion yaphet > Assignee: darion yaphet > > Support field name and field index to select which kafka topic will used as a > downstream . -- This message was sent by Atlassian JIRA (v6.3.4#6332)