public class LogAggregationNodeLocalTFileController extends LogAggregationFileController
APP_DIR_PERMISSIONS, APP_LOG_FILE_UMASK, conf, fileControllerName, fsSupportsChmod, maxRetry, remoteOlderRootLogDirSuffix, remoteRootLogDir, remoteRootLogDirSuffix, retentionSize, retryTimeout, TLDIR_PERMISSIONS, usersAclsManager| Constructor | Description |
|---|---|
LogAggregationNodeLocalTFileController() |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
cleanOldLogs(org.apache.hadoop.fs.Path remoteNodeLogFileForApp,
org.apache.hadoop.yarn.api.records.NodeId nodeId,
org.apache.hadoop.security.UserGroupInformation userUgi) |
|
void |
closeWriter() |
Close the writer.
|
void |
createAppDir(java.lang.String user,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
org.apache.hadoop.security.UserGroupInformation userUgi) |
Create remote Application directory for log aggregation.
|
protected void |
extractRemoteRootLogDir() |
Sets the remoteRootLogDir class variable extracting
YarnConfiguration.LOG_AGGREGATION_REMOTE_APP_LOG_DIR_FMT
from the configuration or YarnConfiguration.NM_REMOTE_APP_LOG_DIR,
if the former is not set. |
protected void |
extractRemoteRootLogDirSuffix() |
Sets the remoteRootLogDirSuffix class variable extracting
YarnConfiguration.LOG_AGGREGATION_REMOTE_APP_LOG_DIR_SUFFIX_FMT
from the configuration, or
YarnConfiguration.NM_REMOTE_APP_LOG_DIR_SUFFIX appended by the
FileController's name, if the former is not set. |
java.util.Map<org.apache.hadoop.yarn.api.records.ApplicationAccessType,java.lang.String> |
getApplicationAcls(org.apache.hadoop.fs.Path aggregatedLog,
org.apache.hadoop.yarn.api.records.ApplicationId appId) |
Returns ACLs for the application.
|
java.lang.String |
getApplicationOwner(org.apache.hadoop.fs.Path aggregatedLog,
org.apache.hadoop.yarn.api.records.ApplicationId appId) |
Returns the owner of the application.
|
org.apache.hadoop.fs.Path |
getNodeLocalMetadataDir() |
|
java.lang.String |
getNodeLocalMetadataDirPrefix() |
|
NodeLocalMetadataReader |
getNodeLocalMetadataReader() |
|
org.apache.hadoop.fs.Path |
getOlderRemoteAppLogDir(org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String appOwner) |
Get the older remote application directory for log aggregation.
|
org.apache.hadoop.fs.Path |
getRemoteAppLogDir(org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String appOwner) |
Get the remote application directory for log aggregation.
|
org.apache.hadoop.fs.Path |
getRemoteNodeLogFileForApp(org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String user,
org.apache.hadoop.yarn.api.records.NodeId nodeId) |
Get the remote aggregated log path.
|
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,
java.io.OutputStream os) |
Output container log.
|
java.util.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, closePrintStream, createDir, extractRemoteOlderRootLogDirSuffix, getApplicationDirectoriesOfUser, getFileControllerName, getFileSystem, getLogMetaFilesOfNode, getNodeFilesOfApplicationDirectory, getRemoteOlderRootLogDirSuffix, getRemoteRootLogDir, getRemoteRootLogDirSuffix, initialize, isFsSupportsChmod, verifyAndCreateRemoteLogDirpublic LogAggregationNodeLocalTFileController()
protected void extractRemoteRootLogDir()
LogAggregationFileControllerYarnConfiguration.LOG_AGGREGATION_REMOTE_APP_LOG_DIR_FMT
from the configuration or YarnConfiguration.NM_REMOTE_APP_LOG_DIR,
if the former is not set.extractRemoteRootLogDir in class LogAggregationFileControllerprotected void extractRemoteRootLogDirSuffix()
LogAggregationFileControllerYarnConfiguration.LOG_AGGREGATION_REMOTE_APP_LOG_DIR_SUFFIX_FMT
from the configuration, or
YarnConfiguration.NM_REMOTE_APP_LOG_DIR_SUFFIX appended by the
FileController's name, if the former is not set.extractRemoteRootLogDirSuffix in class LogAggregationFileControllerpublic void initInternal(org.apache.hadoop.conf.Configuration conf)
LogAggregationFileControllerinitInternal in class LogAggregationFileControllerconf - the Configurationpublic void createAppDir(java.lang.String user,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
org.apache.hadoop.security.UserGroupInformation userUgi)
LogAggregationFileControllercreateAppDir in class LogAggregationFileControlleruser - the userappId - the application IDuserUgi - the UGIpublic void initializeWriter(LogAggregationFileControllerContext context) throws java.io.IOException
LogAggregationFileControllerinitializeWriter in class LogAggregationFileControllercontext - the LogAggregationFileControllerContextjava.io.IOException - if fails to initialize the writerpublic void closeWriter()
throws LogAggregationDFSException
LogAggregationFileControllercloseWriter in class LogAggregationFileControllerLogAggregationDFSException - 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 java.io.IOException
LogAggregationFileControllerwrite in class LogAggregationFileControllerlogKey - the log keylogValue - the log contentjava.io.IOException - if fails to write the logspublic void postWrite(LogAggregationFileControllerContext record) throws java.lang.Exception
LogAggregationFileControllerpostWrite in class LogAggregationFileControllerrecord - the LogAggregationFileControllerContextjava.lang.Exception - if anything failspublic boolean readAggregatedLogs(ContainerLogsRequest logRequest, java.io.OutputStream os) throws java.io.IOException
LogAggregationFileControllerreadAggregatedLogs in class LogAggregationFileControllerlogRequest - ContainerLogsRequestos - the output streamjava.io.IOException - if we can not access the log file.public java.util.List<ContainerLogMeta> readAggregatedLogsMeta(ContainerLogsRequest logRequest) throws java.io.IOException
LogAggregationFileControllerContainerLogMeta for an application
from Remote FileSystem.readAggregatedLogsMeta in class LogAggregationFileControllerlogRequest - ContainerLogsRequestContainerLogMetajava.io.IOException - if there is no available log filepublic void renderAggregatedLogsBlock(HtmlBlock.Block html, View.ViewContext context)
LogAggregationFileControllerrenderAggregatedLogsBlock in class LogAggregationFileControllerhtml - the htmlcontext - the ViewContextpublic org.apache.hadoop.fs.Path getRemoteNodeLogFileForApp(org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String user,
org.apache.hadoop.yarn.api.records.NodeId nodeId)
LogAggregationFileControllergetRemoteNodeLogFileForApp in class LogAggregationFileControllerappId - the ApplicationIduser - the Application OwnernodeId - the NodeManager Idpublic org.apache.hadoop.fs.Path getRemoteAppLogDir(org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String appOwner)
throws java.io.IOException
LogAggregationFileControllergetRemoteAppLogDir in class LogAggregationFileControllerappId - the Application IDappOwner - the Application Ownerjava.io.IOException - if can not find the remote application directorypublic org.apache.hadoop.fs.Path getOlderRemoteAppLogDir(org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String appOwner)
throws java.io.IOException
LogAggregationFileControllergetOlderRemoteAppLogDir in class LogAggregationFileControllerappId - the Application IDappOwner - the Application Ownerjava.io.IOException - if can not find the remote application directoryprotected void cleanOldLogs(org.apache.hadoop.fs.Path remoteNodeLogFileForApp,
org.apache.hadoop.yarn.api.records.NodeId nodeId,
org.apache.hadoop.security.UserGroupInformation userUgi)
cleanOldLogs in class LogAggregationFileControllerpublic NodeLocalMetadataReader getNodeLocalMetadataReader()
public org.apache.hadoop.fs.Path getNodeLocalMetadataDir()
public java.lang.String getNodeLocalMetadataDirPrefix()
public java.lang.String getApplicationOwner(org.apache.hadoop.fs.Path aggregatedLog,
org.apache.hadoop.yarn.api.records.ApplicationId appId)
throws java.io.IOException
LogAggregationFileControllergetApplicationOwner in class LogAggregationFileControlleraggregatedLog - the aggregatedLog pathappId - the ApplicationIdjava.io.IOException - if we can not get the application ownerpublic java.util.Map<org.apache.hadoop.yarn.api.records.ApplicationAccessType,java.lang.String> getApplicationAcls(org.apache.hadoop.fs.Path aggregatedLog,
org.apache.hadoop.yarn.api.records.ApplicationId appId)
throws java.io.IOException
LogAggregationFileControllergetApplicationAcls in class LogAggregationFileControlleraggregatedLog - the aggregatedLog path.appId - the ApplicationIdjava.io.IOException - if we can not get the application aclsCopyright © 2008–2025 Apache Software Foundation. All rights reserved.