Examples of JvmFinishedEvent


Examples of org.apache.hadoop.mapreduce.server.tasktracker.userlogs.JvmFinishedEvent

    assertEquals("index file got modified", indexModificationTimeStamp,
        logIndex.lastModified());

    // Finish the task and the JVM too.
    JVMInfo jvmInfo = new JVMInfo(attemptDir, Arrays.asList(task));
    logManager.addLogEvent(new JvmFinishedEvent(jvmInfo));

    // There should be no truncation of the log-file.
    assertTrue(attemptDir.exists());
    assertEquals("index file got modified", indexModificationTimeStamp,
        logIndex.lastModified());

    Map<LogName, Long> logLengths = getAllLogsFileLengths(attemptID, false);
    for (LogName log : LogName.values()) {
      File logFile = TaskLog.getTaskLogFile(attemptID, false, log);
      assertEquals(500, logFile.length());
      // The index file should also be proper.
      assertEquals(500, logLengths.get(log).longValue());
    }

    // truncate it once again
    logManager.addLogEvent(new JvmFinishedEvent(jvmInfo));
    assertEquals("index file got modified", indexModificationTimeStamp,
        logIndex.lastModified());
   
    logLengths = getAllLogsFileLengths(attemptID, false);
    for (LogName log : LogName.values()) {
View Full Code Here

Examples of org.apache.hadoop.mapreduce.server.tasktracker.userlogs.JvmFinishedEvent

    File attemptDir = TaskLog.getAttemptDir(attemptID, false);
    assertTrue(attemptDir + " doesn't exist!", attemptDir.exists());

    // Finish the task and the JVM too.
    JVMInfo jvmInfo = new JVMInfo(attemptDir, Arrays.asList(task));
    logManager.addLogEvent(new JvmFinishedEvent(jvmInfo));

    // The log-file should not be truncated.
    assertTrue(attemptDir.exists());
    Map<LogName, Long> logLengths = getAllLogsFileLengths(attemptID, false);
    for (LogName log : LogName.values()) {
View Full Code Here

Examples of org.apache.hadoop.mapreduce.server.tasktracker.userlogs.JvmFinishedEvent

    File attemptDir = TaskLog.getAttemptDir(attemptID, false);
    assertTrue(attemptDir + " doesn't exist!", attemptDir.exists());

    // Finish the task and the JVM too.
    JVMInfo jvmInfo = new JVMInfo(attemptDir, Arrays.asList(task));
    logManager.addLogEvent(new JvmFinishedEvent(jvmInfo));

    // The log-file should now be truncated.
    assertTrue(attemptDir.exists());

    Map<LogName, Long> logLengths = getAllLogsFileLengths(attemptID, false);
View Full Code Here

Examples of org.apache.hadoop.mapreduce.server.tasktracker.userlogs.JvmFinishedEvent

    File attemptDir = TaskLog.getAttemptDir(attemptID, false);
    assertTrue(attemptDir + " doesn't exist!", attemptDir.exists());

    // Finish the task and the JVM too.
    JVMInfo jvmInfo = new JVMInfo(attemptDir, Arrays.asList(task));
    logManager.addLogEvent(new JvmFinishedEvent(jvmInfo));

    // The log-file should now be truncated.
    assertTrue(attemptDir.exists());

    Map<LogName, Long> logLengths = getAllLogsFileLengths(attemptID, false);
    File logFile = TaskLog.getTaskLogFile(attemptID, false, LogName.SYSLOG);
    assertEquals(1000 + truncatedMsgSize, logFile.length());
    // The index file should also be proper.
    assertEquals(1000 + truncatedMsgSize, logLengths.get(LogName.SYSLOG)
        .longValue());
    String syslog = TestMiniMRMapRedDebugScript.readTaskLog(LogName.SYSLOG,
        attemptID, false);
    assertTrue(syslog.startsWith(TaskLogsTruncater.TRUNCATED_MSG));
    logFile = TaskLog.getTaskLogFile(attemptID, false, LogName.STDERR);
    assertEquals(500, logFile.length());
    // The index file should also be proper.
    assertEquals(500, logLengths.get(LogName.STDERR).longValue());
    String stderr = TestMiniMRMapRedDebugScript.readTaskLog(LogName.STDERR,
        attemptID, false);
    assertFalse(stderr.startsWith(TaskLogsTruncater.TRUNCATED_MSG));

    // truncate once again
    logManager.addLogEvent(new JvmFinishedEvent(jvmInfo));
    logLengths = getAllLogsFileLengths(attemptID, false);
    logFile = TaskLog.getTaskLogFile(attemptID, false, LogName.SYSLOG);
    assertEquals(1000 + truncatedMsgSize, logFile.length());
    // The index file should also be proper.
    assertEquals(1000 + truncatedMsgSize, logLengths.get(LogName.SYSLOG)
View Full Code Here

Examples of org.apache.hadoop.mapreduce.server.tasktracker.userlogs.JvmFinishedEvent

    // Let attempt3 also write some logs
    writeRealChars(attempt1, attempt3, LogName.SYSLOG, 225, 'C');
    // Finish the JVM.
    JVMInfo jvmInfo = new JVMInfo(attemptDir,
        Arrays.asList((new Task[] { task1, task2, task3 })));
    logManager.addLogEvent(new JvmFinishedEvent(jvmInfo));

    // The log-file should now be truncated.
    assertTrue(attemptDir.exists());
    File logFile = TaskLog.getTaskLogFile(attempt1, false, LogName.SYSLOG);
    assertEquals(400  + (2 * truncatedMsgSize), logFile.length());
    // The index files should also be proper.
    assertEquals(150 + truncatedMsgSize, getAllLogsFileLengths(attempt1, false)
        .get(LogName.SYSLOG).longValue());
    assertEquals(100, getAllLogsFileLengths(attempt2, false)
        .get(LogName.SYSLOG).longValue());
    assertEquals(150 + truncatedMsgSize, getAllLogsFileLengths(attempt3, false)
        .get(LogName.SYSLOG).longValue());

    // assert data for attempt1
    String syslog = TestMiniMRMapRedDebugScript.readTaskLog(LogName.SYSLOG,
        attempt1, false);
    assertTrue(syslog.startsWith(TaskLogsTruncater.TRUNCATED_MSG));
    String truncatedLog = syslog.substring(truncatedMsgSize);
    for (int i = 0 ; i < 150; i++) {
      assertEquals("Truncation didn't happen properly. At "
         + (i + 1) + "th byte, expected 'A' but found "
         + truncatedLog.charAt(i), 'A', truncatedLog.charAt(i));
    }
   
    // assert data for attempt2
    syslog = TestMiniMRMapRedDebugScript.readTaskLog(LogName.SYSLOG,
          attempt2, false);
    for (int i = 0 ; i < 100; i++) {
        assertEquals("Truncation didn't happen properly. At "
           + (i + 1) + "th byte, expected 'B' but found "
           + truncatedLog.charAt(i), 'B', syslog.charAt(i));
      }
   
    // assert data for attempt3
    syslog = TestMiniMRMapRedDebugScript.readTaskLog(LogName.SYSLOG,
        attempt3, false);
    assertTrue(syslog.startsWith(TaskLogsTruncater.TRUNCATED_MSG));
    truncatedLog = syslog.substring(truncatedMsgSize);
    for (int i = 0 ; i < 150; i++) {
      assertEquals("Truncation didn't happen properly. At "
         + (i + 1) + "th byte, expected 'C' but found "
         + truncatedLog.charAt(i), 'C', truncatedLog.charAt(i));
    }

    logManager.addLogEvent(new JvmFinishedEvent(jvmInfo));
    // First and third attempts' logs are only truncated, so include 2*length of
    // TRUNCATED_MSG header
    assertEquals(400 + 2 * truncatedMsgSize, logFile.length());
  }
View Full Code Here

Examples of org.apache.hadoop.mapreduce.server.tasktracker.userlogs.JvmFinishedEvent

      }

      // Post-JVM-exit logs processing. inform user log manager
      private void jvmFinished() {
        Task firstTask = initalContext.task;
        JvmFinishedEvent jfe = new JvmFinishedEvent(new JVMInfo(
            TaskLog.getAttemptDir(firstTask.getTaskID(), firstTask.isTaskCleanupTask()),
            tasksGiven));
        tracker.getUserLogManager().addLogEvent(jfe);
      }
View Full Code Here

Examples of org.apache.hadoop.mapreduce.server.tasktracker.userlogs.JvmFinishedEvent

        }
      }

      // Post-JVM-exit logs processing. inform user log manager
      private void jvmFinished() {
        JvmFinishedEvent jfe = new JvmFinishedEvent(new JVMInfo(
            TaskLog.getAttemptDir(firstTask.getTaskID(),
                                  firstTask.isTaskCleanupTask()),
            tasksGiven));
        tracker.getUserLogManager().addLogEvent(jfe);
      }
View Full Code Here

Examples of org.apache.hadoop.mapreduce.server.tasktracker.userlogs.JvmFinishedEvent

        }
      }

      // Post-JVM-exit logs processing. inform user log manager
      private void jvmFinished() {
        JvmFinishedEvent jfe = new JvmFinishedEvent(new JVMInfo(
            TaskLog.getAttemptDir(firstTask.getTaskID(),
                                  firstTask.isTaskCleanupTask()),
            tasksGiven));
        tracker.getUserLogManager().addLogEvent(jfe);
      }
View Full Code Here

Examples of org.apache.hadoop.mapreduce.server.tasktracker.userlogs.JvmFinishedEvent

        }
      }

      // Post-JVM-exit logs processing. inform user log manager
      private void jvmFinished() {
        JvmFinishedEvent jfe = new JvmFinishedEvent(new JVMInfo(
            TaskLog.getAttemptDir(firstTask.getTaskID(),
                                  firstTask.isTaskCleanupTask()),
            tasksGiven));
        tracker.getUserLogManager().addLogEvent(jfe);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.