Skip to content

Commit

Permalink
YARN-7259. Add size-based rolling policy to LogAggregationIndexedFile…
Browse files Browse the repository at this point in the history
…Controller. (xgong via wangda)

Change-Id: Ifaf82c0aee6b73b9b6ebf103aa72e131e3942f31
  • Loading branch information
wangdatan committed Oct 2, 2017
1 parent 2c62ff7 commit 280080f
Show file tree
Hide file tree
Showing 3 changed files with 340 additions and 138 deletions.
Expand Up @@ -101,10 +101,9 @@ protected void render(Block html) {
return; return;
} }


Map<String, FileStatus> checkSumFiles; Map<String, Long> checkSumFiles;
try { try {
checkSumFiles = fileController.filterFiles(nodeFiles, checkSumFiles = fileController.parseCheckSumFiles(nodeFiles);
LogAggregationIndexedFileController.CHECK_SUM_FILE_SUFFIX);
} catch (IOException ex) { } catch (IOException ex) {
LOG.error("Error getting logs for " + logEntity, ex); LOG.error("Error getting logs for " + logEntity, ex);
html.h1("Error getting logs for " + logEntity); html.h1("Error getting logs for " + logEntity);
Expand All @@ -125,12 +124,11 @@ protected void render(Block html) {
String desiredLogType = $(CONTAINER_LOG_TYPE); String desiredLogType = $(CONTAINER_LOG_TYPE);
try { try {
for (FileStatus thisNodeFile : fileToRead) { for (FileStatus thisNodeFile : fileToRead) {
FileStatus checkSum = fileController.getAllChecksumFiles( Long checkSumIndex = checkSumFiles.get(
checkSumFiles, thisNodeFile.getPath().getName()); thisNodeFile.getPath().getName());
long endIndex = -1; long endIndex = -1;
if (checkSum != null) { if (checkSumIndex != null) {
endIndex = fileController.loadIndexedLogsCheckSum( endIndex = checkSumIndex.longValue();
checkSum.getPath());
} }
IndexedLogsMeta indexedLogsMeta = null; IndexedLogsMeta indexedLogsMeta = null;
try { try {
Expand Down

0 comments on commit 280080f

Please sign in to comment.