@Private
public class LogAggregationUtils
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
static org.slf4j.Logger |
LOG |
|
static java.lang.String |
LOG_PATH_FOR_LOCAL_VOLUME |
|
static java.lang.String |
TMP_FILE_SUFFIX |
| Constructor | Description |
|---|---|
LogAggregationUtils() |
| Modifier and Type | Method | Description |
|---|---|---|
static void |
checkACLConf(boolean isUsersACLEnable,
boolean forceInit,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path rootDir) |
|
static void |
cleanAllACE(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path rootDir) |
Remove all ACE from users directories at root log directory
|
static java.lang.String |
getBucketSuffix() |
Returns the bucket suffix component of the log dir.
|
static org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.FileStatus> |
getNodeFiles(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path remoteAppLogDir,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String appOwner) |
Get all available log files under remote app log directory.
|
static java.lang.String |
getNodeString(java.lang.String nodeId) |
|
static java.lang.String |
getNodeString(org.apache.hadoop.yarn.api.records.NodeId nodeId) |
Converts a nodeId to a form used in the app log file name.
|
static org.apache.hadoop.fs.Path |
getOlderRemoteAppLogDir(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String user,
org.apache.hadoop.fs.Path remoteRootLogDir,
java.lang.String suffix) |
|
static org.apache.hadoop.fs.Path |
getOlderRemoteAppLogDir(org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String user,
org.apache.hadoop.fs.Path remoteRootLogDir,
java.lang.String suffix) |
Gets the older remote app log dir.
|
static org.apache.hadoop.fs.Path |
getOlderRemoteLogSuffixedDir(org.apache.hadoop.fs.Path remoteRootLogDir,
java.lang.String user,
java.lang.String suffix) |
Gets the older remote suffixed log dir for the user.
|
static org.apache.hadoop.fs.Path |
getRemoteAppLogDir(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String appOwner,
org.apache.hadoop.fs.Path remoteRootLogDir,
java.lang.String suffix) |
Return the remote application log directory.
|
static org.apache.hadoop.fs.Path |
getRemoteAppLogDir(org.apache.hadoop.fs.Path remoteRootLogDir,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String user,
java.lang.String suffix) |
Gets the remote app log dir.
|
static org.apache.hadoop.fs.Path |
getRemoteBucketDir(org.apache.hadoop.fs.Path remoteRootLogDir,
java.lang.String user,
java.lang.String suffix,
org.apache.hadoop.yarn.api.records.ApplicationId appId) |
Gets the remote log user's bucket dir.
|
static org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.FileStatus> |
getRemoteFiles(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path appPath) |
|
static org.apache.hadoop.fs.Path |
getRemoteLogSuffixedDir(org.apache.hadoop.fs.Path remoteRootLogDir,
java.lang.String user,
java.lang.String suffix) |
Gets the remote suffixed log dir for the user.
|
static org.apache.hadoop.fs.Path |
getRemoteLogUserDir(org.apache.hadoop.fs.Path remoteRootLogDir,
java.lang.String user) |
Gets the remote log user dir.
|
static org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.FileStatus> |
getRemoteNodeFileDir(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String appOwner,
org.apache.hadoop.fs.Path remoteRootLogDir,
java.lang.String suffix,
java.lang.String oldSuffix) |
Get all available log files under remote app log directory.
|
static java.util.List<org.apache.hadoop.fs.FileStatus> |
getRemoteNodeFileList(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String appOwner,
org.apache.hadoop.fs.Path remoteRootLogDir,
java.lang.String suffix,
java.lang.String oldSuffix) |
Get all available log files under remote app log directory.
|
static org.apache.hadoop.fs.Path |
getRemoteNodeLogFileForApp(org.apache.hadoop.fs.Path remoteRootLogDir,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String user,
org.apache.hadoop.yarn.api.records.NodeId nodeId,
java.lang.String suffix) |
Constructs the full filename for an application's log file per node.
|
static org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.FileStatus> |
getUserRemoteLogDir(org.apache.hadoop.conf.Configuration conf,
java.lang.String user,
org.apache.hadoop.fs.Path remoteRootLogDir,
java.lang.String remoteRootLogDirSuffix) |
|
static void |
initACLForAggregatedLogs(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.security.authorize.UsersACLsManager usersAclsManager,
org.apache.hadoop.fs.Path rootDir) |
Set ACE to users log aggregated directories at root log directory based on user ACL mapping
|
static boolean |
isOlderPathEnabled(org.apache.hadoop.conf.Configuration conf) |
Check if older Application Log Directory has to be included.
|
public static final org.slf4j.Logger LOG
public static final java.lang.String TMP_FILE_SUFFIX
public static final java.lang.String LOG_PATH_FOR_LOCAL_VOLUME
public static org.apache.hadoop.fs.Path getRemoteNodeLogFileForApp(org.apache.hadoop.fs.Path remoteRootLogDir,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String user,
org.apache.hadoop.yarn.api.records.NodeId nodeId,
java.lang.String suffix)
remoteRootLogDir - the aggregated remote root log dirappId - the application Iduser - the application ownernodeId - the node idsuffix - the log dir suffixpublic static org.apache.hadoop.fs.Path getRemoteAppLogDir(org.apache.hadoop.fs.Path remoteRootLogDir,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String user,
java.lang.String suffix)
remoteRootLogDir - the aggregated log remote root log dirappId - the application iduser - the application ownersuffix - the log directory suffixpublic static org.apache.hadoop.fs.Path getOlderRemoteAppLogDir(org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String user,
org.apache.hadoop.fs.Path remoteRootLogDir,
java.lang.String suffix)
appId - the application iduser - the application ownerremoteRootLogDir - the aggregated log remote root log dirsuffix - the log directory suffixpublic static org.apache.hadoop.fs.Path getOlderRemoteAppLogDir(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String user,
org.apache.hadoop.fs.Path remoteRootLogDir,
java.lang.String suffix)
throws java.io.IOException
java.io.IOExceptionpublic static org.apache.hadoop.fs.Path getRemoteLogSuffixedDir(org.apache.hadoop.fs.Path remoteRootLogDir,
java.lang.String user,
java.lang.String suffix)
remoteRootLogDir - the aggregated log remote root log diruser - the application ownersuffix - the log dir suffixpublic static org.apache.hadoop.fs.Path getOlderRemoteLogSuffixedDir(org.apache.hadoop.fs.Path remoteRootLogDir,
java.lang.String user,
java.lang.String suffix)
remoteRootLogDir - the aggregated log remote root log diruser - the application ownersuffix - the log dir suffixpublic static org.apache.hadoop.fs.Path getRemoteLogUserDir(org.apache.hadoop.fs.Path remoteRootLogDir,
java.lang.String user)
remoteRootLogDir - the aggregated log remote root log diruser - the application ownerpublic static org.apache.hadoop.fs.Path getRemoteBucketDir(org.apache.hadoop.fs.Path remoteRootLogDir,
java.lang.String user,
java.lang.String suffix,
org.apache.hadoop.yarn.api.records.ApplicationId appId)
remoteRootLogDir - the aggregated log remote root log diruser - the application ownersuffix - the log dir suffixappId - the application idpublic static boolean isOlderPathEnabled(org.apache.hadoop.conf.Configuration conf)
conf - the configurationpublic static java.lang.String getBucketSuffix()
@VisibleForTesting public static java.lang.String getNodeString(org.apache.hadoop.yarn.api.records.NodeId nodeId)
nodeId - the nodeId@VisibleForTesting public static java.lang.String getNodeString(java.lang.String nodeId)
public static org.apache.hadoop.fs.Path getRemoteAppLogDir(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String appOwner,
org.apache.hadoop.fs.Path remoteRootLogDir,
java.lang.String suffix)
throws java.io.IOException
conf - the configurationappId - the applicationappOwner - the application ownerremoteRootLogDir - the remote root log directorysuffix - the log directory suffixjava.io.IOException - if we can not find remote application log directorypublic static org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.FileStatus> getNodeFiles(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path remoteAppLogDir,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String appOwner)
throws java.io.IOException
conf - the configurationremoteAppLogDir - the application log directoryappId - the applicationIdappOwner - the application ownerjava.io.IOException - if there is no log file directorypublic static org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.FileStatus> getRemoteNodeFileDir(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String appOwner,
org.apache.hadoop.fs.Path remoteRootLogDir,
java.lang.String suffix,
java.lang.String oldSuffix)
throws java.io.IOException
conf - the configurationappId - the applicationIdappOwner - the application ownerremoteRootLogDir - the remote root log directorysuffix - the log directory suffixjava.io.IOException - if there is no log file availablepublic static java.util.List<org.apache.hadoop.fs.FileStatus> getRemoteNodeFileList(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String appOwner,
org.apache.hadoop.fs.Path remoteRootLogDir,
java.lang.String suffix,
java.lang.String oldSuffix)
throws java.io.IOException
conf - the configurationappId - the applicationIdappOwner - the application ownerremoteRootLogDir - the remote root log directorysuffix - the log directory suffixjava.io.IOException - if there is no log file availablepublic static org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.FileStatus> getRemoteFiles(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path appPath)
throws java.io.IOException
java.io.IOExceptionpublic static org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.FileStatus> getUserRemoteLogDir(org.apache.hadoop.conf.Configuration conf,
java.lang.String user,
org.apache.hadoop.fs.Path remoteRootLogDir,
java.lang.String remoteRootLogDirSuffix)
throws java.io.IOException
java.io.IOExceptionpublic static void initACLForAggregatedLogs(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.security.authorize.UsersACLsManager usersAclsManager,
org.apache.hadoop.fs.Path rootDir)
conf - the configurationusersAclsManager - user ACL mappingrootDir - the remote root log directorypublic static void cleanAllACE(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path rootDir)
conf - the configurationrootDir - the remote root log directorypublic static void checkACLConf(boolean isUsersACLEnable,
boolean forceInit,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path rootDir)
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.