logReader = new ContainerLogsReader(valueStream);
char[] cbuf = new char[bufferSize]; boolean foundLog = false; String logType = logReader.nextLog(); while (logType != null) { if (desiredLogType == null || desiredLogType.isEmpty() || logType.contains(desiredLogType)) { long logLength = logReader.getCurrentLogLength(); if (!foundLog) { writer.append("Container: " + containerKey.toString() + " on " writer.append("Log Type: " + logType + "\n"); writer.append("Log Length: " + 0 + "\n"); logType = logReader.nextLog(); continue; int currentToRead = logLength > bufferSize ? bufferSize : (int) logLength; while (logLength > 0 && (len = logReader.read(cbuf, 0, currentToRead)) > 0) { writer.append(new String(cbuf, 0, len)); foundLog = true; logType = logReader.nextLog();
String logType = logReader.nextLog(); while (logType != null) { if (desiredLogType == null || desiredLogType.isEmpty() || desiredLogType.equals(logType)) { long logLength = logReader.getCurrentLogLength(); if (foundLog) { html.pre()._("\n\n")._(); long ret = logReader.skip(start - totalSkipped); if (ret == 0) { int nextByte = logReader.read(); && (len = logReader.read(cbuf, 0, currentToRead)) > 0) { pre._(new String(cbuf, 0, len)); toRead = toRead - len; logType = logReader.nextLog();
String logType = logReader.nextLog(); while (logType != null) { if (desiredLogType == null || desiredLogType.isEmpty() || desiredLogType.equals(logType)) { long logLength = logReader.getCurrentLogLength(); if (foundLog) { html.pre()._("\n\n")._(); long ret = logReader.skip(start - totalSkipped); if (ret == 0) { int nextByte = logReader.read(); && (len = logReader.read(cbuf, 0, currentToRead)) > 0) { pre._(new String(cbuf, 0, len)); toRead = toRead - len; logType = logReader.nextLog();
logReader = new ContainerLogsReader(valueStream);
String logType = logReader.nextLog(); while (logType != null) { if (desiredLogType == null || desiredLogType.isEmpty() || desiredLogType.equals(logType)) { long logLength = logReader.getCurrentLogLength(); if (foundLog) { html.pre().__("\n\n").__(); logType = logReader.nextLog();
/** * Get a ContainerLogsReader to read the logs for * the specified container. * * @param containerId * @return object to read the container's logs or null if the * logs could not be found * @throws IOException */ @Private public ContainerLogsReader getContainerLogsReader( ContainerId containerId) throws IOException { ContainerLogsReader logReader = null; final LogKey containerKey = new LogKey(containerId); LogKey key = new LogKey(); DataInputStream valueStream = next(key); while (valueStream != null && !key.equals(containerKey)) { valueStream = next(key); } if (valueStream != null) { logReader = new ContainerLogsReader(valueStream); } return logReader; }
/** * Get a ContainerLogsReader to read the logs for * the specified container. * * @param containerId * @return object to read the container's logs or null if the * logs could not be found * @throws IOException */ @Private public ContainerLogsReader getContainerLogsReader( ContainerId containerId) throws IOException { ContainerLogsReader logReader = null; final LogKey containerKey = new LogKey(containerId); LogKey key = new LogKey(); DataInputStream valueStream = next(key); while (valueStream != null && !key.equals(containerKey)) { valueStream = next(key); } if (valueStream != null) { logReader = new ContainerLogsReader(valueStream); } return logReader; }
/** * Get a ContainerLogsReader to read the logs for * the specified container. * * @param containerId * @return object to read the container's logs or null if the * logs could not be found * @throws IOException */ public ContainerLogsReader getContainerLogsReader( ContainerId containerId) throws IOException { ContainerLogsReader logReader = null; final LogKey containerKey = new LogKey(containerId); LogKey key = new LogKey(); DataInputStream valueStream = next(key); while (valueStream != null && !key.equals(containerKey)) { valueStream = next(key); } if (valueStream != null) { logReader = new ContainerLogsReader(valueStream); } return logReader; }
/** * Get a ContainerLogsReader to read the logs for * the specified container. * * @param containerId the containerId * @return object to read the container's logs or null if the * logs could not be found * @throws IOException if we can not get the container log reader. */ @Private public ContainerLogsReader getContainerLogsReader( ContainerId containerId) throws IOException { ContainerLogsReader logReader = null; final LogKey containerKey = new LogKey(containerId); LogKey key = new LogKey(); DataInputStream valueStream = next(key); while (valueStream != null && !key.equals(containerKey)) { valueStream = next(key); } if (valueStream != null) { logReader = new ContainerLogsReader(valueStream); } return logReader; }
private static boolean testLogs( AggregatedLogFormat.ContainerLogsReader logReader, String desiredLogType) throws IOException { boolean foundLog = true; String logType = logReader.nextLog(); while (logType != null) { foundLog = true; if (!logType.contains(desiredLogType)) { foundLog = false; } logType = logReader.nextLog(); } return foundLog; }