Github user srdo commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1825#discussion_r92850572
  
    --- Diff: 
external/storm-kafka-client/src/main/java/org/apache/storm/kafka/spout/KafkaSpoutConfig.java
 ---
    @@ -230,8 +237,37 @@ public Builder(Map<String, Object> kafkaProps, 
KafkaSpoutStreams kafkaSpoutStrea
             }
     
             public KafkaSpoutConfig<K,V> build() {
    +            validate();
                 return new KafkaSpoutConfig<>(this);
             }
    +
    +        /**
    +         * Defines whether the consumer manages partition manually.
    +         * If set to true, the consumer behaves like a simple consumer, 
otherwise it will rely on kafka to do partition assignment.
    +         * @param manualPartitionAssign Whether use manual partition 
assignment.
    +         */
    +        public Builder setManualPartitionAssign(boolean 
manualPartitionAssign) {
    +            this.manualPartitionAssign = manualPartitionAssign;
    +            return this;
    +        }
    +
    +        /**
    +         * Defines partition refresh period in the manual partition assign 
model.
    +         * @param partitionRefreshPeriodMs Partition refresh period in ms.
    +         */
    +        public Builder setPartitionRefreshPeriodMs(int 
partitionRefreshPeriodMs) {
    +            this.partitionRefreshPeriodMs = partitionRefreshPeriodMs;
    +            return this;
    +        }
    +
    +        /**
    +         * Validate configs before build.
    +         */
    +        private void validate() {
    +            if (this.manualPartitionAssign && kafkaSpoutStreams instanceof 
KafkaSpoutStreamsWildcardTopics) {
    +                throw new IllegalArgumentException("Manual partition 
assign can't be used with wildcard topics!");
    --- End diff --
    
    assign -> assignment


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to