You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "rangadi (via GitHub)" <gi...@apache.org> on 2023/04/26 21:19:16 UTC
[GitHub] [spark] rangadi commented on a diff in pull request #40968: [SPARK-43143] [SS] [CONNECT] Scala StreamingQuery awaitTermination()
rangadi commented on code in PR #40968:
URL: https://github.com/apache/spark/pull/40968#discussion_r1178408626
##########
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/streaming/StreamingQuery.scala:
##########
@@ -159,6 +185,21 @@ class RemoteStreamingQuery(
executeQueryCmd(_.setStatus(true)).getStatus.getIsActive
}
+ override def awaitTermination(): Unit = {
+ val awaitTerminationCmd = StreamingQueryCommand.AwaitTerminationCommand
+ .newBuilder()
+ .build()
+ executeQueryCmd(_.setAwaitTermination(awaitTerminationCmd))
+ }
+
+ override def awaitTermination(timeoutMs: Long): Boolean = {
+ val awaitTerminationCmd = StreamingQueryCommand.AwaitTerminationCommand
Review Comment:
This can simpler:
executeQueryCmd(_.getAwaitTerminationBuilder.setTimeoutMs(timeout)). getAwaitTermination.getTerminated
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org