Skip to content

Commit

Permalink
revert changes that had HistoryServer refresh the application listing…
Browse files Browse the repository at this point in the history
… more often
  • Loading branch information
squito committed Apr 8, 2015
1 parent b136e39 commit d2ef58d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private[history] abstract class ApplicationHistoryProvider {
*
* @return List of all know applications.
*/
def getListing(refresh: Boolean): Iterable[ApplicationHistoryInfo]
def getListing(): Iterable[ApplicationHistoryInfo]

/**
* Returns the Spark UI for a specific application.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private[history] class FsHistoryProvider(conf: SparkConf) extends ApplicationHis
}
}

override def getListing(refresh: Boolean): Iterable[FsApplicationHistoryInfo] = {
override def getListing(): Iterable[FsApplicationHistoryInfo] = {
applications.values
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private[history] class HistoryPage(parent: HistoryServer) extends WebUIPage("")
val requestedIncomplete =
Option(request.getParameter("showIncomplete")).getOrElse("false").toBoolean

val allApps = parent.getApplicationList(false).filter(_.completed != requestedIncomplete)
val allApps = parent.getApplicationList().filter(_.completed != requestedIncomplete)
val actualFirst = if (requestedFirst < allApps.size) requestedFirst else 0
val apps = allApps.slice(actualFirst, Math.min(actualFirst + pageSize, allApps.size))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,12 @@ class HistoryServer(
*
* @return List of all known applications.
*/
def getApplicationList(refresh: Boolean): Iterable[ApplicationHistoryInfo] = {
provider.getListing(refresh)
def getApplicationList(): Iterable[ApplicationHistoryInfo] = {
provider.getListing()
}

def getApplicationInfoList: Seq[ApplicationInfo] = {
getApplicationList(true).map { ApplicationsListResource.appHistoryInfoToPublicAppInfo }.toSeq
getApplicationList().map { ApplicationsListResource.appHistoryInfoToPublicAppInfo }.toSeq
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class FsHistoryProviderSuite extends FunSuite with BeforeAndAfter with Matchers
// Take the opportunity to check that the offset checks work as expected.
provider.checkForLogs()

val list = provider.getListing(false).toSeq
val list = provider.getListing().toSeq
list should not be (null)
list.size should be (5)
list.count(_.completed) should be (3)
Expand Down Expand Up @@ -174,7 +174,7 @@ class FsHistoryProviderSuite extends FunSuite with BeforeAndAfter with Matchers
val provider = new FsHistoryProvider(createTestConf())
provider.checkForLogs()

val list = provider.getListing(false).toSeq
val list = provider.getListing().toSeq
list should not be (null)
list.size should be (1)
}
Expand All @@ -188,13 +188,13 @@ class FsHistoryProviderSuite extends FunSuite with BeforeAndAfter with Matchers
SparkListenerApplicationEnd(2L)
)
provider.checkForLogs()
val appListBeforeRename = provider.getListing(false)
val appListBeforeRename = provider.getListing()
appListBeforeRename.size should be (1)
appListBeforeRename.head.logPath should endWith(EventLoggingListener.IN_PROGRESS)

logFile1.renameTo(newLogFile("app1", inProgress = false))
provider.checkForLogs()
val appListAfterRename = provider.getListing(false)
val appListAfterRename = provider.getListing()
appListAfterRename.size should be (1)
appListAfterRename.head.logPath should not endWith(EventLoggingListener.IN_PROGRESS)
}
Expand All @@ -211,7 +211,7 @@ class FsHistoryProviderSuite extends FunSuite with BeforeAndAfter with Matchers
oldLog.mkdir()

provider.checkForLogs()
val appListAfterRename = provider.getListing(false)
val appListAfterRename = provider.getListing()
appListAfterRename.size should be (1)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class HistoryServerSuite extends FunSuite with BeforeAndAfter with Matchers with
val ui = mock[SparkUI]
val link = "/history/app1"
val info = new ApplicationHistoryInfo("app1", "app1", 0, 2, 1, "xxx", true)
when(historyServer.getApplicationList(false)).thenReturn(Seq(info))
when(historyServer.getApplicationList()).thenReturn(Seq(info))
when(ui.basePath).thenReturn(link)
when(historyServer.getProviderConfig()).thenReturn(Map[String, String]())
val page = new HistoryPage(historyServer)
Expand Down

0 comments on commit d2ef58d

Please sign in to comment.