public HashMap<String, Map<String, Fields>> generateComponentToStreamToFields(StormTopology topology) { HashMap<String, Map<String, Fields>> componentToStreamToFields = new HashMap<>(); Set<String> components = ThriftTopologyUtils.getComponentIds(topology); for (String component : components) { Map<String, Fields> streamToFieldsMap = new HashMap<>(); Map<String, StreamInfo> streamInfoMap = ThriftTopologyUtils.getComponentCommon(topology, component).get_streams(); for (Map.Entry<String, StreamInfo> entry : streamInfoMap.entrySet()) { String streamId = entry.getKey(); StreamInfo streamInfo = entry.getValue(); streamToFieldsMap.put(streamId, new Fields(streamInfo.get_output_fields())); } componentToStreamToFields.put(component, streamToFieldsMap); } return componentToStreamToFields; }
public ComponentCommon getComponentCommon(String componentId) { return ThriftTopologyUtils.getComponentCommon(getRawTopology(), componentId); }
/** * Gets a list of all component ids in this topology */ public Set<String> getComponentIds() { return ThriftTopologyUtils.getComponentIds(getRawTopology()); }
StormTopology ret = topology.deepCopy(); Map<String, Object> rawComponents = ThriftTopologyUtils.getComponents(topology); Map<String, Object> components = ThriftTopologyUtils.getComponents(ret);
public ComponentCommon getComponentCommon(String componentId) { return ThriftTopologyUtils.getComponentCommon(getRawTopology(), componentId); }
/** * Gets a list of all component ids in this topology */ public Set<String> getComponentIds() { return ThriftTopologyUtils.getComponentIds(getRawTopology()); }
Map<String, Object> components = ThriftTopologyUtils.getComponents(sysTopology); for (Entry<String, Object> entry : components.entrySet()) { String componentName = entry.getKey();
baseSers = (List) conf.get(Config.TOPOLOGY_KRYO_REGISTER); Set<String> cids = ThriftTopologyUtils.getComponentIds(topology); List componentSers = new ArrayList(); for (Iterator it = cids.iterator(); it.hasNext();) { String componentId = (String) it.next(); ComponentCommon common = ThriftTopologyUtils.getComponentCommon( topology, componentId); String json = common.get_json_conf();
/** * get the component's configuration */ public static Map getComponentMap(DefaultTopologyAssignContext context, Integer task) { String componentName = context.getTaskToComponent().get(task); ComponentCommon componentCommon = ThriftTopologyUtils.getComponentCommon(context.getSysTopology(), componentName); Map componentMap = (Map) JStormUtils.from_json(componentCommon.get_json_conf()); if (componentMap == null) { componentMap = Maps.newHashMap(); } return componentMap; }
private static boolean hasDownstreamComponent(StormTopology topology, String outComponentId, String outStreamId) { boolean ret = false; for (String componentId : ThriftTopologyUtils.getComponentIds(topology)) { ComponentCommon componentCommon = Utils.getComponentCommon(topology, componentId); Set<GlobalStreamId> inputs = componentCommon.get_inputs().keySet(); for (GlobalStreamId input : inputs) { if (input.get_componentId().equals(outComponentId) && input.get_streamId().equals(outStreamId)) return true; } } return ret; } }
StormTopology ret = topology.deepCopy(); Map<String, Object> rawComponents = ThriftTopologyUtils.getComponents(topology); Map<String, Object> components = ThriftTopologyUtils.getComponents(ret);
Set<String> cids = ThriftTopologyUtils.getComponentIds(topology); for (Iterator it = cids.iterator(); it.hasNext(); ) { String componentId = (String) it.next(); ComponentCommon common = ThriftTopologyUtils.getComponentCommon(topology, componentId); String json = common.get_json_conf(); if (json == null) {
public ComponentCommon getComponentCommon(String componentId) { return ThriftTopologyUtils.getComponentCommon(getRawTopology(), componentId); }
/** * Gets a list of all component ids in this topology */ public Set<String> getComponentIds() { return ThriftTopologyUtils.getComponentIds(getRawTopology()); }
Map<String, Object> components = ThriftTopologyUtils.getComponents(sysTopology); for (Entry<String, Object> entry : components.entrySet()) { String componentName = entry.getKey();
public HashMap<String, Map<String, Fields>> generateComponentToStreamToFields(StormTopology topology) { HashMap<String, Map<String, Fields>> componentToStreamToFields = new HashMap<String, Map<String, Fields>>(); Set<String> components = ThriftTopologyUtils.getComponentIds(topology); for (String component : components) { Map<String, Fields> streamToFieldsMap = new HashMap<String, Fields>(); Map<String, StreamInfo> streamInfoMap = ThriftTopologyUtils.getComponentCommon(topology, component).get_streams(); for (Map.Entry<String, StreamInfo> entry : streamInfoMap.entrySet()) { String streamId = entry.getKey(); StreamInfo streamInfo = entry.getValue(); streamToFieldsMap.put(streamId, new Fields(streamInfo.get_output_fields())); } componentToStreamToFields.put(component, streamToFieldsMap); } return componentToStreamToFields; }
public ComponentCommon getComponentCommon(String componentId) { return ThriftTopologyUtils.getComponentCommon(getRawTopology(), componentId); }
/** * Gets a list of all component ids in this topology */ public Set<String> getComponentIds() { return ThriftTopologyUtils.getComponentIds(getRawTopology()); }
Set<String> cids = ThriftTopologyUtils.getComponentIds(topology); for (Iterator it = cids.iterator(); it.hasNext(); ) { String componentId = (String) it.next(); ComponentCommon common = ThriftTopologyUtils.getComponentCommon(topology, componentId); String json = common.get_json_conf(); if (json == null) {
/** * get the component's configuration */ public static Map getComponentMap(DefaultTopologyAssignContext context, Integer task) { String componentName = context.getTaskToComponent().get(task); ComponentCommon componentCommon = ThriftTopologyUtils.getComponentCommon(context.getSysTopology(), componentName); Map componentMap = (Map) JStormUtils.from_json(componentCommon.get_json_conf()); if (componentMap == null) { componentMap = Maps.newHashMap(); } return componentMap; }