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