-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-11373] [CORE] Add metrics to the History Server and FsHistoryProvider #9571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8267974
0825756
9e63bcf
a658769
f02323f
dbde3ab
59a4a67
4c30404
ee74f81
a3a6383
e936d5b
cef1577
4bf9d13
818e14b
bfea17f
b01facd
a956243
50727e7
012cf92
1e59b68
ec1f2d7
8903dcf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,11 +17,14 @@ | |
|
|
||
| package org.apache.spark.deploy.history | ||
|
|
||
| import java.util.concurrent.atomic.AtomicBoolean | ||
| import java.util.zip.ZipOutputStream | ||
|
|
||
| import scala.xml.Node | ||
|
|
||
| import org.apache.spark.SparkException | ||
| import org.apache.spark.{SparkException, SparkFirehoseListener} | ||
| import org.apache.spark.metrics.source.Source | ||
| import org.apache.spark.scheduler._ | ||
| import org.apache.spark.ui.SparkUI | ||
|
|
||
| private[spark] case class ApplicationAttemptInfo( | ||
|
|
@@ -74,6 +77,8 @@ private[history] case class LoadedAppUI( | |
|
|
||
| private[history] abstract class ApplicationHistoryProvider { | ||
|
|
||
| private val started = new AtomicBoolean(false) | ||
|
|
||
| /** | ||
| * Returns the count of application event logs that the provider is currently still processing. | ||
| * History Server UI can use this to indicate to a user that the application listing on the UI | ||
|
|
@@ -98,6 +103,19 @@ private[history] abstract class ApplicationHistoryProvider { | |
| return 0; | ||
| } | ||
|
|
||
| /** | ||
| * Bind to the History Server: threads should be started here; exceptions may be raised | ||
| * Start the provider: threads should be started here; exceptions may be raised | ||
| * if the history provider cannot be started. | ||
| * The base implementation contains a re-entrancy check and should | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This makes this interface awkward. Why can't the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All the work on Yarn service model, and that of SmartFrog before it, have given me a fear of startup logic. I'll see about doing it there though. Anyway, cut: if problems arise, people can restate it. This patch does change HistoryServer such that One thing to consider here is that really the |
||
| * be invoked first. | ||
| * @return the metric information for registration | ||
| */ | ||
| def start(): Option[Source] = { | ||
| require(!started.getAndSet(true), "History provider already started") | ||
| None | ||
| } | ||
|
|
||
| /** | ||
| * Returns a list of applications available for the history server to show. | ||
| * | ||
|
|
@@ -145,3 +163,15 @@ private[history] abstract class ApplicationHistoryProvider { | |
| */ | ||
| def getEmptyListingHtml(): Seq[Node] = Seq.empty | ||
| } | ||
|
|
||
| /** | ||
| * A simple counter of events. | ||
| * There is no concurrency support here: all events must come in sequentially. | ||
| */ | ||
| private[history] class EventCountListener extends SparkFirehoseListener { | ||
| var eventCount = 0L | ||
|
|
||
| override def onEvent(event: SparkListenerEvent): Unit = { | ||
| eventCount += 1 | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is declaring the type useful here in some way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either I was just being explicit about what came in, or the IDE decided to get involved. Removed