Skip to content
Merged
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
8 changes: 0 additions & 8 deletions core/src/main/scala/org/apache/spark/status/api/v1/api.scala
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,3 @@ case class ThreadStackTrace(
val blockedByLock: String,
val holdingLocks: Seq[String])

class ExecutionData (val id : Long,
val status: String,
val description: String,
val submissionTime: String,
val duration: String,
val runningJobs: Seq[Int],
val successJobs: Seq[Int],
val failedJobs: Seq[Int])
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ private[v1] class SqlResource extends BaseAppResource {
withUI { ui =>
val sqlStore = new SQLAppStatusStore(ui.store.store)

sqlStore.executionsList()
.filter(execution => execution.executionId == execId)
sqlStore
.execution(execId)
.map(exec => prepareExecutionData(exec))
.toSeq
}
}

Expand All @@ -59,15 +60,14 @@ private[v1] class SqlResource extends BaseAppResource {
var completed = Seq[Int]()
var failed = Seq[Int]()

exec.jobs.map { job =>
job match {
case (id, status) if status == JobExecutionStatus.RUNNING =>
running = running :+ id
case (id, status) if status == JobExecutionStatus.SUCCEEDED =>
completed = completed :+ id
case (id, status) if status == JobExecutionStatus.FAILED =>
failed = failed :+ id
}
exec.jobs.foreach {
case (id, JobExecutionStatus.RUNNING) =>
running = running :+ id
case (id, JobExecutionStatus.SUCCEEDED ) =>
completed = completed :+ id
case (id, JobExecutionStatus.FAILED) =>
failed = failed :+ id
case _ =>
}

val status = if (exec.jobs.size == completed.size) {
Expand Down
26 changes: 26 additions & 0 deletions sql/core/src/main/scala/org/apache/spark/status/api/v1/api.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.spark.status.api.v1

class ExecutionData (val id : Long,
val status: String,
val description: String,
val submissionTime: String,
val duration: String,
val runningJobIds: Seq[Int],
val successJobIds: Seq[Int],
val failedJobIds: Seq[Int])