Skip to content

Commit

Permalink
Revert "apply mesos#845"
Browse files Browse the repository at this point in the history
This reverts commit cb35b20.
  • Loading branch information
vixns committed Aug 31, 2017
1 parent 0d5d96c commit 919cafa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,11 @@ class JobManagementResource @Inject()(val jobScheduler: JobScheduler,
@Timed
def getSummary(): Response = {
try {
val jobs = jobGraph.transformVertextSet(j => jobGraph.getJobForName(j))
import scala.collection.JavaConversions._
val jobs = jobGraph.dag.vertexSet()
.flatMap {
jobGraph.getJobForName
}
.map {
job =>
val state = Exporter.getLastState(job).toString
Expand Down Expand Up @@ -364,7 +368,12 @@ class JobManagementResource @Inject()(val jobScheduler: JobScheduler,
@QueryParam("offset") offset: Integer
) = {
try {
val jobs = jobGraph.transformVertextSet(j => jobGraph.getJobForName(j))
val jobs = ListBuffer[BaseJob]()
import scala.collection.JavaConversions._
jobGraph.dag.vertexSet().map({
job =>
jobs += jobGraph.getJobForName(job).get
})

val _limit: Integer = limit match {
case x: Integer =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import org.jgrapht.graph.DefaultEdge
import scala.collection.convert.decorateAsScala._
import scala.collection.mutable.ListBuffer
import scala.collection.{mutable, _}
import scala.collection.JavaConverters._

/**
* This class provides methods to access dependency structures of jobs.
Expand Down Expand Up @@ -53,14 +52,6 @@ class JobGraph {
Some(parents)
}


def transformVertextSet[T](f: String => Option[T]): Set[T] = {
lock.synchronized {
dag.vertexSet().asScala.flatMap(vertex => f(vertex))
}
}


def getJobForName(name: String): Option[BaseJob] = {
jobNameMapping.get(name)
}
Expand Down

0 comments on commit 919cafa

Please sign in to comment.