Github user tdas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15285#discussion_r83914169
  
    --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
    @@ -1452,52 +1452,54 @@ private[spark] object Utils extends Logging {
         CallSite(shortForm, longForm)
       }
     
    -  val UNCOMPRESSED_LOG_FILE_LENGTH_CACHE_SIZE = 
"spark.worker.ui.compressedLogFileLengthCacheSize"
    -  val DEFAULT_UNCOMPRESSED_LOG_FILE_LENGTH_CACHE_SIZE = 100
    +  private val UNCOMPRESSED_LOG_FILE_LENGTH_CACHE_SIZE_CONF =
    +    "spark.worker.ui.compressedLogFileLengthCacheSize"
    +  private val DEFAULT_UNCOMPRESSED_LOG_FILE_LENGTH_CACHE_SIZE = 100
       private var compressedLogFileLengthCache: LoadingCache[String, 
java.lang.Long] = null
       private def getCompressedLogFileLengthCache(
           sparkConf: SparkConf): LoadingCache[String, java.lang.Long] = 
this.synchronized {
         if (compressedLogFileLengthCache == null) {
           val compressedLogFileLengthCacheSize = sparkConf.getInt(
    -        UNCOMPRESSED_LOG_FILE_LENGTH_CACHE_SIZE,
    +        UNCOMPRESSED_LOG_FILE_LENGTH_CACHE_SIZE_CONF,
             DEFAULT_UNCOMPRESSED_LOG_FILE_LENGTH_CACHE_SIZE)
           compressedLogFileLengthCache = CacheBuilder.newBuilder()
             .maximumSize(compressedLogFileLengthCacheSize)
             .build[String, java.lang.Long](new CacheLoader[String, 
java.lang.Long]() {
             override def load(path: String): java.lang.Long = {
    -          Utils.getFileLength(new File(path))
    +          Utils.getCompressedFileLength(new File(path))
             }
           })
         }
         compressedLogFileLengthCache
       }
     
    -  def getFileLength(file: File, sparkConf: SparkConf): Long = {
    +  /**
    +   * Return the file length, if the file is compressed it returns the 
uncompressed file length.
    +   * It also caches the uncompressed file size to avoid repeated 
decompression. The cache size is
    +   * read from workerConf.
    +   * */
    --- End diff --
    
    nit: doc style incorrect


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to