public static ComponentCommon prepareComponentCommon(Map<GlobalStreamId, Grouping> inputs, Map<String, StreamInfo> outputs, Integer parallelismHint, Map<String, Object> conf) { Map<GlobalStreamId, Grouping> mappedInputs = new HashMap<>(); Map<String, StreamInfo> mappedOutputs = new HashMap<>(); if (inputs != null && !inputs.isEmpty()) { mappedInputs.putAll(inputs); } if (outputs != null && !outputs.isEmpty()) { mappedOutputs.putAll(outputs); } ComponentCommon component = new ComponentCommon(mappedInputs, mappedOutputs); if (parallelismHint != null) { component.set_parallelism_hint(parallelismHint); } if (conf != null) { component.set_json_conf(JSONValue.toJSONString(conf)); } return component; }
private void initCommon(String id, IComponent component, Number parallelism) throws IllegalArgumentException { ComponentCommon common = new ComponentCommon(); common.set_inputs(new HashMap<GlobalStreamId, Grouping>()); if (parallelism != null) { int dop = parallelism.intValue(); if (dop < 1) { throw new IllegalArgumentException("Parallelism must be positive."); } common.set_parallelism_hint(dop); } Map<String, Object> conf = component.getComponentConfiguration(); if (conf != null) { common.set_json_conf(JSONValue.toJSONString(conf)); } commons.put(id, common); }
unset_parallelism_hint(); } else { set_parallelism_hint((java.lang.Integer)value);
private void initCommon(String id, IComponent component, Number parallelism) throws IllegalArgumentException { ComponentCommon common = new ComponentCommon(); common.set_inputs(new HashMap<GlobalStreamId, Grouping>()); if(parallelism!=null) { int dop = parallelism.intValue(); if(dop < 1) { throw new IllegalArgumentException("Parallelism must be positive."); } common.set_parallelism_hint(dop); } Map conf = component.getComponentConfiguration(); if(conf!=null) common.set_json_conf(JSONValue.toJSONString(conf)); _commons.put(id, common); }
source.setParallelism(dop); } else { common.set_parallelism_hint(1); outputStream.setParallelism(dop); } else { common.set_parallelism_hint(1);
unset_parallelism_hint(); } else { set_parallelism_hint((Integer)value);