use of edu.snu.mist.core.task.QueryManager in project mist by snuspl.
the class DefaultCheckpointManagerImpl method recoverGroup.
@Override
public void recoverGroup(final String groupId) throws IOException {
final Map<String, QueryCheckpoint> queryCheckpointMap;
final List<AvroDag> dagList;
final QueryManager queryManager = queryManagerFuture.get();
try {
// Load the checkpointed states and the query lists.
queryCheckpointMap = checkpointStore.loadSavedGroupState(groupId).getQueryCheckpointMap();
final List<String> queryIdListInGroup = new ArrayList<>();
for (final String queryId : queryCheckpointMap.keySet()) {
queryIdListInGroup.add(queryId);
}
// Load the queries.
dagList = checkpointStore.loadSavedQueries(queryIdListInGroup);
} catch (final FileNotFoundException ie) {
LOG.log(Level.WARNING, "Failed in loading group {0}, this group may not exist in the checkpoint store.", new Object[] { groupId });
return;
}
for (final AvroDag avroDag : dagList) {
final QueryCheckpoint queryCheckpoint = queryCheckpointMap.get(avroDag.getQueryId());
// Recover each query in the group.
queryManager.createQueryWithCheckpoint(avroDag, queryCheckpoint);
}
}
Aggregations