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

    https://github.com/apache/spark/pull/1241#discussion_r16759331
  
    --- Diff: core/src/main/scala/org/apache/spark/storage/DiskStore.scala ---
    @@ -89,25 +89,33 @@ private[spark] class DiskStore(blockManager: 
BlockManager, diskManager: DiskBloc
         }
       }
     
    -  override def getBytes(blockId: BlockId): Option[ByteBuffer] = {
    -    val segment = diskManager.getBlockLocation(blockId)
    -    val channel = new RandomAccessFile(segment.file, "r").getChannel
    +  private def getBytes(file: File, offset: Long, length: Long): 
Option[ByteBuffer] = {
    +    val channel = new RandomAccessFile(file, "r").getChannel
     
         try {
           // For small files, directly read rather than memory map
    -      if (segment.length < minMemoryMapBytes) {
    -        val buf = ByteBuffer.allocate(segment.length.toInt)
    -        channel.read(buf, segment.offset)
    +      if (file.length < minMemoryMapBytes) {
    --- End diff --
    
    I think u want  length instead of file.length here


---
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