@Override public LogData fetchLogs(final int execId, final String name, final int attempt, final int startByte, final int length) throws ExecutorManagerException { return this.executionLogsDao.fetchLogs(execId, name, attempt, startByte, length); }
@Test public void testLargeUploadLog() throws ExecutorManagerException { final File logDir = ExecutionsTestUtil.getFlowDir(LOG_TEST_DIR_NAME); // Multiple of 255 for Henry the Eigth final File[] largelog = {new File(logDir, "largeLog1.log"), new File(logDir, "largeLog2.log"), new File(logDir, "largeLog3.log")}; this.executionLogsDao.uploadLogFile(1, "largeFiles", 0, largelog); final LogData logsResult = this.executionLogsDao.fetchLogs(1, "largeFiles", 0, 0, 64000); assertThat(logsResult).isNotNull(); assertThat(logsResult.getLength()).isEqualTo(64000); final LogData logsResult2 = this.executionLogsDao.fetchLogs(1, "largeFiles", 0, 1000, 64000); assertThat(logsResult2).isNotNull(); assertThat(logsResult2.getLength()).isEqualTo(64000); final LogData logsResult3 = this.executionLogsDao.fetchLogs(1, "largeFiles", 0, 150000, 250000); assertThat(logsResult3).isNotNull(); assertThat(logsResult3.getLength()).isEqualTo(185493); } }
@Test public void testSmallUploadLog() throws ExecutorManagerException { final File logDir = ExecutionsTestUtil.getFlowDir(LOG_TEST_DIR_NAME); final File[] smalllog = {new File(logDir, "log1.log"), new File(logDir, "log2.log"), new File(logDir, "log3.log")}; this.executionLogsDao.uploadLogFile(1, "smallFiles", 0, smalllog); final LogData data = this.executionLogsDao.fetchLogs(1, "smallFiles", 0, 0, 50000); assertThat(data).isNotNull(); assertThat(data.getLength()).isEqualTo(53); System.out.println(data.toString()); final LogData data2 = this.executionLogsDao.fetchLogs(1, "smallFiles", 0, 10, 20); System.out.println(data2.toString()); assertThat(data2).isNotNull(); assertThat(data2.getLength()).isEqualTo(20); }
@Override public LogData fetchLogs(final int execId, final String name, final int attempt, final int startByte, final int length) throws ExecutorManagerException { return this.executionLogsDao.fetchLogs(execId, name, attempt, startByte, length); }