您当前的位置: 首页 >  段智华 Java

org.apache.spark.examples.streaming.StreamingExamples Scala 版本 无Java版本

段智华 发布时间:2016-04-23 08:55:57 ,浏览量:3

org.apache.spark.examples.streaming.StreamingExamples  Scala 版本 无Java版本

这个模块就设置了日志级别,在org.apache.spark.examples.streaming中注释掉

//StreamingExamples.setStreamingLogLevels(); 避免编译提示出错

 

import org.apache.spark.examples.streaming.StreamingExamples;


package org.apache.spark.examples.streaming

import org.apache.log4j.{Level, Logger}

import org.apache.spark.internal.Logging

/** Utility functions for Spark Streaming examples. */
object StreamingExamples extends Logging {

  /** Set reasonable logging levels for streaming if the user has not configured log4j. */
  def setStreamingLogLevels() {
    val log4jInitialized = Logger.getRootLogger.getAllAppenders.hasMoreElements
    if (!log4jInitialized) {
      // We first log something to initialize Spark's default logging, then we override the
      // logging level.
      logInfo("Setting log level to [WARN] for streaming example." +
        " To override add a custom log4j.properties to the classpath.")
      Logger.getRootLogger.setLevel(Level.WARN)
    }
  }
}

 

关注
打赏
查看更多评论

段智华

暂无认证

  • 3浏览

    0关注

    1232博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录