public abstract class ContainerLogUtils extends Object
| Constructor and Description |
|---|
ContainerLogUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getFileContent(File file)
Reads a file content and return it as String.
|
static List<Resource> |
queryContainerLogs(YarnCluster yarnCluster,
ApplicationId applicationId)
Find container logs for running cluster and application.
|
static List<Resource> |
queryContainerLogs(YarnCluster yarnCluster,
ApplicationId applicationId,
String fileName)
Find container logs for running cluster and application.
|
public static List<Resource> queryContainerLogs(YarnCluster yarnCluster, ApplicationId applicationId, String fileName) throws IOException
Created pattern which is used with PathMatchingResourcePatternResolver
is resolved from YarnCluster, ApplicationId and fileName.
For example if fileName is given as *.std*, pattern will look like
file:/path/to/project/target/yarn--1502101888/*logDir*/application_1382082435804_0001/**/*.std*
yarnCluster - the yarn clusterapplicationId - the application idfileName - the part of a file nameResourcesIOException - Signals that an I/O exception has occurred.public static List<Resource> queryContainerLogs(YarnCluster yarnCluster, ApplicationId applicationId) throws IOException
fileName
will be *.yarnCluster - the yarn clusterapplicationId - the application idResourcesIOException - Signals that an I/O exception has occurred.queryContainerLogs(YarnCluster, ApplicationId, String)public static String getFileContent(File file) throws Exception
NULL
if file doesn't exist and empty String if file exists but is empty.file - the fileException - the exception if error occurred