Github user marmbrus commented on a diff in the pull request:
https://github.com/apache/spark/pull/15954#discussion_r90085518
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/streaming/StreamingQueryProgress.scala
---
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.streaming
+
+import java.{util => ju}
+import java.util.UUID
+
+import scala.collection.JavaConverters._
+
+import org.apache.jute.compiler.JLong
+import org.json4s._
+import org.json4s.JsonAST.JValue
+import org.json4s.JsonDSL._
+import org.json4s.jackson.JsonMethods._
+
+import org.apache.spark.annotation.Experimental
+
+/**
+ * :: Experimental ::
+ * Statistics about updates made to a stateful operators in a
[[StreamingQuery]] in a trigger.
+ */
+@Experimental
+class StateOperatorProgress private[sql](
+ val numRowsTotal: Long,
+ val numRowsUpdated: Long) {
+ private[sql] def jsonValue: JValue = {
+ ("numRowsTotal" -> JInt(numRowsTotal)) ~
+ ("numRowsUpdated" -> JInt(numRowsUpdated))
+ }
+}
+
+/**
+ * :: Experimental ::
+ * Used to report statistics about progress that has been made in the
execution of a
+ * [[StreamingQuery]]. Each event relates to processing done for a single
trigger of the streaming
+ * query. Events are emitted even when no new data is available to be
processed.
+ *
+ * @param id A unique id of the query.
+ * @param name Name of the query. This name is unique across all active
queries.
+ * @param timestamp Timestamp (ms) of the beginning of the trigger.
+ * @param batchId A unique id for the current batch of data being
processed. Note that in the
+ * case of retries after a failure a given batchId my be
executed more than once.
+ * Similarly, when there is no data to be processed, the
batchId will not be
+ * incremented.
+ * @param durationMs The amount of time taken to perform various
operations in milliseconds.
+ * @param currentWatermark The current event time watermark in milliseconds
+ * @param stateOperators Information about operators in the query that
store state.
+ * @param sources detailed statistics on data being read from each of the
streaming sources.
+ * @since 2.1.0
+ */
+@Experimental
+class StreamingQueryProgress private[sql](
+ val id: UUID,
+ val name: String,
+ val timestamp: Long,
+ val batchId: Long, // TODO: epoch?
--- End diff --
We probably will not do this `TODO`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]