@InterfaceAudience.Private @InterfaceStability.Unstable public class LogAggregationIndexedFileController extends LogAggregationFileController
Modifier and Type | Class and Description |
---|---|
static class |
LogAggregationIndexedFileController.IndexedFileLogMeta
This IndexedFileLogMeta includes the meta information
for a single file which would be aggregated in one
Log aggregation cycle.
|
static class |
LogAggregationIndexedFileController.IndexedLogsMeta
This IndexedLogsMeta includes all the meta information
for the aggregated log file.
|
static class |
LogAggregationIndexedFileController.IndexedPerAggregationLogMeta
This IndexedPerAggregationLogMeta includes the meta information
for all files which would be aggregated in one
Log aggregation cycle.
|
Modifier and Type | Field and Description |
---|---|
static String |
CHECK_SUM_FILE_SUFFIX |
APP_DIR_PERMISSIONS, APP_LOG_FILE_UMASK, conf, fileControllerName, fsSupportsChmod, remoteRootLogDir, remoteRootLogDirSuffix, retentionSize, TLDIR_PERMISSIONS
Constructor and Description |
---|
LogAggregationIndexedFileController() |
Modifier and Type | Method and Description |
---|---|
void |
closeWriter()
Close the writer.
|
org.apache.hadoop.fs.FileStatus |
getAllChecksumFiles(Map<String,org.apache.hadoop.fs.FileStatus> fileMap,
String fileName) |
Map<org.apache.hadoop.yarn.api.records.ApplicationAccessType,String> |
getApplicationAcls(org.apache.hadoop.fs.Path aggregatedLogPath,
org.apache.hadoop.yarn.api.records.ApplicationId appId)
Returns ACLs for the application.
|
String |
getApplicationOwner(org.apache.hadoop.fs.Path aggregatedLogPath,
org.apache.hadoop.yarn.api.records.ApplicationId appId)
Returns the owner of the application.
|
static int |
getFSInputBufferSize(org.apache.hadoop.conf.Configuration conf) |
static int |
getFSOutputBufferSize(org.apache.hadoop.conf.Configuration conf) |
Map<String,List<ContainerLogFileInfo>> |
getLogMetaFilesOfNode(ExtendedLogMetaRequest logRequest,
org.apache.hadoop.fs.FileStatus currentNodeFile,
org.apache.hadoop.yarn.api.records.ApplicationId appId)
Returns log file metadata for a node grouped by containers.
|
List<org.apache.hadoop.fs.FileStatus> |
getNodeLogFileToRead(List<org.apache.hadoop.fs.FileStatus> nodeFiles,
String nodeId,
org.apache.hadoop.yarn.api.records.ApplicationId appId) |
org.apache.hadoop.fs.Path |
getOlderRemoteAppLogDir(org.apache.hadoop.yarn.api.records.ApplicationId appId,
String user)
Get the older remote application directory for log aggregation.
|
org.apache.hadoop.fs.Path |
getRemoteAppLogDir(org.apache.hadoop.yarn.api.records.ApplicationId appId,
String user)
Get the remote application directory for log aggregation.
|
long |
getRollOverLogMaxSize(org.apache.hadoop.conf.Configuration conf) |
Clock |
getSystemClock() |
void |
initializeWriter(LogAggregationFileControllerContext context)
Initialize the writer.
|
void |
initInternal(org.apache.hadoop.conf.Configuration conf)
Derived classes initialize themselves using this method.
|
boolean |
isRollover(org.apache.hadoop.fs.FileContext fc,
org.apache.hadoop.fs.Path candidate) |
LogAggregationIndexedFileController.IndexedLogsMeta |
loadIndexedLogsMeta(org.apache.hadoop.fs.Path remoteLogPath,
long end,
org.apache.hadoop.yarn.api.records.ApplicationId appId) |
Map<String,Long> |
parseCheckSumFiles(List<org.apache.hadoop.fs.FileStatus> fileList) |
void |
postWrite(LogAggregationFileControllerContext record)
Operations needed after write the log content.
|
boolean |
readAggregatedLogs(ContainerLogsRequest logRequest,
OutputStream os)
Output container log.
|
List<ContainerLogMeta> |
readAggregatedLogsMeta(ContainerLogsRequest logRequest)
Return a list of
ContainerLogMeta for an application
from Remote FileSystem. |
void |
renderAggregatedLogsBlock(HtmlBlock.Block html,
View.ViewContext context)
Render Aggregated Logs block.
|
void |
write(AggregatedLogFormat.LogKey logKey,
AggregatedLogFormat.LogValue logValue)
Write the log content.
|
aggregatedLogSuffix, belongsToAppAttempt, checkExists, cleanOldLogs, closePrintStream, createAppDir, createDir, getApplicationDirectoriesOfUser, getFileControllerName, getFileSystem, getNodeFilesOfApplicationDirectory, getRemoteNodeLogFileForApp, getRemoteRootLogDir, getRemoteRootLogDirSuffix, initialize, isFsSupportsChmod, verifyAndCreateRemoteLogDir
@VisibleForTesting public static final String CHECK_SUM_FILE_SUFFIX
public void initInternal(org.apache.hadoop.conf.Configuration conf)
LogAggregationFileController
initInternal
in class LogAggregationFileController
conf
- the Configurationpublic void initializeWriter(LogAggregationFileControllerContext context) throws IOException
LogAggregationFileController
initializeWriter
in class LogAggregationFileController
context
- the LogAggregationFileControllerContext
IOException
- if fails to initialize the writerpublic void closeWriter()
LogAggregationFileController
closeWriter
in class LogAggregationFileController
public void write(AggregatedLogFormat.LogKey logKey, AggregatedLogFormat.LogValue logValue) throws IOException
LogAggregationFileController
write
in class LogAggregationFileController
logKey
- the log keylogValue
- the log contentIOException
- if fails to write the logspublic void postWrite(LogAggregationFileControllerContext record) throws Exception
LogAggregationFileController
postWrite
in class LogAggregationFileController
record
- the LogAggregationFileControllerContext
Exception
- if anything failspublic boolean readAggregatedLogs(ContainerLogsRequest logRequest, OutputStream os) throws IOException
LogAggregationFileController
readAggregatedLogs
in class LogAggregationFileController
logRequest
- ContainerLogsRequest
os
- the output streamIOException
- if we can not access the log file.public Map<String,List<ContainerLogFileInfo>> getLogMetaFilesOfNode(ExtendedLogMetaRequest logRequest, org.apache.hadoop.fs.FileStatus currentNodeFile, org.apache.hadoop.yarn.api.records.ApplicationId appId) throws IOException
LogAggregationFileController
getLogMetaFilesOfNode
in class LogAggregationFileController
logRequest
- extended query information holdercurrentNodeFile
- file status of a node in an application directoryappId
- id of the application, which is the same as in node pathIOException
- if there is no node filepublic List<ContainerLogMeta> readAggregatedLogsMeta(ContainerLogsRequest logRequest) throws IOException
LogAggregationFileController
ContainerLogMeta
for an application
from Remote FileSystem.readAggregatedLogsMeta
in class LogAggregationFileController
logRequest
- ContainerLogsRequest
ContainerLogMeta
IOException
- if there is no available log file@InterfaceAudience.Private public Map<String,Long> parseCheckSumFiles(List<org.apache.hadoop.fs.FileStatus> fileList) throws IOException
IOException
@InterfaceAudience.Private public List<org.apache.hadoop.fs.FileStatus> getNodeLogFileToRead(List<org.apache.hadoop.fs.FileStatus> nodeFiles, String nodeId, org.apache.hadoop.yarn.api.records.ApplicationId appId) throws IOException
IOException
@InterfaceAudience.Private public org.apache.hadoop.fs.FileStatus getAllChecksumFiles(Map<String,org.apache.hadoop.fs.FileStatus> fileMap, String fileName)
public void renderAggregatedLogsBlock(HtmlBlock.Block html, View.ViewContext context)
LogAggregationFileController
renderAggregatedLogsBlock
in class LogAggregationFileController
html
- the htmlcontext
- the ViewContextpublic String getApplicationOwner(org.apache.hadoop.fs.Path aggregatedLogPath, org.apache.hadoop.yarn.api.records.ApplicationId appId) throws IOException
LogAggregationFileController
getApplicationOwner
in class LogAggregationFileController
aggregatedLogPath
- the aggregatedLog pathappId
- the ApplicationIdIOException
- if we can not get the application ownerpublic Map<org.apache.hadoop.yarn.api.records.ApplicationAccessType,String> getApplicationAcls(org.apache.hadoop.fs.Path aggregatedLogPath, org.apache.hadoop.yarn.api.records.ApplicationId appId) throws IOException
LogAggregationFileController
getApplicationAcls
in class LogAggregationFileController
aggregatedLogPath
- the aggregatedLog path.appId
- the ApplicationIdIOException
- if we can not get the application aclspublic org.apache.hadoop.fs.Path getRemoteAppLogDir(org.apache.hadoop.yarn.api.records.ApplicationId appId, String user) throws IOException
LogAggregationFileController
getRemoteAppLogDir
in class LogAggregationFileController
appId
- the Application IDuser
- the Application OwnerIOException
- if can not find the remote application directorypublic org.apache.hadoop.fs.Path getOlderRemoteAppLogDir(org.apache.hadoop.yarn.api.records.ApplicationId appId, String user) throws IOException
LogAggregationFileController
getOlderRemoteAppLogDir
in class LogAggregationFileController
appId
- the Application IDuser
- the Application OwnerIOException
- if can not find the remote application directory@InterfaceAudience.Private public LogAggregationIndexedFileController.IndexedLogsMeta loadIndexedLogsMeta(org.apache.hadoop.fs.Path remoteLogPath, long end, org.apache.hadoop.yarn.api.records.ApplicationId appId) throws IOException
IOException
@InterfaceAudience.Private public static int getFSOutputBufferSize(org.apache.hadoop.conf.Configuration conf)
@InterfaceAudience.Private public static int getFSInputBufferSize(org.apache.hadoop.conf.Configuration conf)
@InterfaceAudience.Private @VisibleForTesting public long getRollOverLogMaxSize(org.apache.hadoop.conf.Configuration conf)
@InterfaceAudience.Private @VisibleForTesting public boolean isRollover(org.apache.hadoop.fs.FileContext fc, org.apache.hadoop.fs.Path candidate) throws IOException
IOException
@InterfaceAudience.Private @VisibleForTesting public Clock getSystemClock()
Copyright © 2008–2024 Apache Software Foundation. All rights reserved.