Uh oh!
There was an error while loading. Please reload this page.
[SPARK-14678][SQL]Add a file sink log to support versioning and compaction - #12435
Closed
zsxwing wants to merge 7 commits into
Closed
[SPARK-14678][SQL]Add a file sink log to support versioning and compaction#12435zsxwing wants to merge 7 commits into
zsxwing wants to merge 7 commits into
Conversation
SparkQA
commented
Apr 16, 2016
Test build #55977 has finished for PR 12435 at commit
|
zsxwing
commented
Apr 18, 2016
MemberAuthor
| import org.apache.spark.sql.internal.SQLConf | ||
| /** | ||
| * @param path the file path |
Contributor
There was a problem hiding this comment.
nit: Add basic doc string on what this class represents.
tdas
commented
Apr 18, 2016
Contributor
overall looks quite good. just a few nits on naming and docs. |
zsxwing
commented
Apr 18, 2016
MemberAuthor
@tdas FYI, I changed |
SparkQA
commented
Apr 19, 2016
Test build #56150 has finished for PR 12435 at commit
|
| if (isCompactionBatch(batchId, 3)) { | ||
| // Since batchId is a compaction batch, the batch log file should contain all logs | ||
| assert(sinkLog.get(batchId).getOrElse(Nil) === (0 to batchId).map { | ||
| id => SinkFileStatus("/a/b/" + id, 100L, FileStreamSinkLog.ADD_ACTION) |
Contributor
There was a problem hiding this comment.
nit: this and line 147 can be deduped
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR adds a special log for FileStreamSink for two purposes:
FileStreamSinkLog has a new log format instead of Java serialization format. It will write one log file for each batch. The first line of the log file is the version number, and there are multiple JSON lines following. Each JSON line is a JSON format of FileLog.
FileStreamSinkLog will compact log files every "spark.sql.sink.file.log.compactLen" batches into a big file. When doing a compact, it will read all history logs and merge them with the new batch. During the compaction, it will also delete the files that are deleted (marked by FileLog.action). When the reader uses allLogs to list all files, this method only returns the visible files (drops the deleted files).
How was this patch tested?
FileStreamSinkLogSuite