Uh oh!
There was an error while loading. Please reload this page.
[SPARK-15580][SQL]Add ContinuousQueryInfo to make ContinuousQueryListener events serializable - #13335
[SPARK-15580][SQL]Add ContinuousQueryInfo to make ContinuousQueryListener events serializable#13335zsxwing wants to merge 13 commits into
Conversation
SparkQA
commented
May 26, 2016
Test build #59415 has finished for PR 13335 at commit
|
| """.stripMargin | ||
| } | ||
| private def toInfo: ContinuousQueryInfo = { |
There was a problem hiding this comment.
Do we need to make this a deep copy, especially for sourceStatuses and sinkStatus ?
zsxwing
commented
May 27, 2016
| * A class that contains information about [[ContinuousQuery]]. | ||
| */ | ||
| @Experimental | ||
| case class ContinuousQueryInfo( |
There was a problem hiding this comment.
We should scaladoc these parameters.
There was a problem hiding this comment.
We also probably don't want this to be a case class. The issue is that if we add new parameters in the future, the unapply method will break binary compatibility. The constructor should also be private.
SparkQA
commented
May 27, 2016
Test build #59502 has finished for PR 13335 at commit
|
| asyncTestWaiter { | ||
| assert(startStatus != null, "onQueryTerminated called before onQueryStarted") | ||
| terminationStatus = QueryStatus(queryTerminated.query) | ||
| terminationStatus = queryTerminated.queryInfo |
There was a problem hiding this comment.
Added a test for the exception
marmbrus
commented
May 27, 2016
Can you include the json produced as a sanity check? |
SparkQA
commented
May 27, 2016
Test build #59514 has finished for PR 13335 at commit
|
zsxwing
commented
May 30, 2016
I reverted c24b6b6 as there is a Option serialization bug in jackson-module-scala 2.7.3 (FasterXML/jackson-module-scala#240) |
There was a problem hiding this comment.
Change the type to Array as jackson-module-scala doesn't support Seq[Option[X]]. Probably because of the type erasure.
SparkQA
commented
May 30, 2016
Test build #59608 has finished for PR 13335 at commit
|
zsxwing
commented
May 31, 2016
Removed this one and put it in #13417. Will update this one once #13417 gets merged |
SparkQA
commented
May 31, 2016
Test build #59674 has finished for PR 13335 at commit
|
SparkQA
commented
May 31, 2016
Test build #59685 has finished for PR 13335 at commit
|
| * Wrapper for StreamingListenerEvent as SparkListenerEvent so that it can be posted to Spark | ||
| * listener bus. | ||
| */ | ||
| case class WrappedContinuousQueryListenerEvent( |
There was a problem hiding this comment.
Move it out of ContinuousQueryListenerBus in order to eliminate the reference
There was a problem hiding this comment.
I don't actually understand the structure of all the different even busses, but why do we need a different event type? Why don't all the events just extend SparkListenerEvent?
There was a problem hiding this comment.
Good point. This pattern is from the Streaming events. But that's for binary compatibility. We don't need this pattern in the new APIs.
zsxwing
commented
May 31, 2016
@marmbrus could you take another look, please? |
zsxwing
commented
Jun 1, 2016
@marmbrus addressed |
SparkQA
commented
Jun 1, 2016
Test build #59752 has finished for PR 13335 at commit
|
SparkQA
commented
Jun 1, 2016
Test build #59758 has finished for PR 13335 at commit
|
SparkQA
commented
Jun 1, 2016
Test build #59760 has finished for PR 13335 at commit
|
SparkQA
commented
Jun 1, 2016
Test build #59771 has finished for PR 13335 at commit
|
| class SourceStatus private[sql] ( | ||
| val description: String, | ||
| val offset: Option[Offset]) | ||
| val offset: Option[String]) |
There was a problem hiding this comment.
offset --> offsetDesc, so that it allows us in future to expose actual offsets without the naming being weird.
zsxwing
commented
Jun 6, 2016
@tdas addressed |
| @Experimental | ||
| class ContinuousQueryInfo private[sql]( | ||
| val name: String, | ||
| val sourceStatuses: Seq[SourceStatus], |
There was a problem hiding this comment.
This should also probably be an Array. No need to be a Seq.
There was a problem hiding this comment.
Offline discussion: this is okay. this is how it is for SparkListener, and avoid problems like the array being accidentally modified internally by the listener generator.
tdas
commented
Jun 6, 2016
LGTM. Will merge after tests pass. |
SparkQA
commented
Jun 6, 2016
Test build #60069 has finished for PR 13335 at commit
|
SparkQA
commented
Jun 6, 2016
Test build #60072 has finished for PR 13335 at commit
|
tdas
commented
Jun 7, 2016
Merging this to master and 2.0. Thanks @zsxwing |
…tener events serializable ## What changes were proposed in this pull request? This PR adds ContinuousQueryInfo to make ContinuousQueryListener events serializable in order to support writing events into the event log. ## How was this patch tested? Jenkins unit tests. Author: Shixiong Zhu <shixiong@databricks.com> Closes#13335 from zsxwing/query-info. (cherry picked from commit 0cfd619) Signed-off-by: Tathagata Das <tathagata.das1565@gmail.com>
What changes were proposed in this pull request?
This PR adds ContinuousQueryInfo to make ContinuousQueryListener events serializable in order to support writing events into the event log.
How was this patch tested?
Jenkins unit tests.