You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by squito <gi...@git.apache.org> on 2017/11/03 16:50:32 UTC
[GitHub] spark pull request #19582: [SPARK-20644][core] Initial ground work for kvsto...
Github user squito commented on a diff in the pull request:
https://github.com/apache/spark/pull/19582#discussion_r148713957
--- Diff: core/src/main/scala/org/apache/spark/status/AppStatusListener.scala ---
@@ -528,4 +544,21 @@ private class AppStatusListener(kvstore: KVStore) extends SparkListener with Log
entity.write(kvstore)
}
+ /** Update a live entity only if it hasn't been updated in the last configured period. */
+ private def maybeUpdate(entity: LiveEntity): Unit = {
+ if (liveUpdatePeriodNs >= 0) {
+ val now = System.nanoTime()
--- End diff --
`System.nanoTime()` can be somewhat expensive, right? there are a few places you are calling this repeatedly, might as well call `nanoTime()` once outside of this method and pass it in.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org