use of com.google_voltpatches.common.collect.ImmutableList in project voltdb by VoltDB.
the class StreamSnapshotRequestConfig method parseStreams.
private ImmutableList<Stream> parseStreams(JSONObject jsData) {
ImmutableList.Builder<Stream> builder = ImmutableList.builder();
try {
JSONArray streamArray = jsData.getJSONArray("streams");
for (int i = 0; i < streamArray.length(); i++) {
JSONObject streamObj = streamArray.getJSONObject(i);
Integer newPartition = null;
if (!streamObj.isNull("newPartition")) {
newPartition = Integer.parseInt(streamObj.getString("newPartition"));
}
Stream config = new Stream(parseStreamPairs(streamObj), newPartition);
builder.add(config);
}
} catch (JSONException e) {
SNAP_LOG.warn("Failed to parse stream snapshot request config", e);
}
return builder.build();
}
Aggregations