spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JoshRosen <...@git.apache.org>
Subject [GitHub] spark pull request: SPARK-7896. Allow ChainedBuffer to store more ...
Date Wed, 27 May 2015 19:06:38 GMT
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6440#discussion_r31168867
  
    --- Diff: core/src/main/scala/org/apache/spark/util/collection/ChainedBuffer.scala ---
    @@ -41,13 +41,13 @@ private[spark] class ChainedBuffer(chunkSize: Int) {
        * @param os OutputStream to read into.
        * @param len Number of bytes to read.
        */
    -  def read(pos: Int, os: OutputStream, len: Int): Unit = {
    +  def read(pos: Long, os: OutputStream, len: Int): Unit = {
         if (pos + len > _size) {
           throw new IndexOutOfBoundsException(
             s"Read of $len bytes at position $pos would go past size ${_size} of buffer")
         }
    -    var chunkIndex = pos >> chunkSizeLog2
    -    var posInChunk = pos - (chunkIndex << chunkSizeLog2)
    +    var chunkIndex = (pos >> chunkSizeLog2).toInt
    --- End diff --
    
    Can you add explicit types for every numeric variable in this file?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message