Class LogsCLI

java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.yarn.client.cli.LogsCLI
All Implemented Interfaces:
Configurable, Tool

@Public @Evolving public class LogsCLI extends Configured implements Tool
  • Field Details

  • Constructor Details

    • LogsCLI

      public LogsCLI()
  • Method Details

    • run

      public int run(String[] args) throws Exception
      Description copied from interface: Tool
      Execute the command with the given arguments.
      Specified by:
      run in interface Tool
      Parameters:
      args - command specific arguments.
      Returns:
      exit code.
      Throws:
      Exception - command exception.
    • createYarnClient

      @VisibleForTesting protected YarnClient createYarnClient()
    • main

      public static void main(String[] args) throws Exception
      Throws:
      Exception
    • getAMContainerInfoForRMWebService

      protected List<org.codehaus.jettison.json.JSONObject> getAMContainerInfoForRMWebService(Configuration conf, String appId) throws Exception
      Throws:
      Exception
    • printContainerLogsFromRunningApplication

      @Private @VisibleForTesting public int printContainerLogsFromRunningApplication(Configuration conf, org.apache.hadoop.yarn.logaggregation.ContainerLogsRequest request, org.apache.hadoop.yarn.logaggregation.LogCLIHelpers logCliHelper, boolean useRegex, boolean ignoreSizeLimit) throws IOException
      Throws:
      IOException
    • getContainerReport

      @Private @VisibleForTesting public ContainerReport getContainerReport(String containerIdStr) throws YarnException, IOException
      Throws:
      YarnException
      IOException
    • getClientResponseFromTimelineReader

      protected javax.ws.rs.core.Response getClientResponseFromTimelineReader(Configuration conf, String appId) throws IOException
      Throws:
      IOException
    • getMatchedContainerLogFiles

      @VisibleForTesting public Set<String> getMatchedContainerLogFiles(org.apache.hadoop.yarn.logaggregation.ContainerLogsRequest request, boolean useRegex, boolean ignoreSizeLimit) throws IOException
      Throws:
      IOException
    • getResponseFromNMWebService

      @VisibleForTesting public javax.ws.rs.core.Response getResponseFromNMWebService(Configuration conf, javax.ws.rs.client.Client webServiceClient, org.apache.hadoop.yarn.logaggregation.ContainerLogsRequest request, String logFile)
    • getNodeHttpAddressFromRMWebString

      @VisibleForTesting public String getNodeHttpAddressFromRMWebString(org.apache.hadoop.yarn.logaggregation.ContainerLogsRequest request) throws javax.ws.rs.ProcessingException, IllegalStateException, org.codehaus.jettison.json.JSONException
      Throws:
      javax.ws.rs.ProcessingException
      IllegalStateException
      org.codehaus.jettison.json.JSONException
    • getMatchedOptionForRunningApp

      @Private @VisibleForTesting public org.apache.hadoop.yarn.logaggregation.ContainerLogsRequest getMatchedOptionForRunningApp(org.apache.hadoop.yarn.logaggregation.ContainerLogsRequest container, boolean useRegex, boolean ignoreSizeLimit) throws IOException
      Throws:
      IOException
    • getMatchedLogTypesForRunningApp

      @Private @VisibleForTesting public Map<String,org.apache.hadoop.yarn.logaggregation.ContainerLogsRequest> getMatchedLogTypesForRunningApp(List<org.apache.hadoop.yarn.logaggregation.ContainerLogsRequest> containerLogRequests, boolean useRegex, boolean ignoreSizeLimit)