public Object getFieldValue(_Fields field) { switch (field) { case STATE_SPOUT_OBJECT: return get_state_spout_object(); case COMMON: return get_common(); } throw new IllegalStateException(); }
public Object getFieldValue(_Fields field) { switch (field) { case STATE_SPOUT_OBJECT: return get_state_spout_object(); case COMMON: return get_common(); } throw new IllegalStateException(); }
public static ComponentCommon getComponentCommon(StormTopology topology, String componentId) { for (StormTopology._Fields f : StormTopology.metaDataMap.keySet()) { Map<String, Object> componentMap = (Map<String, Object>) topology.getFieldValue(f); if (componentMap.containsKey(componentId)) { Object component = componentMap.get(componentId); if (component instanceof Bolt) { return ((Bolt) component).get_common(); } if (component instanceof SpoutSpec) { return ((SpoutSpec) component).get_common(); } if (component instanceof StateSpoutSpec) { return ((StateSpoutSpec) component).get_common(); } throw new RuntimeException("Unreachable code! No get_common conversion for component " + component); } } throw new IllegalArgumentException("Could not find component common for " + componentId); } }
public static ComponentCommon getComponentCommon(StormTopology topology, String id) { if (topology.get_spouts().containsKey(id)) { return topology.get_spouts().get(id).get_common(); } if (topology.get_bolts().containsKey(id)) { return topology.get_bolts().get(id).get_common(); } if (topology.get_state_spouts().containsKey(id)) { return topology.get_state_spouts().get(id).get_common(); } throw new IllegalArgumentException("Could not find component with id " + id); }
public static ComponentCommon getComponentCommon(StormTopology topology, String componentId) { for(StormTopology._Fields f: StormTopology.metaDataMap.keySet()) { Map<String, Object> componentMap = (Map<String, Object>) topology.getFieldValue(f); if(componentMap.containsKey(componentId)) { Object component = componentMap.get(componentId); if(component instanceof Bolt) { return ((Bolt) component).get_common(); } if(component instanceof SpoutSpec) { return ((SpoutSpec) component).get_common(); } if(component instanceof StateSpoutSpec) { return ((StateSpoutSpec) component).get_common(); } throw new RuntimeException("Unreachable code! No get_common conversion for component " + component); } } throw new IllegalArgumentException("Could not find component common for " + componentId); } }
common = ((StateSpoutSpec) obj).get_common();
componentType = "spout"; } else if (obj instanceof StateSpoutSpec) { common = ((StateSpoutSpec) obj).get_common(); componentType = "spout";
private static void validate_component_inputs(Object obj) throws InvalidTopologyException { if (obj instanceof StateSpoutSpec) { StateSpoutSpec spec = (StateSpoutSpec) obj; if (!spec.get_common().get_inputs().isEmpty()) { throw new InvalidTopologyException("May not declare inputs for a spout"); } } if (obj instanceof SpoutSpec) { SpoutSpec spec = (SpoutSpec) obj; if (!spec.get_common().get_inputs().isEmpty()) { throw new InvalidTopologyException("May not declare inputs for a spout"); } } }
public static ComponentCommon getComponentCommon(StormTopology topology, String id) { if (topology.get_spouts().containsKey(id)) { return topology.get_spouts().get(id).get_common(); } if (topology.get_bolts().containsKey(id)) { return topology.get_bolts().get(id).get_common(); } if (topology.get_state_spouts().containsKey(id)) { return topology.get_state_spouts().get(id).get_common(); } throw new IllegalArgumentException("Could not find component with id " + id); }
static void validate_component_inputs(Object obj) throws InvalidTopologyException { if (obj instanceof StateSpoutSpec) { StateSpoutSpec spec = (StateSpoutSpec) obj; if (!spec.get_common().get_inputs().isEmpty()) { throw new InvalidTopologyException( "May not declare inputs for a spout"); } } if (obj instanceof SpoutSpec) { SpoutSpec spec = (SpoutSpec) obj; if (!spec.get_common().get_inputs().isEmpty()) { throw new InvalidTopologyException( "May not declare inputs for a spout"); } } }
private static void add_component_system_streams(Object obj) { ComponentCommon common = null; if (obj instanceof StateSpoutSpec) { StateSpoutSpec spec = (StateSpoutSpec) obj; common = spec.get_common(); } if (obj instanceof SpoutSpec) { SpoutSpec spec = (SpoutSpec) obj; common = spec.get_common(); } if (obj instanceof Bolt) { Bolt spec = (Bolt) obj; common = spec.get_common(); } if (common != null) { StreamInfo sinfo = Thrift.outputFields(sysEventFields); common.put_to_streams(SYSTEM_STREAM_ID, sinfo); } }
common = ((StateSpoutSpec) component).get_common(); if (fromConf) { Integer paraNum = ConfigExtension.getSpoutParallelism(stormConf, componentName);
common = ((StateSpoutSpec) component).get_common();
static void add_component_system_streams(Object obj) { ComponentCommon common=null; if (obj instanceof StateSpoutSpec) { StateSpoutSpec spec = (StateSpoutSpec) obj; common=spec.get_common(); } if (obj instanceof SpoutSpec) { SpoutSpec spec = (SpoutSpec) obj; common=spec.get_common(); } if (obj instanceof Bolt) { Bolt spec = (Bolt) obj; common=spec.get_common(); } if(common!=null) { StreamInfo sinfo=Thrift.outputFields(sysEventFields); common.put_to_streams(SYSTEM_STREAM_ID,sinfo); } }
static void validate_component(Object obj) throws InvalidTopologyException { if (obj instanceof StateSpoutSpec) { StateSpoutSpec spec = (StateSpoutSpec) obj; for (String id : spec.get_common().get_streams().keySet()) { if (system_id(id)) { throw new InvalidTopologyException(id + " is not a valid component id"); } } } if (obj instanceof SpoutSpec) { SpoutSpec spec = (SpoutSpec) obj; for (String id : spec.get_common().get_streams().keySet()) { if (system_id(id)) { throw new InvalidTopologyException(id + " is not a valid component id"); } } } if (obj instanceof Bolt) { Bolt spec = (Bolt) obj; for (String id : spec.get_common().get_streams().keySet()) { if (system_id(id)) { throw new InvalidTopologyException(id + " is not a valid component id"); } } } }
private static void validate_component(Object obj) throws InvalidTopologyException { if (obj instanceof StateSpoutSpec) { StateSpoutSpec spec = (StateSpoutSpec) obj; for (String id : spec.get_common().get_streams().keySet()) { if (system_id(id) || !charComponentValidate(id)) { throw new InvalidTopologyException(id + " is not a valid component id. " + compErrorInfo); } } } else if (obj instanceof SpoutSpec) { SpoutSpec spec = (SpoutSpec) obj; for (String id : spec.get_common().get_streams().keySet()) { if (system_id(id) || !charComponentValidate(id)) { throw new InvalidTopologyException(id + " is not a valid component id. " + compErrorInfo); } } } else if (obj instanceof Bolt) { Bolt spec = (Bolt) obj; for (String id : spec.get_common().get_streams().keySet()) { if (system_id(id) || !charComponentValidate(id)) { throw new InvalidTopologyException(id + " is not a valid component id. " + compErrorInfo); } } } else { throw new InvalidTopologyException("Unknown component type"); } }
public Object getFieldValue(_Fields field) { switch (field) { case STATE_SPOUT_OBJECT: return get_state_spout_object(); case COMMON: return get_common(); } throw new IllegalStateException(); }
public Object getFieldValue(_Fields field) { switch (field) { case STATE_SPOUT_OBJECT: return get_state_spout_object(); case COMMON: return get_common(); } throw new IllegalStateException(); }
public static ComponentCommon getComponentCommon(StormTopology topology, String id) { if (topology.get_spouts().containsKey(id)) { return topology.get_spouts().get(id).get_common(); } if (topology.get_bolts().containsKey(id)) { return topology.get_bolts().get(id).get_common(); } if (topology.get_state_spouts().containsKey(id)) { return topology.get_state_spouts().get(id).get_common(); } throw new IllegalArgumentException("Could not find component with id " + id); }
public static ComponentCommon getComponentCommon(StormTopology topology, String id) { if(topology.get_spouts().containsKey(id)) { return topology.get_spouts().get(id).get_common(); } if(topology.get_bolts().containsKey(id)) { return topology.get_bolts().get(id).get_common(); } if(topology.get_state_spouts().containsKey(id)) { return topology.get_state_spouts().get(id).get_common(); } throw new IllegalArgumentException("Could not find component with id " + id); }