-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-19520][streaming] Do not encrypt data written to the WAL. #16862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,7 +27,7 @@ import org.apache.spark._ | |
| import org.apache.spark.rdd.BlockRDD | ||
| import org.apache.spark.storage.{BlockId, StorageLevel} | ||
| import org.apache.spark.streaming.util._ | ||
| import org.apache.spark.util.SerializableConfiguration | ||
| import org.apache.spark.util._ | ||
| import org.apache.spark.util.io.ChunkedByteBuffer | ||
|
|
||
| /** | ||
|
|
@@ -158,13 +158,16 @@ class WriteAheadLogBackedBlockRDD[T: ClassTag]( | |
| logInfo(s"Read partition data of $this from write ahead log, record handle " + | ||
| partition.walRecordHandle) | ||
| if (storeInBlockManager) { | ||
| blockManager.putBytes(blockId, new ChunkedByteBuffer(dataRead.duplicate()), storageLevel) | ||
| blockManager.putBytes(blockId, new ChunkedByteBuffer(dataRead.duplicate()), storageLevel, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is explained in the summary. The code that uses
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it |
||
| encrypt = true) | ||
| logDebug(s"Stored partition data of $this into block manager with level $storageLevel") | ||
| dataRead.rewind() | ||
| } | ||
| serializerManager | ||
| .dataDeserializeStream( | ||
| blockId, new ChunkedByteBuffer(dataRead).toInputStream())(elementClassTag) | ||
| blockId, | ||
| new ChunkedByteBuffer(dataRead).toInputStream(), | ||
| maybeEncrypted = false)(elementClassTag) | ||
| .asInstanceOf[Iterator[T]] | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its worth documenting this param. At first I was going to suggest that it should be called
allowEncryptionlike the other one, but I realize its more complicated than that. Maybe something likeIf true, the given bytes should be encrypted before they are stored. Note that in most cases, the given bytes will already be encrypted if encryption is on. An important exception to this is with the streaming WAL. Since the WAL does not support encryption, those bytes are generated un-encrypted. But we still encrypt those bytes before storing in the block manager.
Maybe too wordy but I think its worth documenting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1