Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
735eca6
Split MemoryEntry into two separate classes (serialized and deseriali…
JoshRosen Mar 15, 2016
8f08289
Add ChunkedByteBuffer and use it in storage layer.
JoshRosen Mar 15, 2016
79b1a6a
Add test cases and fix bug in ChunkedByteBuffer.toInputStream()
JoshRosen Mar 15, 2016
7dbcd5a
WIP towards understanding destruction.
JoshRosen Mar 15, 2016
3fbec21
Small fixes to dispose behavior.
JoshRosen Mar 15, 2016
e5e663f
Modify BlockManager.dataSerialize to write ChunkedByteBuffers.
JoshRosen Mar 15, 2016
de62f0d
Merge remote-tracking branch 'origin/master' into chunked-block-seria…
JoshRosen Mar 16, 2016
0a347fd
Fix test compilation in streaming.
JoshRosen Mar 16, 2016
6852c48
Merge remote-tracking branch 'origin/master' into chunked-block-seria…
JoshRosen Mar 16, 2016
43f8fa6
Allow ChunkedByteBuffer to contain no chunks.
JoshRosen Mar 16, 2016
25e6884
Document toByteBuffer() and toArray() size limitations.
JoshRosen Mar 16, 2016
325c83d
Move dispose() from BlockManager to StorageUtils.
JoshRosen Mar 16, 2016
4f5074e
Better documentation for dispose() methods.
JoshRosen Mar 16, 2016
b6ddf3e
Rename limit to size.
JoshRosen Mar 16, 2016
719ad3c
Implement missing InputStream methods.
JoshRosen Mar 16, 2016
2300607
More comments.
JoshRosen Mar 16, 2016
3fc0b66
Fix confusing getChunks().head
JoshRosen Mar 16, 2016
c747c85
Merge remote-tracking branch 'origin/master' into chunked-block-seria…
JoshRosen Mar 17, 2016
cb9311b
Fix logging import.
JoshRosen Mar 17, 2016
2970932
Clean up dispose logic to address review comments.
JoshRosen Mar 18, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Better documentation for dispose() methods.
  • Loading branch information
JoshRosen committed Mar 16, 2016
commit 4f5074ece49030a6e7134f7ece706ed441c02ee4
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ private[spark] class ChunkedByteBuffer(var chunks: Array[ByteBuffer]) {
}
}

/**
* Creates an input stream to read data from this ChunkedByteBuffer.
* @param dispose if true, [[dispose()]] will be called at the end of the stream
* in order to close any memory-mapped files which back this buffer.
*/
def toInputStream(dispose: Boolean = false): InputStream = {
new ChunkedByteBufferInputStream(this, dispose)
}
Expand Down Expand Up @@ -110,8 +115,10 @@ private[spark] class ChunkedByteBuffer(var chunks: Array[ByteBuffer]) {
}

/**
* Reads data from a ChunkedByteBuffer, and optionally cleans it up using StorageUtils.dispose()
* at the end of the stream (e.g. to close a memory-mapped file).
* Reads data from a ChunkedByteBuffer.
*
* @param dispose if true, [[ChunkedByteBuffer.dispose()]] will be called at the end of the stream
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be weird. When is it only checked on close() but not read?

* in order to close any memory-mapped files which back the buffer.
*/
private class ChunkedByteBufferInputStream(
var chunkedByteBuffer: ChunkedByteBuffer,
Expand Down