Github user squito commented on a diff in the pull request:
https://github.com/apache/spark/pull/6935#discussion_r47574667
--- Diff:
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala ---
@@ -678,6 +826,52 @@ private[history] class FsHistoryProvider(conf:
SparkConf, clock: Clock)
method.invoke(dfs, action).asInstanceOf[Boolean]
}
+ /**
+ * String description for diagnostics
+ * @return a summary of the component state
+ */
+ override def toString: String = {
+ val header = s"""
+ | FsHistoryProvider: logdir=$logDir,
+ | last scan time=$lastScanTime
+ | Cached application count =${applications.size}}
+ """.stripMargin
+ val sb = new StringBuilder(header)
+ applications.foreach(entry => sb.append(entry._2).append("\n"))
+ sb.toString
+ }
+
+ /**
+ * Probe for an update to an (incompleted) application.
+ *
+ * @param appId application ID
+ * @param attemptId optional attempt ID
+ * @param state an [[FsHistoryProviderUpdateState]] instance
+ * @return true if the attempt has been updated.
+ */
+ override def isUpdated(
+ appId: String,
+ attemptId: Option[String],
+ state: Option[HistoryProviderUpdateState]): Boolean = {
+ val updateState = state.get.asInstanceOf[FsHistoryProviderUpdateState]
--- End diff --
I still don't love this. I haven't taken a look at the integration w/ the
ATS yet, but I feel that (a) as far as this pr is concerned, you could just
change the type of `state` to be `FsHistoryProviderUpdateState` directly (or
perhaps eliminate that abstraction completely and just make it the
attemptCounter / filesize). you can always add this when you need it, since its
not buying us anything here. and (b) instanceOf is a code smell ... if we
really want it, we should use generics. at the very least, I'd add a comment
that we know the type of `state` because it originally came from this provider,
and is just making its way back to the same fshistoryprovider.
---
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]