Github user tianyi commented on a diff in the pull request:
https://github.com/apache/spark/pull/6148#discussion_r30478828
--- Diff:
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala
---
@@ -135,11 +141,15 @@ private[ui] class ThriftServerPage(parent:
ThriftServerTab) extends WebUIPage(""
}
/** Generate stats of batch sessions of the thrift server program */
- private def generateSessionStatsTable(): Seq[Node] = {
- val numBatches = listener.sessionList.size
+ private def generateSessionStatsTable(online: Boolean): Seq[Node] = {
+ val numBatches = if(online) listener.onlineSessionNum else
(listener.sessionList.size-listener.onlineSessionNum)
val table = if (numBatches > 0) {
- val dataRows =
- listener.sessionList.values
+ val dataRowsTmp = listener.sessionList.values.toSeq
+ val dataRows = if(online) {
+ dataRowsTmp.filter(_.finishTimestamp ==
0).sortBy(_.startTimestamp).reverse
--- End diff --
You don't need to sort by the `startTimestamp` because the list is a
`LinkedHashMap`
---
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]