flux/flux-wrappers/src/main/java/org/apache/storm/flux/wrappers/bolts/FluxShellBolt.java [58:173]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        this.setDefaultStream(outputFields);
    }

    /**
     * Add configuration for this bolt. This method is called from YAML file:
     * <p/>
     * ```
     * className: "org.apache.storm.flux.wrappers.bolts.FluxShellBolt"
     * constructorArgs:
     * # command line
     * - ["python3", "splitsentence.py"]
     * # output fields
     * - ["word"]
     * configMethods:
     * - name: "addComponentConfig"
     *   args: ["publisher.data_paths", "actions"]
     * ```
     *
     * @param key config key
     * @param value config value
     */
    public void addComponentConfig(String key, Object value) {
        if (this.componentConfig == null) {
            this.componentConfig = new HashMap<String, Object>();
        }
        this.componentConfig.put(key, value);
    }

    /**
     * Add configuration for this bolt. This method is called from YAML file:
     * <p/>
     * ```
     * className: "org.apache.storm.flux.wrappers.bolts.FluxShellBolt"
     * constructorArgs:
     * # command line
     * - ["python3", "splitsentence.py"]
     * # output fields
     * - ["word"]
     * configMethods:
     * - name: "addComponentConfig"
     *   args:
     *   - "publisher.data_paths"
     *   - ["actions"]
     * ```
     *
     * @param key config key
     * @param values config values
     */
    public void addComponentConfig(String key, List<Object> values) {
        if (this.componentConfig == null) {
            this.componentConfig = new HashMap<String, Object>();
        }
        this.componentConfig.put(key, values);
    }

    /**
     * Set default stream outputFields, this method is called from YAML file:
     * <p/>
     * ```
     * bolts:
     * - className: org.apache.storm.flux.wrappers.bolts.FluxShellBolt
     *   id: my_bolt
     *   constructorArgs:
     *   - [python3, my_bolt.py]
     *   configMethods:
     *   - name: setDefaultStream
     *     args:
     *     - [word, count]
     * ```
     * 
     * @param outputFields Names of fields the bolt will emit (if any) in default stream.
     */
    public void setDefaultStream(String[] outputFields) {
        this.setNamedStream("default", outputFields);
    }

    /**
     * Set custom *named* stream outputFields, this method is called from YAML file:
     * <p/>
     * ```
     * bolts:
     * - className: org.apache.storm.flux.wrappers.bolts.FluxShellBolt
     *   id: my_bolt
     *   constructorArgs:
     *   - [python3, my_bolt.py]
     *   configMethods:
     *   - name: setNamedStream
     *     args:
     *     - first
     *     - [word, count]
     * ```
     * @param name Name of stream the bolt will emit into.
     * @param outputFields Names of fields the bolt will emit in custom *named* stream.
     */
    public void setNamedStream(String name, String[] outputFields) {
        this.outputFields.put(name, outputFields);
    }

    @Override
    public void declareOutputFields(OutputFieldsDeclarer declarer) {
        Iterator it = this.outputFields.entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry entryTuple = (Map.Entry) it.next();
            String key = (String) entryTuple.getKey();
            String[] value = (String[]) entryTuple.getValue();
            if (key.equals("default")) {
                declarer.declare(new Fields(value));
            } else {
                declarer.declareStream(key, new Fields(value));
            }
        }
    }

    @Override
    public Map<String, Object> getComponentConfiguration() {
        return this.componentConfig;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



flux/flux-wrappers/src/main/java/org/apache/storm/flux/wrappers/spouts/FluxShellSpout.java [60:175]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        this.setDefaultStream(outputFields);
    }

    /**
     * Add configuration for this spout. This method is called from YAML file:
     * <p></p>
     * ```
     * className: "org.apache.storm.flux.wrappers.bolts.FluxShellSpout"
     * constructorArgs:
     * # command line
     * - ["python3", "splitsentence.py"]
     * # output fields
     * - ["word"]
     * configMethods:
     * - name: "addComponentConfig"
     *   args: ["publisher.data_paths", "actions"]
     * ```
     *
     * @param key config key
     * @param value config value
     */
    public void addComponentConfig(String key, Object value) {
        if (this.componentConfig == null) {
            this.componentConfig = new HashMap<String, Object>();
        }
        this.componentConfig.put(key, value);
    }

    /**
     * Add configuration for this spout. This method is called from YAML file:
     * <p/>
     * ```
     * className: "org.apache.storm.flux.wrappers.bolts.FluxShellSpout"
     * constructorArgs:
     * # command line
     * - ["python3", "splitsentence.py"]
     * # output fields
     * - ["word"]
     * configMethods:
     * - name: "addComponentConfig"
     *   args:
     *   - "publisher.data_paths"
     *   - ["actions"]
     * ```
     *
     * @param key config key
     * @param values config values
     */
    public void addComponentConfig(String key, List<Object> values) {
        if (this.componentConfig == null) {
            this.componentConfig = new HashMap<String, Object>();
        }
        this.componentConfig.put(key, values);
    }

    /**
     * Set default stream outputFields, this method is called from YAML file:
     * <p/>
     * ```
     * spouts:
     * - className: org.apache.storm.flux.wrappers.bolts.FluxShellSpout
     *   id: my_spout
     *   constructorArgs:
     *   - [python3, my_spout.py]
     *   configMethods:
     *   - name: setDefaultStream
     *     args:
     *     - [word, count]
     * ```
     * 
     * @param outputFields Names of fields the spout will emit (if any) in default stream.
     */
    public void setDefaultStream(String[] outputFields) {
        this.setNamedStream("default", outputFields);
    }

    /**
     * Set custom *named* stream outputFields, this method is called from YAML file:
     * <p/>
     * ```
     * spouts:
     * - className: org.apache.storm.flux.wrappers.bolts.FluxShellSpout
     *   id: my_spout
     *   constructorArgs:
     *   - [python3, my_spout.py]
     *   configMethods:
     *   - name: setNamedStream
     *     args:
     *     - first
     *     - [word, count]
     * ```
     * @param name Name of stream the spout will emit into.
     * @param outputFields Names of fields the spout will emit in custom *named* stream.
     */
    public void setNamedStream(String name, String[] outputFields) {
        this.outputFields.put(name, outputFields);
    }

    @Override
    public void declareOutputFields(OutputFieldsDeclarer declarer) {
        Iterator it = this.outputFields.entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry entryTuple = (Map.Entry) it.next();
            String key = (String) entryTuple.getKey();
            String[] value = (String[]) entryTuple.getValue();
            if (key.equals("default")) {
                declarer.declare(new Fields(value));
            } else {
                declarer.declareStream(key, new Fields(value));
            }
        }
    }

    @Override
    public Map<String, Object> getComponentConfiguration() {
        return this.componentConfig;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



