newPartitionCount = jo.getInt("newPartitionCount");
catalogCrc = jo.getLong("catalogCrc");
hostId = jo.getInt("hostId");
instanceId = new InstanceId(jo.getJSONObject("instanceId"));
JSONArray tables = jo.getJSONArray("tables");
int cnt = tables.length();
for (int i=0; i < cnt; i++) {
JSONObject tableEntry = tables.getJSONObject(i);
String name = tableEntry.getString("name");
JSONArray jsonPartitions = tableEntry.getJSONArray("partitions");
Set<Integer> partSet = new HashSet<Integer>();
int partCnt = jsonPartitions.length();
for (int j=0; j < partCnt; j++) {
int p = jsonPartitions.getInt(j);
partSet.add(p);
}
partitions.put(name, partSet);
}
JSONObject jsonPtoTxnId = jo.getJSONObject("partitionToTxnId");
@SuppressWarnings("unchecked")
Iterator<String> it = jsonPtoTxnId.keys();
while (it.hasNext()) {
String key = it.next();
Long val = jsonPtoTxnId.getLong(key);
partitionToTxnId.put(Integer.valueOf(key), val);
}
JSONArray jdt = jo.getJSONArray("digestTables");
for (int i = 0; i < jdt.length(); i++) {
digestTables.add(jdt.getString(i));
}
JSONArray ft = jo.getJSONArray("fileTables");
for (int i = 0; i < ft.length(); i++) {
fileTables.add(ft.getString(i));
}
}