[jira] [Updated] (SPARK-19829) The log about driver should support rolling like executor

2017-03-06 Thread Sean Owen (JIRA)

 [ 
https://issues.apache.org/jira/browse/SPARK-19829?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sean Owen updated SPARK-19829:
--
  Priority: Minor  (was: Major)
Issue Type: Improvement  (was: New Feature)

Usually this is handled by systems like YARN, if you need this to be done. Or 
you can manage logs via log4j configuration. I don't think Spark build its own 
rolling.

> The log about driver should support rolling like executor
> -
>
> Key: SPARK-19829
> URL: https://issues.apache.org/jira/browse/SPARK-19829
> Project: Spark
>  Issue Type: Improvement
>  Components: Spark Core
>Affects Versions: 3.0.0
>Reporter: hustfxj
>Priority: Minor
>
> We should rollback the log of the driver , or the log maybe large!!! 
> {code:title=DriverRunner.java|borderStyle=solid}
> // modify the runDriver
>   private def runDriver(builder: ProcessBuilder, baseDir: File, supervise: 
> Boolean): Int = {
> builder.directory(baseDir)
> def initialize(process: Process): Unit = {
>   // Redirect stdout and stderr to files-- the old code
> //  val stdout = new File(baseDir, "stdout")
> //  CommandUtils.redirectStream(process.getInputStream, stdout)
> //
> //  val stderr = new File(baseDir, "stderr")
> //  val formattedCommand = builder.command.asScala.mkString("\"", "\" 
> \"", "\"")
> //  val header = "Launch Command: %s\n%s\n\n".format(formattedCommand, 
> "=" * 40)
> //  Files.append(header, stderr, StandardCharsets.UTF_8)
> //  CommandUtils.redirectStream(process.getErrorStream, stderr)
>   // Redirect its stdout and stderr to files-support rolling
>   val stdout = new File(baseDir, "stdout")
>   stdoutAppender = FileAppender(process.getInputStream, stdout, conf)
>   val stderr = new File(baseDir, "stderr")
>   val formattedCommand = builder.command.asScala.mkString("\"", "\" \"", 
> "\"")
>   val header = "Launch Command: %s\n%s\n\n".format(formattedCommand, "=" 
> * 40)
>   Files.append(header, stderr, StandardCharsets.UTF_8)
>   stderrAppender = FileAppender(process.getErrorStream, stderr, conf)
> }
> runCommandWithRetry(ProcessBuilderLike(builder), initialize, supervise)
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Updated] (SPARK-19829) The log about driver should support rolling like executor

2017-03-05 Thread hustfxj (JIRA)

 [ 
https://issues.apache.org/jira/browse/SPARK-19829?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

hustfxj updated SPARK-19829:

Description: 
We should rollback the log of the driver , or the log maybe large!!! 

{code:title=DriverRunner.java|borderStyle=solid}
// modify the runDriver
  private def runDriver(builder: ProcessBuilder, baseDir: File, supervise: 
Boolean): Int = {
builder.directory(baseDir)
def initialize(process: Process): Unit = {
  // Redirect stdout and stderr to files-- the old code
//  val stdout = new File(baseDir, "stdout")
//  CommandUtils.redirectStream(process.getInputStream, stdout)
//
//  val stderr = new File(baseDir, "stderr")
//  val formattedCommand = builder.command.asScala.mkString("\"", "\" \"", 
"\"")
//  val header = "Launch Command: %s\n%s\n\n".format(formattedCommand, "=" 
* 40)
//  Files.append(header, stderr, StandardCharsets.UTF_8)
//  CommandUtils.redirectStream(process.getErrorStream, stderr)

  // Redirect its stdout and stderr to files-support rolling
  val stdout = new File(baseDir, "stdout")
  stdoutAppender = FileAppender(process.getInputStream, stdout, conf)
  val stderr = new File(baseDir, "stderr")
  val formattedCommand = builder.command.asScala.mkString("\"", "\" \"", 
"\"")
  val header = "Launch Command: %s\n%s\n\n".format(formattedCommand, "=" * 
40)
  Files.append(header, stderr, StandardCharsets.UTF_8)
  stderrAppender = FileAppender(process.getErrorStream, stderr, conf)
}
runCommandWithRetry(ProcessBuilderLike(builder), initialize, supervise)
  }
{code}



  was:
We should rollback the log of the driver , or the log maybe large!!! 

{code:title=Bar.java|borderStyle=solid}
// modify the runDriver
  private def runDriver(builder: ProcessBuilder, baseDir: File, supervise: 
Boolean): Int = {
builder.directory(baseDir)
def initialize(process: Process): Unit = {
  // Redirect stdout and stderr to files-- the old code
//  val stdout = new File(baseDir, "stdout")
//  CommandUtils.redirectStream(process.getInputStream, stdout)
//
//  val stderr = new File(baseDir, "stderr")
//  val formattedCommand = builder.command.asScala.mkString("\"", "\" \"", 
"\"")
//  val header = "Launch Command: %s\n%s\n\n".format(formattedCommand, "=" 
* 40)
//  Files.append(header, stderr, StandardCharsets.UTF_8)
//  CommandUtils.redirectStream(process.getErrorStream, stderr)

  // Redirect its stdout and stderr to files-support rolling
  val stdout = new File(baseDir, "stdout")
  stdoutAppender = FileAppender(process.getInputStream, stdout, conf)
  val stderr = new File(baseDir, "stderr")
  val formattedCommand = builder.command.asScala.mkString("\"", "\" \"", 
"\"")
  val header = "Launch Command: %s\n%s\n\n".format(formattedCommand, "=" * 
40)
  Files.append(header, stderr, StandardCharsets.UTF_8)
  stderrAppender = FileAppender(process.getErrorStream, stderr, conf)
}
runCommandWithRetry(ProcessBuilderLike(builder), initialize, supervise)
  }
{code}




> The log about driver should support rolling like executor
> -
>
> Key: SPARK-19829
> URL: https://issues.apache.org/jira/browse/SPARK-19829
> Project: Spark
>  Issue Type: New Feature
>  Components: Spark Core
>Affects Versions: 3.0.0
>Reporter: hustfxj
>
> We should rollback the log of the driver , or the log maybe large!!! 
> {code:title=DriverRunner.java|borderStyle=solid}
> // modify the runDriver
>   private def runDriver(builder: ProcessBuilder, baseDir: File, supervise: 
> Boolean): Int = {
> builder.directory(baseDir)
> def initialize(process: Process): Unit = {
>   // Redirect stdout and stderr to files-- the old code
> //  val stdout = new File(baseDir, "stdout")
> //  CommandUtils.redirectStream(process.getInputStream, stdout)
> //
> //  val stderr = new File(baseDir, "stderr")
> //  val formattedCommand = builder.command.asScala.mkString("\"", "\" 
> \"", "\"")
> //  val header = "Launch Command: %s\n%s\n\n".format(formattedCommand, 
> "=" * 40)
> //  Files.append(header, stderr, StandardCharsets.UTF_8)
> //  CommandUtils.redirectStream(process.getErrorStream, stderr)
>   // Redirect its stdout and stderr to files-support rolling
>   val stdout = new File(baseDir, "stdout")
>   stdoutAppender = FileAppender(process.getInputStream, stdout, conf)
>   val stderr = new File(baseDir, "stderr")
>   val formattedCommand = builder.command.asScala.mkString("\"", "\" \"", 
> "\"")
>   val header = "Launch Command: %s\n%s\n\n".format(formattedCommand, "=" 
> * 40)
>   Files.append(header, stderr, StandardCharsets.UTF_8)
>   stderrAppender = FileAppender(process.getErrorSt