Package backtype.storm.generated

Examples of backtype.storm.generated.InvalidTopologyException


      TException {
    StormTopology topology = null;
    try {
      StormTopology stormtopology = readStormTopology(conf, id);
      if (stormtopology == null) {
        throw new InvalidTopologyException("topology:" + id + "is null");
      }
      topology = Common.system_topology(readStormConf(conf, id),
          stormtopology);
    } catch (InvalidTopologyException e) {
      LOG.error(e + "system_topology failed");
View Full Code Here


        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");
                }
            }
        }
View Full Code Here

              Set<String> commids = obj_map.keySet();
              list.addAll(commids);
 
              for (String id : commids) {
                  if (system_id(id)) {
                      throw new InvalidTopologyException(id
                              + " is not a valid component id");
                  }
              }
 
              for (Object obj : obj_map.values()) {
                  validate_component(obj);
              }
          }
      }
 
      List<String> offending = StormUtils.getRepeat(list);
      if (!offending.isEmpty()) {
          throw new InvalidTopologyException("Duplicate component ids: "
                  + offending);
      }
 
  }
View Full Code Here

  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");
          }
      }
  }
View Full Code Here

      Map<Object, Object> serializedConf = (Map<Object, Object>) JStormUtils
          .from_json(jsonConf);
      if (serializedConf == null) {
        LOG.warn("Failed to serialized Configuration");
        throw new InvalidTopologyException(
            "Failed to serilaze topology configuration");
      }

      serializedConf.put(Config.TOPOLOGY_ID, topologyId);
      serializedConf.put(Config.TOPOLOGY_NAME, topologyname);
View Full Code Here

            String srcDir = StormConfig.masterStormdistRoot(conf, topologyId);
            String destDir = StormConfig.masterStormTmpRoot(conf, name);       
            FileUtils.copyDirectory(new File(srcDir), new File(destDir));
        } else {
          String errorInfo = "Topology=" + name + " is not exist!";
          throw new InvalidTopologyException(errorInfo);
        }
    } catch (Exception e) {
      LOG.info("InvalidTopologyException: " + e.getMessage());
      throw new InvalidTopologyException(e.getMessage());
    }
   
    // Restart the topology: Deactivate -> Kill -> Submit
    // 1. Deactivate
    deactivate(name);
View Full Code Here

    stormClusterState.setup_heartbeats(topologyId);

    Map<Integer, TaskInfo> taskToComponetId = mkTaskComponentAssignments(
        conf, topologyId);
    if (taskToComponetId == null) {
      throw new InvalidTopologyException("Failed to generate TaskIDs map");
    }

    for (Entry<Integer, TaskInfo> entry : taskToComponetId.entrySet()) {
      // key is taskid, value is taskinfo
      stormClusterState.set_task(topologyId, entry.getKey(), entry.getValue());
View Full Code Here

    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");
        }
      }

    } else 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");
        }
      }
    } else 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");
        }
      }
    } else {
      throw new InvalidTopologyException("Unknow type component");
    }

  }
View Full Code Here

        Set<String> commids = obj_map.keySet();

        for (String id : commids) {
          if (system_id(id)) {
            throw new InvalidTopologyException(id
                + " is not a valid component id");
          }
        }

        for (Object obj : obj_map.values()) {
          validate_component(obj);
        }

        list.addAll(commids);
      }
    }

    List<String> offending = JStormUtils.getRepeat(list);
    if (offending.isEmpty() == false) {
      throw new InvalidTopologyException("Duplicate component ids: "
          + offending);
    }

  }
View Full Code Here

  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");
      }
    }
  }
View Full Code Here

TOP

Related Classes of backtype.storm.generated.InvalidTopologyException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.