Ejemplo n.º 1
0
  public static void persistTopology(Topology topology) {
    try {
      RegistryManager.getInstance().persistTopology(topology);
    } catch (RegistryException e) {

      String msg = "Failed to persist the Topology in registry. ";
      log.fatal(msg, e);
    }
  }
Ejemplo n.º 2
0
  public static Topology retrieveTopology() {
    Object obj = RegistryManager.getInstance().retrieveTopology();
    if (obj != null) {
      try {
        Object dataObj = Deserializer.deserializeFromByteArray((byte[]) obj);
        if (dataObj instanceof Topology) {
          return (Topology) dataObj;
        } else {
          return null;
        }
      } catch (Exception e) {
        String msg =
            "Unable to retrieve data from Registry. Hence, any historical data will not get reflected.";
        log.warn(msg, e);
      }
    }

    return null;
  }