void monitorTaskLogs() throws IOException {

    Map<TaskAttemptID, PerJVMInfo> tasksBeingTruncated =
      new HashMap<TaskAttemptID, PerJVMInfo>();

    // Start monitoring newly added finishedJVMs
    synchronized (finishedJVMs) {
      tasksBeingTruncated.clear();
      tasksBeingTruncated.putAll(finishedJVMs);
      finishedJVMs.clear();
    }

    for (Entry<TaskAttemptID, PerJVMInfo> entry : 
                tasksBeingTruncated.entrySet()) {
      truncateLogs(entry.getKey(), entry.getValue());
    }
  }
void monitorTaskLogs ( ) throws IOException { Map < TaskAttemptID , PerJVMInfo > tasksBeingTruncated = new HashMap < TaskAttemptID , PerJVMInfo > ( ) ; synchronized ( finishedJVMs ) { tasksBeingTruncated . clear ( ) ; tasksBeingTruncated . putAll ( finishedJVMs ) ; finishedJVMs . clear ( ) ; } for ( Entry < TaskAttemptID , PerJVMInfo > entry : tasksBeingTruncated . entrySet ( ) ) { truncateLogs ( entry . getKey ( ) , entry . getValue ( ) ) ; } }
@throws IOException