Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 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 @@ -114,6 +114,8 @@ private[history] abstract class ApplicationHistoryProvider {
*/
def stop(): Unit = { }

def start(): Unit = { }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit. Could you add a function description like def stop()?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks!


/**
* Returns configuration data to be shown in the History Server home page.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock: Clock)
}
}

val initThread = initialize()
var initThread: Thread = null

private[history] def initialize(): Thread = {
if (!isFsInSafeMode()) {
Expand Down Expand Up @@ -384,6 +384,10 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock: Clock)
Map("Event log directory" -> logDir.toString) ++ safeMode
}

override def start(): Unit = {
initThread = initialize()
}

override def stop(): Unit = {
try {
if (initThread != null && initThread.isAlive()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ object HistoryServer extends Logging {

val server = new HistoryServer(conf, provider, securityManager, port)
server.bind()
provider.start()

ShutdownHookManager.addShutdownHook { () => server.stop() }

Expand Down