@InterfaceAudience.Private @InterfaceStability.Unstable public class LogAggregationTFileController extends LogAggregationFileController
APP_DIR_PERMISSIONS, APP_LOG_FILE_UMASK, conf, fileControllerName, fsSupportsChmod, remoteRootLogDir, remoteRootLogDirSuffix, retentionSize, TLDIR_PERMISSIONS
Constructor and Description |
---|
LogAggregationTFileController() |
Modifier and Type | Method and Description |
---|---|
void |
closeWriter()
Close the writer.
|
Map<org.apache.hadoop.yarn.api.records.ApplicationAccessType,String> |
getApplicationAcls(org.apache.hadoop.fs.Path aggregatedLog,
org.apache.hadoop.yarn.api.records.ApplicationId appId)
Returns ACLs for the application.
|
String |
getApplicationOwner(org.apache.hadoop.fs.Path aggregatedLog,
org.apache.hadoop.yarn.api.records.ApplicationId appId)
Returns the owner of the application.
|
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.
|
void |
initializeWriter(LogAggregationFileControllerContext context)
Initialize the writer.
|
void |
initInternal(org.apache.hadoop.conf.Configuration conf)
Derived classes initialize themselves using this method.
|
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, getOlderRemoteAppLogDir, getRemoteAppLogDir, getRemoteNodeLogFileForApp, getRemoteRootLogDir, getRemoteRootLogDirSuffix, initialize, isFsSupportsChmod, verifyAndCreateRemoteLogDir
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() throws LogAggregationDFSException
LogAggregationFileController
closeWriter
in class LogAggregationFileController
LogAggregationDFSException
- if the closing of the writer fails
(for example due to HDFS quota being exceeded)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 filepublic 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 aggregatedLog, org.apache.hadoop.yarn.api.records.ApplicationId appId) throws IOException
LogAggregationFileController
getApplicationOwner
in class LogAggregationFileController
aggregatedLog
- 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 aggregatedLog, org.apache.hadoop.yarn.api.records.ApplicationId appId) throws IOException
LogAggregationFileController
getApplicationAcls
in class LogAggregationFileController
aggregatedLog
- the aggregatedLog path.appId
- the ApplicationIdIOException
- if we can not get the application aclsCopyright © 2008–2024 Apache Software Foundation. All rights reserved.