Github user tdas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15307#discussion_r82348471
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/streaming/StreamingQueryStatus.scala
 ---
    @@ -0,0 +1,102 @@
    +/*
    + * 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 scala.collection.JavaConverters._
    +
    +import org.apache.spark.annotation.Experimental
    +
    +/**
    + * :: Experimental ::
    + * A class used to report information about the progress of a 
[[StreamingQuery]].
    + *
    + * @param name The query name. This name is unique across all active 
queries.
    + * @param id The query id. This id is unique across
    + *          all queries that have been started in the current process.
    + * @param timestamp Timestamp (ms) of when this query was generated
    + * @param inputRate Current rate (rows/sec) at which data is being 
generated by all the sources
    + * @param processingRate Current rate (rows/sec) at which the query is 
processing data from
    + *                       all the sources
    + * @param latency  Current average latency between the data being 
available in source and the sink
    + *                   writing the corresponding output
    + * @param sourceStatuses Current statuses of the sources.
    + * @param sinkStatus Current status of the sink.
    + * @param triggerStatus Low-level detailed status of the last 
completed/currently active trigger
    + * @since 2.0.0
    + */
    +@Experimental
    +class StreamingQueryStatus private(
    +  val name: String,
    +  val id: Long,
    +  val timestamp: Long,
    +  val inputRate: Double,
    +  val processingRate: Double,
    +  val latency: Option[Double],
    +  val sourceStatuses: Array[SourceStatus],
    +  val sinkStatus: SinkStatus,
    +  val triggerStatus: ju.Map[String, String]) {
    +
    +  import StreamingQueryStatus._
    +
    +  override def toString: String = {
    --- End diff --
    
    This will pretty print the status as 
    ```
    StreamingQueryStatus:
        Query name: query-0
        Query id: 0
        Status timestamp: 600
        Input rate: 0.0 rows/sec
        Processing rate 3.3333333333333335 rows/sec
        Latency: 600.0 ms
        Trigger status:
            isActive: false
            isDataAvailable: true
            latency.fullTrigger: 600
            latency.getBatch: 200
            latency.getOffset: 100
            latency.offsetLogWrite: 0
            numRows.input.total: 2
            numRows.output: 0
            numRows.state.aggregation1.total: 1
            numRows.state.aggregation1.updated: 1
            statusMessage:
            timestamp.afterGetBatch: 300
            timestamp.afterGetOffset: 100
            timestamp.triggerFinish: 600
            timestamp.triggerStart: 0
            triggerId: 0
        Source statuses [1 source]:
            Source 1:    MemoryStream[value#1]
                Available offset: #0
                Input rate: 0.0 rows/sec
                Processing rate: 3.3333333333333335 rows/sec
                Trigger status:
                    latency.sourceGetBatch: 200
                    latency.sourceGetOffset: 100
                    numRows.input.source: 2
                    triggerId: 0
        Sink status:     MemorySink
            Committed offsets: [#0]
    ```


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to