Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,13 @@ private[spark] class MetricsSystem private (

metricsConfig.initialize()

def start() {
def start(registerStaticSources: Boolean = true) {
require(!running, "Attempting to start a MetricsSystem that is already running")
running = true
StaticSources.allSources.foreach(registerSource)
registerSources()
if (registerStaticSources) {
StaticSources.allSources.foreach(registerSource)
registerSources()
}
registerSinks()
sinks.foreach(_.start)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,8 @@ private[spark] class ApplicationMaster(args: ApplicationMasterArguments) extends
val ms = MetricsSystem.createMetricsSystem("applicationMaster", sparkConf, securityMgr)
val prefix = _sparkConf.get(YARN_METRICS_NAMESPACE).getOrElse(appId)
ms.registerSource(new ApplicationMasterSource(prefix, allocator))
ms.start()
// do not register static sources in this case as per SPARK-25277
ms.start(false)
metricsSystem = Some(ms)
reporterThread = launchReporterThread()
}
Expand Down