Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/19751#discussion_r156813342
--- Diff: core/src/main/scala/org/apache/spark/status/KVUtils.scala ---
@@ -68,6 +69,19 @@ private[spark] object KVUtils extends Logging {
db
}
+ /** Turns a KVStoreView into a Scala sequence, applying a filter. */
+ def viewToSeq[T](
--- End diff --
I create a list explicitly to avoid consistency issues when deleting these
elements. If I had an iterator instead, and I then called `kvstore.delete`, you
could get a `ConcurrentModificationException`.
Since the cleanup code deletes more than necessary to just respect the
limit (to avoid having to do this every time you write something), hopefully
the cost is amortized a little.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]