Skip to content

Commit acb7ef6

Browse files
committed
fix indentation
1 parent 7bf1811 commit acb7ef6

File tree

12 files changed

+218
-253
lines changed

12 files changed

+218
-253
lines changed

core/src/main/scala/org/apache/spark/status/api/v1/AllJobsResource.scala

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ private[v1] class AllJobsResource(uiRoot: UIRoot) {
3030

3131
@GET
3232
def jobsList(
33-
@PathParam("appId") appId: String,
34-
@QueryParam("status") statuses: JList[JobExecutionStatus]
35-
): Seq[JobData] = {
33+
@PathParam("appId") appId: String,
34+
@QueryParam("status") statuses: JList[JobExecutionStatus]): Seq[JobData] = {
3635
uiRoot.withSparkUI(appId) { ui =>
3736
val statusToJobs: Seq[(JobExecutionStatus, Seq[JobUIData])] =
3837
AllJobsResource.getStatusToJobs(ui)
@@ -69,10 +68,9 @@ private[v1] object AllJobsResource {
6968
}
7069

7170
def convertJobData(
72-
job: JobUIData,
73-
listener: JobProgressListener,
74-
includeStageDetails: Boolean
75-
): JobData = {
71+
job: JobUIData,
72+
listener: JobProgressListener,
73+
includeStageDetails: Boolean): JobData = {
7674
listener.synchronized {
7775
val lastStageInfo = listener.stageIdToInfo.get(job.stageIds.max)
7876
val lastStageData = lastStageInfo.flatMap { s =>

core/src/main/scala/org/apache/spark/status/api/v1/AllRDDResource.scala

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ import org.apache.spark.ui.storage.StorageListener
2626
private[v1] class AllRDDResource(uiRoot: UIRoot) {
2727

2828
@GET
29-
def jobsList(
30-
@PathParam("appId") appId: String
31-
): Seq[RDDStorageInfo] = {
29+
def jobsList(@PathParam("appId") appId: String): Seq[RDDStorageInfo] = {
3230
uiRoot.withSparkUI(appId) { ui =>
3331
val storageStatusList = ui.storageListener.storageStatusList
3432
val rddInfos = ui.storageListener.rddInfoList
@@ -55,11 +53,10 @@ private[spark] object AllRDDResource {
5553
}
5654

5755
def getRDDStorageInfo(
58-
rddId: Int,
59-
rddInfo: RDDInfo,
60-
storageStatusList: Seq[StorageStatus],
61-
includeDetails: Boolean
62-
): RDDStorageInfo = {
56+
rddId: Int,
57+
rddInfo: RDDInfo,
58+
storageStatusList: Seq[StorageStatus],
59+
includeDetails: Boolean): RDDStorageInfo = {
6360
val workers = storageStatusList.map { (rddId, _) }
6461
val blockLocations = StorageUtils.getRddBlockLocations(rddId, storageStatusList)
6562
val blocks = storageStatusList

core/src/main/scala/org/apache/spark/status/api/v1/AllStagesResource.scala

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import javax.ws.rs.core.MediaType
2222

2323
import org.apache.spark.executor.{InputMetrics => InternalInputMetrics, OutputMetrics => InternalOutputMetrics, ShuffleReadMetrics => InternalShuffleReadMetrics, ShuffleWriteMetrics => InternalShuffleWriteMetrics, TaskMetrics => InternalTaskMetrics}
2424
import org.apache.spark.scheduler.{AccumulableInfo => InternalAccumulableInfo, StageInfo}
25-
import org.apache.spark.status.api._
2625
import org.apache.spark.ui.SparkUI
2726
import org.apache.spark.ui.jobs.UIData.{StageUIData, TaskUIData}
2827
import org.apache.spark.util.Distribution
@@ -32,8 +31,8 @@ private[v1] class AllStagesResource(uiRoot: UIRoot) {
3231

3332
@GET
3433
def stageList(
35-
@PathParam("appId") appId: String,
36-
@QueryParam("status") statuses: JList[StageStatus]
34+
@PathParam("appId") appId: String,
35+
@QueryParam("status") statuses: JList[StageStatus]
3736
): Seq[StageData] = {
3837
uiRoot.withSparkUI(appId) { ui =>
3938
val listener = ui.jobProgressListener
@@ -60,11 +59,10 @@ private[v1] class AllStagesResource(uiRoot: UIRoot) {
6059

6160
private[v1] object AllStagesResource {
6261
def stageUiToStageData(
63-
status: StageStatus,
64-
stageInfo: StageInfo,
65-
stageUiData: StageUIData,
66-
includeDetails: Boolean
67-
): StageData = {
62+
status: StageStatus,
63+
stageInfo: StageInfo,
64+
stageUiData: StageUIData,
65+
includeDetails: Boolean): StageData = {
6866

6967
val taskData = if (includeDetails) {
7068
Some(stageUiData.taskData.map { case (k, v) => k -> convertTaskData(v) } )

core/src/main/scala/org/apache/spark/status/api/v1/ApplicationListResource.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ private[v1] class ApplicationListResource(uiRoot: UIRoot) {
2828

2929
@GET
3030
def appList(
31-
@QueryParam("status") status: JList[ApplicationStatus],
32-
@DefaultValue("2010-01-01") @QueryParam("minDate") minDate: SimpleDateParam,
33-
@DefaultValue("3000-01-01") @QueryParam("maxDate") maxDate: SimpleDateParam
34-
): Iterator[ApplicationInfo] = {
31+
@QueryParam("status") status: JList[ApplicationStatus],
32+
@DefaultValue("2010-01-01") @QueryParam("minDate") minDate: SimpleDateParam,
33+
@DefaultValue("3000-01-01") @QueryParam("maxDate") maxDate: SimpleDateParam)
34+
: Iterator[ApplicationInfo] = {
3535
val allApps = uiRoot.getApplicationInfoList
3636
val adjStatus = {
3737
if (status.isEmpty) {

core/src/main/scala/org/apache/spark/status/api/v1/ExecutorListResource.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ import org.apache.spark.ui.exec.ExecutorsPage
2525
private[v1] class ExecutorListResource(uiRoot: UIRoot) {
2626

2727
@GET
28-
def jobsList(
29-
@PathParam("appId") appId: String
30-
): Seq[ExecutorSummary] = {
28+
def jobsList(@PathParam("appId") appId: String): Seq[ExecutorSummary] = {
3129
uiRoot.withSparkUI(appId) { ui =>
3230
val listener = ui.executorsListener
3331
val storageStatusList = listener.storageStatusList

core/src/main/scala/org/apache/spark/status/api/v1/JacksonMessageWriter.scala

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,33 +52,33 @@ private[v1] class JacksonMessageWriter extends MessageBodyWriter[Object]{
5252
mapper.setDateFormat(JacksonMessageWriter.makeISODateFormat)
5353

5454
override def isWriteable(
55-
aClass: Class[_],
56-
`type`: Type,
57-
annotations: Array[Annotation],
58-
mediaType: MediaType): Boolean = {
59-
true
55+
aClass: Class[_],
56+
`type`: Type,
57+
annotations: Array[Annotation],
58+
mediaType: MediaType): Boolean = {
59+
true
6060
}
6161

6262
override def writeTo(
63-
t: Object,
64-
aClass: Class[_],
65-
`type`: Type,
66-
annotations: Array[Annotation],
67-
mediaType: MediaType,
68-
multivaluedMap: MultivaluedMap[String, AnyRef],
69-
outputStream: OutputStream): Unit = {
63+
t: Object,
64+
aClass: Class[_],
65+
`type`: Type,
66+
annotations: Array[Annotation],
67+
mediaType: MediaType,
68+
multivaluedMap: MultivaluedMap[String, AnyRef],
69+
outputStream: OutputStream): Unit = {
7070
t match {
7171
case ErrorWrapper(err) => outputStream.write(err.getBytes("utf-8"))
7272
case _ => mapper.writeValue(outputStream, t)
7373
}
7474
}
7575

7676
override def getSize(
77-
t: Object,
78-
aClass: Class[_],
79-
`type`: Type,
80-
annotations: Array[Annotation],
81-
mediaType: MediaType): Long = {
77+
t: Object,
78+
aClass: Class[_],
79+
`type`: Type,
80+
annotations: Array[Annotation],
81+
mediaType: MediaType): Long = {
8282
-1L
8383
}
8484
}

core/src/main/scala/org/apache/spark/status/api/v1/OneJobResource.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ import org.apache.spark.ui.jobs.UIData.JobUIData
2626
private[v1] class OneJobResource(uiRoot: UIRoot) {
2727

2828
@GET
29-
def jobsList(
30-
@PathParam("appId") appId: String,
31-
@PathParam("jobId") jobId: Int
32-
): JobData = {
29+
def jobsList(@PathParam("appId") appId: String, @PathParam("jobId") jobId: Int): JobData = {
3330
uiRoot.withSparkUI(appId) { ui =>
3431
val statusToJobs: Seq[(JobExecutionStatus, Seq[JobUIData])] =
3532
AllJobsResource.getStatusToJobs(ui)

core/src/main/scala/org/apache/spark/status/api/v1/OneRDDResource.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ private[v1] class OneRDDResource(uiRoot: UIRoot) {
2424

2525
@GET
2626
def rddData(
27-
@PathParam("appId") appId: String,
28-
@PathParam("rddId") rddId: Int
29-
): RDDStorageInfo = {
27+
@PathParam("appId") appId: String,
28+
@PathParam("rddId") rddId: Int): RDDStorageInfo = {
3029
uiRoot.withSparkUI(appId) { ui =>
3130
AllRDDResource.getRDDStorageInfo(rddId, ui.storageListener, true).getOrElse(
3231
throw new NotFoundException(s"no rdd found w/ id $rddId")

core/src/main/scala/org/apache/spark/status/api/v1/OneStageResource.scala

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ private[v1] class OneStageResource(uiRoot: UIRoot) {
3232
@GET
3333
@Path("")
3434
def stageData(
35-
@PathParam("appId") appId: String,
36-
@PathParam("stageId") stageId: Int
37-
): Seq[StageData] = {
35+
@PathParam("appId") appId: String,
36+
@PathParam("stageId") stageId: Int): Seq[StageData] = {
3837
withStage(appId, stageId){ stageAttempts =>
3938
stageAttempts.map { stage =>
4039
AllStagesResource.stageUiToStageData(stage.status, stage.info, stage.ui,
@@ -46,10 +45,9 @@ private[v1] class OneStageResource(uiRoot: UIRoot) {
4645
@GET
4746
@Path("/{attemptId: \\d+}")
4847
def oneAttemptData(
49-
@PathParam("appId") appId: String,
50-
@PathParam("stageId") stageId: Int,
51-
@PathParam("attemptId") attemptId: Int
52-
): StageData = {
48+
@PathParam("appId") appId: String,
49+
@PathParam("stageId") stageId: Int,
50+
@PathParam("attemptId") attemptId: Int): StageData = {
5351
withStageAttempt(appId, stageId, attemptId) { stage =>
5452
AllStagesResource.stageUiToStageData(stage.status, stage.info, stage.ui,
5553
includeDetails = true)
@@ -59,11 +57,11 @@ private[v1] class OneStageResource(uiRoot: UIRoot) {
5957
@GET
6058
@Path("/{attemptId: \\d+}/taskSummary")
6159
def stageData(
62-
@PathParam("appId") appId: String,
63-
@PathParam("stageId") stageId: Int,
64-
@PathParam("attemptId") attemptId: Int,
65-
@DefaultValue("0.05,0.25,0.5,0.75,0.95") @QueryParam("quantiles") quantileString: String
66-
): TaskMetricDistributions = {
60+
@PathParam("appId") appId: String,
61+
@PathParam("stageId") stageId: Int,
62+
@PathParam("attemptId") attemptId: Int,
63+
@DefaultValue("0.05,0.25,0.5,0.75,0.95") @QueryParam("quantiles") quantileString: String)
64+
: TaskMetricDistributions = {
6765
withStageAttempt(appId, stageId, attemptId) { stage =>
6866
val quantiles = quantileString.split(",").map { s =>
6967
try {
@@ -80,13 +78,12 @@ private[v1] class OneStageResource(uiRoot: UIRoot) {
8078
@GET
8179
@Path("/{attemptId: \\d+}/taskList")
8280
def taskList(
83-
@PathParam("appId") appId: String,
84-
@PathParam("stageId") stageId: Int,
85-
@PathParam("attemptId") attemptId: Int,
86-
@DefaultValue("0") @QueryParam("offset") offset: Int,
87-
@DefaultValue("20") @QueryParam("length") length: Int,
88-
@DefaultValue("ID") @QueryParam("sortBy") sortBy: TaskSorting
89-
): Seq[TaskData] = {
81+
@PathParam("appId") appId: String,
82+
@PathParam("stageId") stageId: Int,
83+
@PathParam("attemptId") attemptId: Int,
84+
@DefaultValue("0") @QueryParam("offset") offset: Int,
85+
@DefaultValue("20") @QueryParam("length") length: Int,
86+
@DefaultValue("ID") @QueryParam("sortBy") sortBy: TaskSorting): Seq[TaskData] = {
9087
withStageAttempt(appId, stageId, attemptId) { stage =>
9188
val tasks = stage.ui.taskData.values.map{AllStagesResource.convertTaskData}.toIndexedSeq
9289
.sorted(OneStageResource.ordering(sortBy))

0 commit comments

Comments
 (0)