Search in sources :

Example 76 with JSONException

use of org.json_voltpatches.JSONException 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

JSONException (org.json_voltpatches.JSONException)76 JSONObject (org.json_voltpatches.JSONObject)36 AbstractExpression (org.voltdb.expressions.AbstractExpression)17 IOException (java.io.IOException)14 ArrayList (java.util.ArrayList)13 ColumnRef (org.voltdb.catalog.ColumnRef)13 JSONArray (org.json_voltpatches.JSONArray)12 JSONStringer (org.json_voltpatches.JSONStringer)12 Column (org.voltdb.catalog.Column)12 KeeperException (org.apache.zookeeper_voltpatches.KeeperException)11 HashMap (java.util.HashMap)9 Map (java.util.Map)9 File (java.io.File)8 Constraint (org.voltdb.catalog.Constraint)8 TupleValueExpression (org.voltdb.expressions.TupleValueExpression)8 HashSet (java.util.HashSet)7 Table (org.voltdb.catalog.Table)7 Index (org.voltdb.catalog.Index)6 TreeMap (java.util.TreeMap)5 ExecutionException (java.util.concurrent.ExecutionException)5