@Override public T addConfigurations(Map conf) { if(conf!=null && conf.containsKey(Config.TOPOLOGY_KRYO_REGISTER)) { throw new IllegalArgumentException("Cannot set serializations for a component using fluent API"); } String currConf = _commons.get(_id).get_json_conf(); _commons.get(_id).set_json_conf(mergeIntoJson(parseJson(currConf), conf)); return (T) this; } }
@Override public T addConfigurations(Map conf) { if (conf != null && conf.containsKey(Config.TOPOLOGY_KRYO_REGISTER)) { throw new IllegalArgumentException("Cannot set serializations for a component using fluent API"); } String currConf = _commons.get(_id).get_json_conf(); _commons.get(_id).set_json_conf(JStormUtils.mergeIntoJson(JStormUtils.parseJson(currConf), conf)); return (T) this; } }
protected 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); } else { common.set_parallelism_hint(1); } Map conf = component.getComponentConfiguration(); if(conf!=null) common.set_json_conf(JSONValue.toJSONString(conf)); _commons.put(id, common); }
private void initCommon(String id, IComponent component, Integer parallelism) { ComponentCommon common = new ComponentCommon(); common.set_inputs(new HashMap<GlobalStreamId, Grouping>()); if(parallelism!=null) common.set_parallelism_hint(parallelism); Map conf = component.getComponentConfiguration(); if(conf!=null) common.set_json_conf(JSONValue.toJSONString(conf)); _commons.put(id, common); }
protected BoltDeclarer grouping(String componentId, String streamId, Grouping grouping) { // Check if bolt is KvStateBolt, if so, enable the key range hash in upstream component TransactionBolt bolt = (TransactionBolt) _bolts.get(_boltId); if (bolt.getBoltExecutor() instanceof KvStatefulBoltExecutor) { ComponentCommon common = _commons.get(componentId); Map<String, Object> conf = new HashMap<>(); conf.put(ConfigExtension.ENABLE_KEY_RANGE_FIELD_GROUP, true); String currConf = common.get_json_conf(); common.set_json_conf(JStormUtils.mergeIntoJson(JStormUtils.parseJson(currConf), conf)); } // Add barrier snapshot stream for transaction topology Set<String> downstreamBolts = upToDownstreamComponentsMap.get(componentId); if (downstreamBolts != null && !downstreamBolts.contains(_boltId)) { downstreamBolts.add(_boltId); _commons.get(_boltId).put_to_inputs(new GlobalStreamId(componentId, TransactionCommon.BARRIER_STREAM_ID), Grouping.all(new NullStruct())); } _commons.get(_boltId).put_to_inputs(new GlobalStreamId(componentId, streamId), grouping); //return this; return super.grouping(componentId, streamId, grouping); } }
LOG.info("Set " + componentName + " parallelism " + taskNum); common.set_json_conf(JStormUtils.to_json(componentMap));
unset_json_conf(); } else { set_json_conf((String)value);
unset_json_conf(); } else { set_json_conf((String)value);
@Override public T addConfigurations(Map conf) { if(conf!=null && conf.containsKey(Config.TOPOLOGY_KRYO_REGISTER)) { throw new IllegalArgumentException("Cannot set serializations for a component using fluent API"); } String currConf = _commons.get(_id).get_json_conf(); _commons.get(_id).set_json_conf(mergeIntoJson(parseJson(currConf), conf)); return (T) this; } }
@Override public T addConfigurations(Map conf) { if (conf != null && conf.containsKey(Config.TOPOLOGY_KRYO_REGISTER)) { throw new IllegalArgumentException("Cannot set serializations for a component using fluent API"); } String currConf = _commons.get(_id).get_json_conf(); _commons.get(_id).set_json_conf(JStormUtils.mergeIntoJson(JStormUtils.parseJson(currConf), conf)); return (T) this; } }
private void initCommon(String id, IComponent component, Number parallelism) { ComponentCommon common = new ComponentCommon(); common.set_inputs(new HashMap<GlobalStreamId, Grouping>()); if(parallelism!=null) common.set_parallelism_hint(parallelism.intValue()); Map conf = component.getComponentConfiguration(); if(conf!=null) common.set_json_conf(JSONValue.toJSONString(conf)); _commons.put(id, common); }
protected 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); } else { common.set_parallelism_hint(1); } Map conf = component.getComponentConfiguration(); if(conf!=null) common.set_json_conf(JSONValue.toJSONString(conf)); _commons.put(id, common); }
LOG.info("Set " + componentName + " parallelism " + taskNum); common.set_json_conf(JStormUtils.to_json(componentMap));
unset_json_conf(); } else { set_json_conf((String)value);
unset_json_conf(); } else { set_json_conf((String)value);