Skip to content

Commit 919cafa

Browse files
committed
Revert "apply mesos#845"
This reverts commit cb35b20.
1 parent 0d5d96c commit 919cafa

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/main/scala/org/apache/mesos/chronos/scheduler/api/JobManagementResource.scala

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,11 @@ class JobManagementResource @Inject()(val jobScheduler: JobScheduler,
324324
@Timed
325325
def getSummary(): Response = {
326326
try {
327-
val jobs = jobGraph.transformVertextSet(j => jobGraph.getJobForName(j))
327+
import scala.collection.JavaConversions._
328+
val jobs = jobGraph.dag.vertexSet()
329+
.flatMap {
330+
jobGraph.getJobForName
331+
}
328332
.map {
329333
job =>
330334
val state = Exporter.getLastState(job).toString
@@ -364,7 +368,12 @@ class JobManagementResource @Inject()(val jobScheduler: JobScheduler,
364368
@QueryParam("offset") offset: Integer
365369
) = {
366370
try {
367-
val jobs = jobGraph.transformVertextSet(j => jobGraph.getJobForName(j))
371+
val jobs = ListBuffer[BaseJob]()
372+
import scala.collection.JavaConversions._
373+
jobGraph.dag.vertexSet().map({
374+
job =>
375+
jobs += jobGraph.getJobForName(job).get
376+
})
368377

369378
val _limit: Integer = limit match {
370379
case x: Integer =>

src/main/scala/org/apache/mesos/chronos/scheduler/graph/JobGraph.scala

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import org.jgrapht.graph.DefaultEdge
1212
import scala.collection.convert.decorateAsScala._
1313
import scala.collection.mutable.ListBuffer
1414
import scala.collection.{mutable, _}
15-
import scala.collection.JavaConverters._
1615

1716
/**
1817
* This class provides methods to access dependency structures of jobs.
@@ -53,14 +52,6 @@ class JobGraph {
5352
Some(parents)
5453
}
5554

56-
57-
def transformVertextSet[T](f: String => Option[T]): Set[T] = {
58-
lock.synchronized {
59-
dag.vertexSet().asScala.flatMap(vertex => f(vertex))
60-
}
61-
}
62-
63-
6455
def getJobForName(name: String): Option[BaseJob] = {
6556
jobNameMapping.get(name)
6657
}

0 commit comments

Comments
 (0)