private synchronized void cleanupSentinels(final Map<String, SnapshotSentinel> sentinels) {
long currentTime = EnvironmentEdgeManager.currentTimeMillis();
Iterator<Map.Entry<String, SnapshotSentinel>> it = sentinels.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, SnapshotSentinel> entry = it.next();
SnapshotSentinel sentinel = entry.getValue();
if (sentinel.isFinished() &&
(currentTime - sentinel.getCompletionTimestamp()) > SNAPSHOT_SENTINELS_CLEANUP_TIMEOUT)
{
it.remove();
}
}
}