本文整理汇总了Scala中org.apache.mesos.Protos.TaskStatus类的典型用法代码示例。如果您正苦于以下问题:Scala TaskStatus类的具体用法?Scala TaskStatus怎么用?Scala TaskStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TaskStatus类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Scala代码示例。
示例1: SchedulerActor
//设置package包名称以及导入依赖的类
package mesosphere.mesos.simulation
import akka.actor.{ Actor, Stash }
import akka.event.LoggingReceive
import mesosphere.marathon.stream._
import org.apache.mesos.Protos.{ FrameworkID, MasterInfo, Offer, TaskStatus }
import org.apache.mesos.{ Scheduler, SchedulerDriver }
import org.slf4j.LoggerFactory
import scala.collection.immutable.Seq
object SchedulerActor {
private val log = LoggerFactory.getLogger(getClass)
case class Registered(
frameworkId: FrameworkID,
master: MasterInfo)
case class ResourceOffers(offers: Seq[Offer])
}
class SchedulerActor(scheduler: Scheduler) extends Actor with Stash {
import SchedulerActor._
var driverOpt: Option[SchedulerDriver] = None
def receive: Receive = waitForDriver
def waitForDriver: Receive = LoggingReceive.withLabel("waitForDriver") {
case driver: SchedulerDriver =>
log.info("received driver")
driverOpt = Some(driver)
context.become(handleCmds(driver))
unstashAll()
case _ => stash()
}
def handleCmds(driver: SchedulerDriver): Receive = LoggingReceive.withLabel("handleCmds") {
case Registered(frameworkId, masterInfo) =>
scheduler.registered(driver, frameworkId, masterInfo)
case ResourceOffers(offers) =>
scheduler.resourceOffers(driver, offers)
case status: TaskStatus =>
scheduler.statusUpdate(driver, status)
}
override def postStop(): Unit = {
driverOpt.foreach { driver => scheduler.disconnected(driver) }
}
}
开发者ID:xiaozai512,项目名称:marathon,代码行数:54,代码来源:SchedulerActor.scala
示例2: ThrottlingTaskStatusUpdateProcessor
//设置package包名称以及导入依赖的类
package mesosphere.marathon
package core.task.update.impl
import javax.inject.{ Inject, Named }
import mesosphere.marathon.core.task.update.TaskStatusUpdateProcessor
import mesosphere.marathon.util.WorkQueue
import org.apache.mesos.Protos.TaskStatus
import scala.concurrent.{ ExecutionContext, Future }
object ThrottlingTaskStatusUpdateProcessor {
final val dependencyTag = "ThrottlingTaskStatusUpdateProcessor"
}
private[core] class ThrottlingTaskStatusUpdateProcessor @Inject() (
@Named(ThrottlingTaskStatusUpdateProcessor.dependencyTag) serializePublish: WorkQueue,
@Named(ThrottlingTaskStatusUpdateProcessor.dependencyTag) wrapped: TaskStatusUpdateProcessor)
extends TaskStatusUpdateProcessor {
override def publish(status: TaskStatus): Future[Unit] = {
serializePublish(wrapped.publish(status))(ExecutionContext.global)
}
}
开发者ID:xiaozai512,项目名称:marathon,代码行数:25,代码来源:ThrottlingTaskStatusUpdateProcessor.scala
注:本文中的org.apache.mesos.Protos.TaskStatus类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论