Class LogAggregationTFileController
java.lang.Object
org.apache.hadoop.yarn.logaggregation.filecontroller.LogAggregationFileController
org.apache.hadoop.yarn.logaggregation.filecontroller.tfile.LogAggregationTFileController
The TFile log aggregation file Controller implementation.
-
Field Summary
Fields inherited from class org.apache.hadoop.yarn.logaggregation.filecontroller.LogAggregationFileController
APP_DIR_PERMISSIONS, APP_LOG_FILE_UMASK, conf, fileControllerName, fsSupportsChmod, remoteRootLogDir, remoteRootLogDirSuffix, retentionSize, TLDIR_PERMISSIONS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClose the writer.getApplicationAcls(org.apache.hadoop.fs.Path aggregatedLog, org.apache.hadoop.yarn.api.records.ApplicationId appId) Returns ACLs for the application.getApplicationOwner(org.apache.hadoop.fs.Path aggregatedLog, org.apache.hadoop.yarn.api.records.ApplicationId appId) Returns the owner of the application.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.voidInitialize the writer.voidinitInternal(org.apache.hadoop.conf.Configuration conf) Derived classes initialize themselves using this method.voidOperations needed after write the log content.booleanreadAggregatedLogs(ContainerLogsRequest logRequest, OutputStream os) Output container log.readAggregatedLogsMeta(ContainerLogsRequest logRequest) Return a list ofContainerLogMetafor an application from Remote FileSystem.voidrenderAggregatedLogsBlock(HtmlBlock.Block html, View.ViewContext context) Render Aggregated Logs block.voidwrite(AggregatedLogFormat.LogKey logKey, AggregatedLogFormat.LogValue logValue) Write the log content.Methods inherited from class org.apache.hadoop.yarn.logaggregation.filecontroller.LogAggregationFileController
aggregatedLogSuffix, belongsToAppAttempt, checkExists, cleanOldLogs, closePrintStream, createAppDir, createDir, getApplicationDirectoriesOfUser, getFileControllerName, getFileSystem, getNodeFilesOfApplicationDirectory, getOlderRemoteAppLogDir, getRemoteAppLogDir, getRemoteNodeLogFileForApp, getRemoteRootLogDir, getRemoteRootLogDirSuffix, initialize, isFsSupportsChmod, verifyAndCreateRemoteLogDir
-
Constructor Details
-
LogAggregationTFileController
public LogAggregationTFileController()
-
-
Method Details
-
initInternal
public void initInternal(org.apache.hadoop.conf.Configuration conf) Description copied from class:LogAggregationFileControllerDerived classes initialize themselves using this method.- Specified by:
initInternalin classLogAggregationFileController- Parameters:
conf- the Configuration
-
initializeWriter
Description copied from class:LogAggregationFileControllerInitialize the writer.- Specified by:
initializeWriterin classLogAggregationFileController- Parameters:
context- theLogAggregationFileControllerContext- Throws:
IOException- if fails to initialize the writer
-
closeWriter
Description copied from class:LogAggregationFileControllerClose the writer.- Specified by:
closeWriterin classLogAggregationFileController- Throws:
LogAggregationDFSException- if the closing of the writer fails (for example due to HDFS quota being exceeded)
-
write
public void write(AggregatedLogFormat.LogKey logKey, AggregatedLogFormat.LogValue logValue) throws IOException Description copied from class:LogAggregationFileControllerWrite the log content.- Specified by:
writein classLogAggregationFileController- Parameters:
logKey- the log keylogValue- the log content- Throws:
IOException- if fails to write the logs
-
postWrite
Description copied from class:LogAggregationFileControllerOperations needed after write the log content.- Specified by:
postWritein classLogAggregationFileController- Parameters:
record- theLogAggregationFileControllerContext- Throws:
Exception- if anything fails
-
readAggregatedLogs
public boolean readAggregatedLogs(ContainerLogsRequest logRequest, OutputStream os) throws IOException Description copied from class:LogAggregationFileControllerOutput container log.- Specified by:
readAggregatedLogsin classLogAggregationFileController- Parameters:
logRequest-ContainerLogsRequestos- the output stream- Returns:
- true if we can read the aggregated logs successfully
- Throws:
IOException- if we can not access the log file.
-
getLogMetaFilesOfNode
public Map<String,List<ContainerLogFileInfo>> getLogMetaFilesOfNode(ExtendedLogMetaRequest logRequest, org.apache.hadoop.fs.FileStatus currentNodeFile, org.apache.hadoop.yarn.api.records.ApplicationId appId) throws IOException Description copied from class:LogAggregationFileControllerReturns log file metadata for a node grouped by containers.- Overrides:
getLogMetaFilesOfNodein classLogAggregationFileController- Parameters:
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 path- Returns:
- log file metadata
- Throws:
IOException- if there is no node file
-
readAggregatedLogsMeta
public List<ContainerLogMeta> readAggregatedLogsMeta(ContainerLogsRequest logRequest) throws IOException Description copied from class:LogAggregationFileControllerReturn a list ofContainerLogMetafor an application from Remote FileSystem.- Specified by:
readAggregatedLogsMetain classLogAggregationFileController- Parameters:
logRequest-ContainerLogsRequest- Returns:
- a list of
ContainerLogMeta - Throws:
IOException- if there is no available log file
-
renderAggregatedLogsBlock
Description copied from class:LogAggregationFileControllerRender Aggregated Logs block.- Specified by:
renderAggregatedLogsBlockin classLogAggregationFileController- Parameters:
html- the htmlcontext- the ViewContext
-
getApplicationOwner
public String getApplicationOwner(org.apache.hadoop.fs.Path aggregatedLog, org.apache.hadoop.yarn.api.records.ApplicationId appId) throws IOException Description copied from class:LogAggregationFileControllerReturns the owner of the application.- Specified by:
getApplicationOwnerin classLogAggregationFileController- Parameters:
aggregatedLog- the aggregatedLog pathappId- the ApplicationId- Returns:
- the application owner
- Throws:
IOException- if we can not get the application owner
-
getApplicationAcls
public 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 Description copied from class:LogAggregationFileControllerReturns ACLs for the application. An empty map is returned if no ACLs are found.- Specified by:
getApplicationAclsin classLogAggregationFileController- Parameters:
aggregatedLog- the aggregatedLog path.appId- the ApplicationId- Returns:
- a map of the Application ACLs.
- Throws:
IOException- if we can not get the application acls
-