Search in sources :

Example 1 with AbstractTopology

use of org.voltdb.AbstractTopology in project voltdb by VoltDB.

the class TopologyZKUtils method readTopologyFromZK.

public static AbstractTopology readTopologyFromZK(ZooKeeper zk) {
    AbstractTopology topology = null;
    try {
        byte[] data = zk.getData(VoltZK.topology, false, null);
        String jsonTopology = new String(data, Charsets.UTF_8);
        topology = AbstractTopology.topologyFromJSON(jsonTopology);
    } catch (KeeperException | InterruptedException | JSONException e) {
        VoltDB.crashLocalVoltDB("Unable to read topology from ZK, dying", true, e);
    }
    return topology;
}
Also used : AbstractTopology(org.voltdb.AbstractTopology) JSONException(org.json_voltpatches.JSONException) KeeperException(org.apache.zookeeper_voltpatches.KeeperException)

Aggregations

KeeperException (org.apache.zookeeper_voltpatches.KeeperException)1 JSONException (org.json_voltpatches.JSONException)1 AbstractTopology (org.voltdb.AbstractTopology)1