Skip to content

Commit d2ef58d

Browse files
committed
revert changes that had HistoryServer refresh the application listing more often
1 parent b136e39 commit d2ef58d

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

core/src/main/scala/org/apache/spark/deploy/history/ApplicationHistoryProvider.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private[history] abstract class ApplicationHistoryProvider {
3535
*
3636
* @return List of all know applications.
3737
*/
38-
def getListing(refresh: Boolean): Iterable[ApplicationHistoryInfo]
38+
def getListing(): Iterable[ApplicationHistoryInfo]
3939

4040
/**
4141
* Returns the Spark UI for a specific application.

core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ private[history] class FsHistoryProvider(conf: SparkConf) extends ApplicationHis
139139
}
140140
}
141141

142-
override def getListing(refresh: Boolean): Iterable[FsApplicationHistoryInfo] = {
142+
override def getListing(): Iterable[FsApplicationHistoryInfo] = {
143143
applications.values
144144
}
145145

core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ private[history] class HistoryPage(parent: HistoryServer) extends WebUIPage("")
3434
val requestedIncomplete =
3535
Option(request.getParameter("showIncomplete")).getOrElse("false").toBoolean
3636

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

core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,12 @@ class HistoryServer(
159159
*
160160
* @return List of all known applications.
161161
*/
162-
def getApplicationList(refresh: Boolean): Iterable[ApplicationHistoryInfo] = {
163-
provider.getListing(refresh)
162+
def getApplicationList(): Iterable[ApplicationHistoryInfo] = {
163+
provider.getListing()
164164
}
165165

166166
def getApplicationInfoList: Seq[ApplicationInfo] = {
167-
getApplicationList(true).map { ApplicationsListResource.appHistoryInfoToPublicAppInfo }.toSeq
167+
getApplicationList().map { ApplicationsListResource.appHistoryInfoToPublicAppInfo }.toSeq
168168
}
169169

170170
/**

core/src/test/scala/org/apache/spark/deploy/history/FsHistoryProviderSuite.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class FsHistoryProviderSuite extends FunSuite with BeforeAndAfter with Matchers
103103
// Take the opportunity to check that the offset checks work as expected.
104104
provider.checkForLogs()
105105

106-
val list = provider.getListing(false).toSeq
106+
val list = provider.getListing().toSeq
107107
list should not be (null)
108108
list.size should be (5)
109109
list.count(_.completed) should be (3)
@@ -174,7 +174,7 @@ class FsHistoryProviderSuite extends FunSuite with BeforeAndAfter with Matchers
174174
val provider = new FsHistoryProvider(createTestConf())
175175
provider.checkForLogs()
176176

177-
val list = provider.getListing(false).toSeq
177+
val list = provider.getListing().toSeq
178178
list should not be (null)
179179
list.size should be (1)
180180
}
@@ -188,13 +188,13 @@ class FsHistoryProviderSuite extends FunSuite with BeforeAndAfter with Matchers
188188
SparkListenerApplicationEnd(2L)
189189
)
190190
provider.checkForLogs()
191-
val appListBeforeRename = provider.getListing(false)
191+
val appListBeforeRename = provider.getListing()
192192
appListBeforeRename.size should be (1)
193193
appListBeforeRename.head.logPath should endWith(EventLoggingListener.IN_PROGRESS)
194194

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

213213
provider.checkForLogs()
214-
val appListAfterRename = provider.getListing(false)
214+
val appListAfterRename = provider.getListing()
215215
appListAfterRename.size should be (1)
216216
}
217217

core/src/test/scala/org/apache/spark/deploy/history/HistoryServerSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ class HistoryServerSuite extends FunSuite with BeforeAndAfter with Matchers with
184184
val ui = mock[SparkUI]
185185
val link = "/history/app1"
186186
val info = new ApplicationHistoryInfo("app1", "app1", 0, 2, 1, "xxx", true)
187-
when(historyServer.getApplicationList(false)).thenReturn(Seq(info))
187+
when(historyServer.getApplicationList()).thenReturn(Seq(info))
188188
when(ui.basePath).thenReturn(link)
189189
when(historyServer.getProviderConfig()).thenReturn(Map[String, String]())
190190
val page = new HistoryPage(historyServer)

0 commit comments

Comments
 (0)