• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Scala JsonProperty类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Scala中com.fasterxml.jackson.annotation.JsonProperty的典型用法代码示例。如果您正苦于以下问题:Scala JsonProperty类的具体用法?Scala JsonProperty怎么用?Scala JsonProperty使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了JsonProperty类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Scala代码示例。

示例1: DeviceDetails

//设置package包名称以及导入依赖的类
package com.flipkart.connekt.commons.entities

import com.fasterxml.jackson.annotation.JsonProperty
import com.flipkart.connekt.commons.entities.bigfoot.PublishSupport
import com.flipkart.connekt.commons.utils.DateTimeUtils
import com.flipkart.connekt.commons.utils.StringUtils._
import com.roundeights.hasher.Implicits._

import scala.util.Try


case class DeviceDetails(deviceId: String,
                         userId: String,
                         @JsonProperty(required = true) token: String,
                         @JsonProperty(required = false) osName: String,
                         @JsonProperty(required = true) osVersion: String,
                         @JsonProperty(required = false) appName: String,
                         @JsonProperty(required = true) appVersion: String,
                         brand: String,
                         model: String,
                         state: String = "",
                         @JsonProperty(required = false) keys: Map[String, String] = Map.empty,
                         active: Boolean = true) extends PublishSupport {

  override def toPublishFormat: fkint.mp.connekt.DeviceDetails = {
    fkint.mp.connekt.DeviceDetails(
      deviceId = deviceId, userId = userId, token = token.sha256.hash.hex, osName = osName, osVersion = osVersion,
      appName = appName, appVersion = appVersion, brand = brand, model = model, state = state,
      ts = DateTimeUtils.getStandardFormatted(), active = active
    )
  }

  def toCallbackEvent = {
    DeviceCallbackEvent(deviceId = deviceId, userId = userId, osName = osName, osVersion = osVersion,
      appName = appName, appVersion = appVersion, brand = brand, model = model, state = state, ts = System.currentTimeMillis(), active = active)
  }

  def validate() = {
    require(Try(MobilePlatform.withName(osName)).map(!_.equals(MobilePlatform.UNKNOWN)).getOrElse(false), "a device's platform cannot be unknown")
    require(token.isDefined, "device detail's token cannot be null/empty")
    require(userId != deviceId, "`userId` cannot be equal to `deviceId`")
    require(appName.isDefined, "device detail's `appName` cannot be null/empty")
  }

  override def namespace: String = "fkint/mp/connekt/DeviceDetails"
} 
开发者ID:ayush03agarwal,项目名称:connekt,代码行数:47,代码来源:DeviceDetails.scala


示例2: ConnektRequest

//设置package包名称以及导入依赖的类
package com.flipkart.connekt.commons.iomodels

import com.fasterxml.jackson.annotation.{JsonIgnore, JsonProperty}
import com.fasterxml.jackson.databind.node.ObjectNode
import com.flipkart.connekt.commons.entities.Channel
import com.flipkart.connekt.commons.services.TStencilService
import com.flipkart.connekt.commons.utils.StringUtils._

case class ConnektRequest(@JsonProperty(required = false) id: String,
                          @JsonProperty(required = false) clientId: String,
                          contextId: Option[String],
                          channel: String,
                          @JsonProperty(required = true) sla: String,
                          stencilId: Option[String],
                          scheduleTs: Option[Long],
                          expiryTs: Option[Long],
                          @JsonProperty(required = true) channelInfo: ChannelRequestInfo,
                          @JsonProperty(required = false) channelData: ChannelRequestData,
                          @JsonProperty(required = false) channelDataModel: ObjectNode = getObjectNode,
                          meta: Map[String, String]) {

  def this(id: String, clientId: String, contextId: Option[String], channel: String, sla: String, stencilId: Option[String],
           scheduleTs: Option[Long], expiryTs: Option[Long], channelInfo: ChannelRequestInfo,
           channelData: ChannelRequestData, channelDataModel: ObjectNode) {
    this(id, clientId, contextId, channel, sla, stencilId, scheduleTs, expiryTs, channelInfo, channelData, channelDataModel, Map.empty[String, String])
  }

  def validate(implicit stencilService: TStencilService) = {
    require(stencilId.map(stencilService.get(_).nonEmpty).getOrElse(Option(channelData).isDefined), "given stencil Id doesn't exist")
    require(contextId.forall(_.hasOnlyAllowedChars), "`contextId` field can only contain [A-Za-z0-9_.-:|] allowed chars.")
    require(sla.isDefined, "`sla` field can cannot be null or empty.")
    require(meta != null, "`meta` field cannot be null. It is optional but non-null")
    require(channelInfo != null, "`channelInfo` field cannot be null.")
    require(contextId.forall(_.length <= 20), "`contextId` can be max 20 characters")
  }

  @JsonIgnore
  def isTestRequest : Boolean = meta.get("x-perf-test").exists(v => v.trim.equalsIgnoreCase("true"))

  def getComputedChannelData(implicit stencilService: TStencilService): ChannelRequestData =
    stencilId.map(stencilService.get(_)).map { stencil =>
      Channel.withName(channel) match {
        case Channel.PUSH =>
          val pushType = if (channelData != null) channelData.asInstanceOf[PNRequestData].pushType else null
          PNRequestData(pushType = pushType, data = stencilService.materialize(stencil.head, channelDataModel).asInstanceOf[String].getObj[ObjectNode])
        case Channel.SMS =>
          SmsRequestData(body = stencilService.materialize(stencil.head, channelDataModel).asInstanceOf[String])
        case Channel.EMAIL =>
          val subject = stencilService.materialize(stencil.filter(_.component.equalsIgnoreCase("subject")).head, channelDataModel).asInstanceOf[String]
          val html = stencilService.materialize(stencil.filter(_.component.equalsIgnoreCase("html")).head, channelDataModel).asInstanceOf[String]
          val txt = stencilService.materialize(stencil.filter(_.component.equalsIgnoreCase("text")).head, channelDataModel).asInstanceOf[String]
          EmailRequestData(subject = subject, html = html, text = txt, attachments = Option(channelData).map(_.asInstanceOf[EmailRequestData].attachments).orNull)
        case unsupportedChannel =>
          throw new Exception(s"`channelData` compute undefined for $unsupportedChannel")
      }
    }.getOrElse(channelData)
} 
开发者ID:ayush03agarwal,项目名称:connekt,代码行数:58,代码来源:ConnektRequest.scala


示例3: EmailRequestInfo

//设置package包名称以及导入依赖的类
package com.flipkart.connekt.commons.iomodels

import javax.mail.internet.InternetAddress

import com.fasterxml.jackson.annotation.JsonProperty

case class EmailRequestInfo(@JsonProperty(required = false) appName: String,
                            @JsonProperty(required = false) to: Set[EmailAddress] = Set.empty[EmailAddress],
                            @JsonProperty(required = false) cc: Set[EmailAddress] = Set.empty[EmailAddress],
                            @JsonProperty(required = false) bcc: Set[EmailAddress] = Set.empty[EmailAddress],
                            @JsonProperty(required = false) from: EmailAddress,
                            @JsonProperty(required = false) replyTo: EmailAddress

                           ) extends ChannelRequestInfo {
  def toStrict:EmailRequestInfo = {
    this.copy(appName = appName.toLowerCase, cc = Option(cc).getOrElse(Set.empty), bcc = Option(bcc).getOrElse(Set.empty) )
  }
}

case class EmailAddress(name: String, address: String){
  def toInternetAddress:InternetAddress = {
    new InternetAddress(address,name)
  }
} 
开发者ID:ayush03agarwal,项目名称:connekt,代码行数:25,代码来源:EmailRequestInfo.scala


示例4: PNRequestInfo

//设置package包名称以及导入依赖的类
package com.flipkart.connekt.commons.iomodels

import com.fasterxml.jackson.annotation.JsonProperty

case class PNRequestInfo(@JsonProperty(required = false) platform: String,
                         @JsonProperty(required = false) appName: String,
                         @JsonProperty(required = false) deviceIds: Set[String] = Set.empty[String],
                         @JsonProperty(required = false) topic:Option[String] = None,
                         ackRequired: Boolean,
                         delayWhileIdle: Boolean) extends ChannelRequestInfo {
  def this() {
    this(null, null, Set.empty[String], None, false, false)
  }

} 
开发者ID:ayush03agarwal,项目名称:connekt,代码行数:16,代码来源:PNRequestInfo.scala


示例5: XmppReceipt

//设置package包名称以及导入依赖的类
package com.flipkart.connekt.commons.iomodels

import com.fasterxml.jackson.annotation.JsonProperty

case class XmppReceipt(@JsonProperty("message_type") messageType: String,
                          @JsonProperty("message_id")@JsonProperty(required = false) messageId: String,
                          @JsonProperty(required = false) from: String,
                          @JsonProperty(required = false) category: String,
                          data: XmppReceiptData) extends XmppResponse {
  override def responseType(): String = messageType
}

case class XmppReceiptData(@JsonProperty("message_status") messageStatus: String,
                                   @JsonProperty("original_message_id") originalMessageId: String,
                                   @JsonProperty("device_registration_id") deviceRegistrationId: String) 
开发者ID:ayush03agarwal,项目名称:connekt,代码行数:16,代码来源:XmppReceipt.scala


示例6: Configurations

//设置package包名称以及导入依赖的类
package org.ieee.codemeow.geometric.spark


import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import com.google.common.base.Preconditions
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.{FileSystem, Path}




object Configurations {
  def fromFile(_path: String): MainConfiguration ={
    val config = new Configuration
    val path = new Path(_path)
    val fs = FileSystem.get(path.toUri, config)
    val file = fs.open(path)
    val mapper = new ObjectMapper(new YAMLFactory())
    mapper.registerModule(DefaultScalaModule)
    mapper.readValue(file, classOf[MainConfiguration])
  }
}

class MainConfiguration (
                          @JsonProperty("appName") _appName: String,
                          @JsonProperty("bbox") _bbox: (Double, Double, Double, Double), // lat1, lon1, lat2, lon2
                          @JsonProperty("layers") _layers: Array[LayerConfiguration],
                          @JsonProperty("sequenceFileDir") _sequenceFileDir: String
                        ) extends Serializable{
  val appName = Preconditions.checkNotNull(_appName, "appName cannot be null": Object)
  val bbox = _bbox
  val layers = Preconditions.checkNotNull(_layers, "layers cannot be null": Object)
  val sequenceFileDir = Preconditions.checkNotNull(_sequenceFileDir, "sequenceFileDir cannot be null": Object)
}

class LayerConfiguration (
                         @JsonProperty("layerName") _layerName: String,
                         @JsonProperty("minZoom") _minZoom: Int,
                         @JsonProperty("maxZoom") _maxZoom: Int,
                         @JsonProperty("dataProvider") _dataProvider: String,
                         @JsonProperty("kwargs") _kwargs: Map[String, Any]
                         ) extends Serializable{
  val layerName = Preconditions.checkNotNull(_layerName, "layerName cannot be null": Object)
  val minZoom = Preconditions.checkNotNull(_minZoom, "minZoom cannot be null": Object)
  val maxZoom = Preconditions.checkNotNull(_maxZoom, "maxZoom cannot be null": Object)
  val dataProvider = Preconditions.checkNotNull(_dataProvider, "dataProvider cannot be null": Object)
  val kwargs = Preconditions.checkNotNull(_kwargs, "kwargs cannot be null": Object)
} 
开发者ID:codemeow5,项目名称:Vector-Tile-Spark-Process,代码行数:52,代码来源:Configurations.scala


示例7: ConfigFile

//设置package包名称以及导入依赖的类
package moe.pizza.auth.config

import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.databind.JsonNode
import moe.pizza.auth.adapters.GraderChain
import moe.pizza.auth.adapters.PilotGraderLike.PilotGraderFactory
import moe.pizza.auth.interfaces.PilotGrader
import moe.pizza.auth.webapp.oauth.OAuthApplication

import scala.concurrent.ExecutionContext
import org.http4s.client.Client


object ConfigFile {
  case class PingBotConfig(
      host: String,
      password: String
  )
  case class EmbeddedLdapConfig(
      instancePath: String = "./ldap",
      port: Int = 389,
      basedn: String = "ou=pizza",
      host: String = "localhost",
      password: Option[String] = None
  )
  case class AuthGroupConfig(closed: List[String],
                             open: List[String],
                             public: List[String])

  case class AuthConfig(
      domain: String,
      corporation: String,
      alliance: String,
      groupName: String,
      groupShortName: String,
      groups: AuthGroupConfig,
      graders: List[JsonNode],
      pingbot: Option[PingBotConfig],
      restkeys: List[String],
      applications: List[OAuthApplication] = List()
  ) {
    def constructGraders(c: ConfigFile)(
        implicit client: Client): PilotGrader =
      new GraderChain(
        graders.map(g => PilotGraderFactory.fromYaml(g, c)).flatten.toList)

  }
  case class CrestConfig(
      @JsonProperty("login_url") loginUrl: String,
      @JsonProperty("crest_url") crestUrl: String,
      clientID: String,
      secretKey: String,
      redirectUrl: String
  )
  case class ConfigFile(
      crest: CrestConfig,
      auth: AuthConfig,
      embeddedldap: EmbeddedLdapConfig
  )

} 
开发者ID:NoApologies420,项目名称:Alliance-Auth,代码行数:62,代码来源:ConfigFile.scala


示例8: CurriDocument

//设置package包名称以及导入依赖的类
package curri.docs.domain

import com.fasterxml.jackson.annotation.JsonProperty
import reactivemongo.bson.{BSONDocument, BSONDocumentReader, BSONDocumentWriter}
 

case class CurriDocument(
                          @JsonProperty("title") title: String,
                          @JsonProperty("kind") kind: String,
                          @JsonProperty("body") body: String,
                          @JsonProperty("ownerUser") ownerUser: Option[String],
                          @JsonProperty("ownerGroup") ownerGroup: Option[String]) {
  def withBody(newBody: String) = CurriDocument(title, kind, newBody, ownerUser, ownerGroup)

}


object CurriDocumentWriter extends BSONDocumentWriter[CurriDocument] {
  def write(curriDoc: CurriDocument): BSONDocument = BSONDocument(
    "title" -> curriDoc.title,
    "kind" -> curriDoc.kind,
    "body" -> curriDoc.body,
    "ownerUser" -> curriDoc.ownerUser,
    "ownerGroup" -> curriDoc.ownerGroup)
}


object CurriDocumentReader extends BSONDocumentReader[CurriDocument] {
  def read(doc: BSONDocument): CurriDocument = {
    CurriDocument(
      doc.getAs[String]("title").get,
      doc.getAs[String]("kind").get,
      doc.getAs[String]("body").get,
      doc.getAs[String]("ownerUser"),
      doc.getAs[String]("ownerGroup"))
  }
} 
开发者ID:kolov,项目名称:curri-docs-service,代码行数:38,代码来源:CurriDocument.scala


示例9: TestStrategy

//设置package包名称以及导入依赖的类
package org.ebayopensource.regression.internal.reader

import java.net.URI
import java.util
import java.util.{UUID, List => JList, Map => JMap}

import org.ebayopensource.regression.internal.components.comparator.common.Comparator
import org.ebayopensource.regression.internal.components.continuation.Continuation
import org.ebayopensource.regression.internal.components.printer.ProgressPrinter
import org.ebayopensource.regression.internal.components.recorder.common.Recorder
import org.ebayopensource.regression.internal.components.requestBuilder.RequestPayloadBuilder
import com.fasterxml.jackson.annotation.JsonProperty

import scala.collection.JavaConversions._


class TestStrategy(@JsonProperty("service") _service: Service,
               @JsonProperty(value = "commonHeaders", required = false) _headers: JMap[String, String],
               @JsonProperty("requests") _requests: JList[RequestEntry]) {
  val service = _service
  val headers: Map[String, String] = setSpecialHeaders(Option(_headers).getOrElse(new util.HashMap).toMap)
  val requests = _requests.toList

  def setSpecialHeaders(headers: Map[String, String]): Map[String, String] = {
    headers map { case (k,v) => if (v.equals("<new-guid>")) (k, UUID.randomUUID().toString) else (k, v) }
  }
}

class Service(@JsonProperty(value = "baseURL", required = true) _baseURL: String) {
  val baseURL = new URI(_baseURL)
}

class RequestEntry(@JsonProperty(value = "requestName", required = true) _reqName: String,
                   @JsonProperty(value = "path", required = true) _path: String,
                   @JsonProperty(value = "method", required = true) _method: String,
                   @JsonProperty(value = "extraHeaders", required = false) _headers: JMap[String, String],
                   @JsonProperty(value = "requestBuilder", required = false) _bodyBuilder: String,
                   @JsonProperty(value = "recorder", required = true) _recorder: String,
                   @JsonProperty(value = "continuation", required = false) _continuation: String,
                   @JsonProperty(value = "comparator", required = true) _comparator: String,
                   @JsonProperty(value = "dataInput", required = false) _dataInput: JMap[String, String],
                   @JsonProperty(value = "progressPrinter", required = false) _progressPrinter: String)
{
  val requestName = _reqName.replaceAll(" ", "_")
  val path = _path
  val method : HttpMethods.Value = HttpMethods.withName(_method)
  val extraHeaders = Option(_headers).getOrElse(new util.HashMap[String, String]()).toMap
  val requestBuilder = if (Option(_bodyBuilder).isDefined) Some(Class.forName(_bodyBuilder).newInstance().asInstanceOf[RequestPayloadBuilder]) else None
  val recorder = Class.forName(_recorder).newInstance().asInstanceOf[Recorder]
  val comparator = Class.forName(_comparator).newInstance().asInstanceOf[Comparator]
  val continuation = if (Option(_continuation).isDefined) Some(Class.forName(_continuation).newInstance().asInstanceOf[Continuation]) else None
  val dataInput = Option(_dataInput).getOrElse(new util.HashMap[String, String]()).toMap
  val progressPrinter = if (Option(_progressPrinter).isDefined) Some(Class.forName(_progressPrinter).newInstance().asInstanceOf[ProgressPrinter]) else None
}

object HttpMethods extends Enumeration {
  val GET, POST, PUT, DELETE = Value
} 
开发者ID:eBay,项目名称:regressr,代码行数:59,代码来源:TestStrategy.scala


示例10: InputInstanceMetadata

//设置package包名称以及导入依赖的类
package com.bwsw.sj.common.rest.entities.module

import com.bwsw.sj.common.DAL.model.module.{InputInstance, InputTask}
import com.bwsw.sj.common.utils.EngineLiterals
import com.fasterxml.jackson.annotation.JsonProperty

import scala.collection.JavaConverters._

class InputInstanceMetadata extends InstanceMetadata {
  var outputs: Array[String] = Array()
  @JsonProperty("duplicate-check") var duplicateCheck: Boolean = false
  @JsonProperty("lookup-history") var lookupHistory: Int = 0
  @JsonProperty("queue-max-size") var queueMaxSize: Int = 0
  @JsonProperty("default-eviction-policy") var defaultEvictionPolicy: String = EngineLiterals.noneDefaultEvictionPolicy
  @JsonProperty("eviction-policy") var evictionPolicy: String = EngineLiterals.fixTimeEvictionPolicy
  @JsonProperty("backup-count") var backupCount: Int = 0
  @JsonProperty("async-backup-count") var asyncBackupCount: Int = 0
  var tasks: Map[String, InputTask] = Map()

  override def asModelInstance() = {
    val modelInstance = new InputInstance()
    super.fillModelInstance(modelInstance)
    modelInstance.outputs = this.outputs
    modelInstance.duplicateCheck = this.duplicateCheck
    modelInstance.defaultEvictionPolicy = this.defaultEvictionPolicy
    modelInstance.evictionPolicy = this.evictionPolicy
    modelInstance.lookupHistory = this.lookupHistory
    modelInstance.queueMaxSize = this.queueMaxSize
    modelInstance.tasks = this.tasks.asJava
    modelInstance.backupCount = this.backupCount
    modelInstance.asyncBackupCount = this.asyncBackupCount

    modelInstance
  }

  override def prepareInstance(moduleType: String,
                            moduleName: String,
                            moduleVersion: String,
                            engineName: String,
                            engineVersion: String) = {
    super.prepareInstance(moduleType, moduleName, moduleVersion, engineName, engineVersion)
    fillTasks()
    fillStages(this.outputs)
  }

  override def createStreams() = {
    val sjStreams = getStreams(this.outputs)
    sjStreams.foreach(_.create())
  }

  private def fillTasks(): Unit = {
    for (i <- 0 until this.parallelism.asInstanceOf[Int]) {
      val task = new InputTask()
      this.tasks += (s"${this.name}-task$i" -> task)
    }
  }
} 
开发者ID:bwsw,项目名称:sj-platform,代码行数:58,代码来源:InputInstanceMetadata.scala


示例11: RegularInstanceMetadata

//设置package包名称以及导入依赖的类
package com.bwsw.sj.common.rest.entities.module

import com.bwsw.sj.common.DAL.model.module._
import com.bwsw.sj.common.utils.EngineLiterals
import com.bwsw.sj.common.utils.StreamLiterals._
import com.fasterxml.jackson.annotation.JsonProperty
import com.bwsw.sj.common.utils.SjStreamUtils._

class RegularInstanceMetadata extends InstanceMetadata {
  var inputs: Array[String] = Array()
  var outputs: Array[String] = Array()
  @JsonProperty("execution-plan") var executionPlan: ExecutionPlan = new ExecutionPlan()
  @JsonProperty("start-from") var startFrom: String = EngineLiterals.newestStartMode
  @JsonProperty("state-management") var stateManagement: String = EngineLiterals.noneStateMode
  @JsonProperty("state-full-checkpoint") var stateFullCheckpoint: Int = 100
  @JsonProperty("event-wait-time") var eventWaitTime: Long = 1000

  override def asModelInstance() = {
    val modelInstance = new RegularInstance()
    super.fillModelInstance(modelInstance)
    modelInstance.stateManagement = this.stateManagement
    modelInstance.stateFullCheckpoint = this.stateFullCheckpoint
    modelInstance.eventWaitTime = this.eventWaitTime
    modelInstance.inputs = this.inputs
    modelInstance.outputs = this.outputs
    modelInstance.startFrom = this.startFrom
    modelInstance.executionPlan = this.executionPlan

    modelInstance
  }

  override def prepareInstance(moduleType: String,
                               moduleName: String,
                               moduleVersion: String,
                               engineName: String,
                               engineVersion: String) = {
    super.prepareInstance(moduleType, moduleName, moduleVersion, engineName, engineVersion)
    castParallelismToNumber(getStreamsPartitions(this.inputs.map(clearStreamFromMode)))
    this.executionPlan.fillTasks(createTaskStreams(), createTaskNames(this.parallelism.asInstanceOf[Int], this.name))

    val inputStreams = getStreams(this.inputs.map(clearStreamFromMode))
    val outputStreams = this.outputs
    val streams = inputStreams.filter(s => s.streamType.equals(tStreamType)).map(_.name).union(outputStreams)
    fillStages(streams)
  }

  override def createStreams() = {
    val sjStreams = getStreams(this.inputs.map(clearStreamFromMode) ++ this.outputs)
    sjStreams.foreach(_.create())
  }

  override def getInputs() = this.inputs
} 
开发者ID:bwsw,项目名称:sj-platform,代码行数:54,代码来源:RegularInstanceMetadata.scala


示例12: WindowedInstanceMetadata

//设置package包名称以及导入依赖的类
package com.bwsw.sj.common.rest.entities.module

import com.bwsw.sj.common.DAL.model.module.WindowedInstance
import com.bwsw.sj.common.utils.EngineLiterals
import com.bwsw.sj.common.utils.StreamLiterals._
import com.fasterxml.jackson.annotation.JsonProperty
import com.bwsw.sj.common.utils.SjStreamUtils._

class WindowedInstanceMetadata extends InstanceMetadata {
  var inputs: Array[String] = Array()
  var outputs: Array[String] = Array()
  @JsonProperty("execution-plan") var executionPlan: ExecutionPlan = new ExecutionPlan()
  @JsonProperty("start-from") var startFrom: String = EngineLiterals.newestStartMode
  @JsonProperty("state-management") var stateManagement: String = EngineLiterals.noneStateMode
  @JsonProperty("state-full-checkpoint") var stateFullCheckpoint: Int = 100
  @JsonProperty("event-wait-time") var eventWaitTime: Long = 1000
  @JsonProperty("time-windowed") var timeWindowed: Int = 0
  @JsonProperty("window-full-max") var windowFullMax: Int = 0

  override def asModelInstance() = {
    val modelInstance = new WindowedInstance()
    super.fillModelInstance(modelInstance)
    modelInstance.timeWindowed = this.timeWindowed
    modelInstance.windowFullMax = this.windowFullMax
    modelInstance.stateManagement = this.stateManagement
    modelInstance.stateFullCheckpoint = this.stateFullCheckpoint
    modelInstance.eventWaitTime = this.eventWaitTime
    modelInstance.inputs = this.inputs
    modelInstance.outputs = this.outputs
    modelInstance.startFrom = this.startFrom
    modelInstance.executionPlan = this.executionPlan

    modelInstance
  }

  override def prepareInstance(moduleType: String,
                               moduleName: String,
                               moduleVersion: String,
                               engineName: String,
                               engineVersion: String) = {
    super.prepareInstance(moduleType, moduleName, moduleVersion, engineName, engineVersion)
    castParallelismToNumber(getStreamsPartitions(this.inputs.map(clearStreamFromMode)))
    this.executionPlan.fillTasks(createTaskStreams(), createTaskNames(this.parallelism.asInstanceOf[Int], this.name))

    val inputStreams = getStreams(this.inputs.map(clearStreamFromMode))
    val outputStreams = this.outputs
    val streams = inputStreams.filter(s => s.streamType.equals(tStreamType)).map(_.name).union(outputStreams)
    fillStages(streams)
  }

  override def createStreams() = {
    val sjStreams = getStreams(this.inputs.map(clearStreamFromMode) ++ this.outputs)
    sjStreams.foreach(_.create())
  }

  override def getInputs() = this.inputs
} 
开发者ID:bwsw,项目名称:sj-platform,代码行数:58,代码来源:WindowedInstanceMetadata.scala


示例13: OutputInstanceMetadata

//设置package包名称以及导入依赖的类
package com.bwsw.sj.common.rest.entities.module

import com.bwsw.sj.common.DAL.model.module.OutputInstance
import com.bwsw.sj.common.utils.EngineLiterals
import com.fasterxml.jackson.annotation.JsonProperty
import com.bwsw.sj.common.utils.SjStreamUtils._

class OutputInstanceMetadata extends InstanceMetadata {
  @JsonProperty("execution-plan") var executionPlan: ExecutionPlan = new ExecutionPlan()
  @JsonProperty("start-from") var startFrom: String = EngineLiterals.newestStartMode
  var input: String = null
  var output: String = null

  override def asModelInstance() = {
    val modelInstance = new OutputInstance()
    super.fillModelInstance(modelInstance)

    modelInstance.inputs = Array(this.input)
    modelInstance.outputs = Array(this.output)
    modelInstance.startFrom = this.startFrom
    modelInstance.executionPlan = this.executionPlan

    modelInstance
  }

  override def prepareInstance(moduleType: String,
                               moduleName: String,
                               moduleVersion: String,
                               engineName: String,
                               engineVersion: String) = {

    super.prepareInstance(moduleType, moduleName, moduleVersion, engineName, engineVersion)
    castParallelismToNumber(getStreamsPartitions(Array(clearStreamFromMode(this.input))))
    this.executionPlan.fillTasks(createTaskStreams(), createTaskNames(this.parallelism.asInstanceOf[Int], this.name))

    val streams = Array(clearStreamFromMode(input))
    fillStages(streams)
  }

  override def createStreams() = {
    val sjStreams = getStreams(Array(clearStreamFromMode(this.input)))
    sjStreams.foreach(_.create())
  }

  override def getInputs() = Array(this.input)
} 
开发者ID:bwsw,项目名称:sj-platform,代码行数:47,代码来源:OutputInstanceMetadata.scala


示例14: PerformanceMetricsMetadata

//设置package包名称以及导入依赖的类
package com.bwsw.sj.engine.core.reporting

import java.util.Date

import com.fasterxml.jackson.annotation.JsonProperty

class PerformanceMetricsMetadata {
  @JsonProperty("pm-datetime") var pmDatetime: Date = null
  @JsonProperty("task-id") var taskId: String= null
  var host: String = null
  @JsonProperty("total-input-envelopes") var totalInputEnvelopes: Int = 0
  @JsonProperty("total-input-elements") var totalInputElements: Int = 0
  @JsonProperty("total-input-bytes") var totalInputBytes: Int = 0
  @JsonProperty("average-size-input-envelope") var averageSizeInputEnvelope: Int = 0
  @JsonProperty("max-size-input-envelope") var maxSizeInputEnvelope: Int = 0
  @JsonProperty("min-size-input-envelope") var minSizeInputEnvelope: Int = 0
  @JsonProperty("average-size-input-element") var averageSizeInputElement: Int = 0
  @JsonProperty("total-output-envelopes") var totalOutputEnvelopes: Int = 0
  @JsonProperty("total-output-elements") var totalOutputElements: Int = 0
  @JsonProperty("total-output-bytes") var totalOutputBytes: Int = 0
  @JsonProperty("average-size-output-envelope") var averageSizeOutputEnvelope: Int = 0
  @JsonProperty("max-size-output-envelope") var maxSizeOutputEnvelope: Int = 0
  @JsonProperty("min-size-output-envelope") var minSizeOutputEnvelope: Int = 0
  @JsonProperty("average-size-output-element") var averageSizeOutputElement: Int = 0
  var uptime: Long = 0

  @JsonProperty("total-idle-time") var totalIdleTime: Long = 0
  @JsonProperty("input-envelopes-per-stream") var inputEnvelopesPerStream: Map[String, Any] = null
  @JsonProperty("input-elements-per-stream") var inputElementsPerStream: Map[String, Any] = null
  @JsonProperty("input-bytes-per-stream") var inputBytesPerStream: Map[String, Any] = null
  @JsonProperty("output-envelopes-per-stream") var outputEnvelopesPerStream: Map[String, Any] = null
  @JsonProperty("output-elements-per-stream") var outputElementsPerStream: Map[String, Any] = null
  @JsonProperty("output-bytes-per-stream") var outputBytesPerStream: Map[String, Any] = null
  @JsonProperty("state-variables-number") var stateVariablesNumber: Int = 0

  @JsonProperty("input-stream-name") var inputStreamName: String = null
  @JsonProperty("output-stream-name") var outputStreamName:  String = null

  @JsonProperty("entry-point-port") var entryPointPort: Int = 0
} 
开发者ID:bwsw,项目名称:sj-platform,代码行数:41,代码来源:PerformanceMetricsMetadata.scala


示例15: Of

//设置package包名称以及导入依赖的类
package com.bwsw.sj.crud.rest

import com.fasterxml.jackson.annotation.JsonSubTypes.Type
import com.fasterxml.jackson.annotation.{JsonSubTypes, JsonTypeInfo, JsonProperty}


@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "stream-type")
@JsonSubTypes(Array(new Type(value = classOf[CassStream], name = "cassandra"),
  new Type(value = classOf[TestStream], name = "test")
))
class SjStreamTest {
  var name: String = null
  var description: String = "No description"
  @JsonProperty("stream-type") var streamType: String = null
}

class CassStream extends  SjStreamTest {
  var keyspace: String = null
}

class TestStream extends SjStreamTest {
  var ttt: Int = 0
} 
开发者ID:bwsw,项目名称:sj-platform,代码行数:24,代码来源:SjStreamData.scala


示例16: TrafficMetrics

//设置package包名称以及导入依赖的类
package com.bwsw.sj.examples.sflow.module.output.data

import java.util.Date

import com.bwsw.sj.engine.core.entities.OutputData
import com.fasterxml.jackson.annotation.JsonProperty


class TrafficMetrics extends OutputData {
  var ts: Date = null
  @JsonProperty("src-as") var srcAs: Int= 0
  @JsonProperty("dst-as") var dstAs: String= null
  @JsonProperty("sum-of-traffic") var trafficSum: Long= 0

  override def getDateFields(): Array[String] = {
    val fields = super.getDateFields().toBuffer
    fields.append("ts")
    fields.toArray
  }
} 
开发者ID:bwsw,项目名称:sj-platform,代码行数:21,代码来源:TrafficMetrics.scala


示例17: PerformanceMetrics

//设置package包名称以及导入依赖的类
package com.bwsw.sj.module.output.pm.data

import java.util.Date

import com.bwsw.sj.engine.core.entities.OutputData
import com.fasterxml.jackson.annotation.JsonProperty


class PerformanceMetrics extends OutputData {
  @JsonProperty("pm-datetime") var pmDatetime: Date = null
  @JsonProperty("task-id") var taskId: String= null
  var host: String = null
  @JsonProperty("total-input-envelopes") var totalInputEnvelopes: Int = 0
  @JsonProperty("total-input-elements") var totalInputElements: Int = 0
  @JsonProperty("total-input-bytes") var totalInputBytes: Int = 0
  @JsonProperty("average-size-input-envelope") var averageSizeInputEnvelope: Int = 0
  @JsonProperty("max-size-input-envelope") var maxSizeInputEnvelope: Int = 0
  @JsonProperty("min-size-input-envelope") var minSizeInputEnvelope: Int = 0
  @JsonProperty("average-size-input-element") var averageSizeInputElement: Int = 0
  @JsonProperty("total-output-envelopes") var totalOutputEnvelopes: Int = 0
  @JsonProperty("total-output-elements") var totalOutputElements: Int = 0
  @JsonProperty("total-output-bytes") var totalOutputBytes: Int = 0
  @JsonProperty("average-size-output-envelope") var averageSizeOutputEnvelope: Int = 0
  @JsonProperty("max-size-output-envelope") var maxSizeOutputEnvelope: Int = 0
  @JsonProperty("min-size-output-envelope") var minSizeOutputEnvelope: Int = 0
  @JsonProperty("average-size-output-element") var averageSizeOutputElement: Int = 0
  var uptime: Long = 0

  @JsonProperty("total-idle-time") var totalIdleTime: Long = 0
  @JsonProperty("input-envelopes-per-stream") var inputEnvelopesPerStream: Map[String, Any] = Map()
  @JsonProperty("input-elements-per-stream") var inputElementsPerStream: Map[String, Any] = Map()
  @JsonProperty("input-bytes-per-stream") var inputBytesPerStream: Map[String, Any] = Map()
  @JsonProperty("output-envelopes-per-stream") var outputEnvelopesPerStream: Map[String, Any] = Map()
  @JsonProperty("output-elements-per-stream") var outputElementsPerStream: Map[String, Any] = Map()
  @JsonProperty("output-bytes-per-stream") var outputBytesPerStream: Map[String, Any] = Map()
  @JsonProperty("state-variables-number") var stateVariablesNumber: Int = 0

  @JsonProperty("input-stream-name") var inputStreamName: String = null
  @JsonProperty("output-stream-name") var outputStreamName:  String = null

  override def getDateFields(): Array[String] = {
    val fields = super.getDateFields().toBuffer
    fields.append("pm-datetime")
    fields.toArray
  }
} 
开发者ID:bwsw,项目名称:sj-platform,代码行数:47,代码来源:PerformanceMetrics.scala


示例18: Work

//设置package包名称以及导入依赖的类
package uk.ac.wellcome.models

import com.fasterxml.jackson.annotation.JsonProperty
import com.sksamuel.elastic4s.Indexable
import uk.ac.wellcome.utils.JsonUtil


case class Work(
  identifiers: List[SourceIdentifier],
  title: String,
  description: Option[String] = None,
  lettering: Option[String] = None,
  createdDate: Option[Period] = None,
  subjects: List[Concept] = List(),
  creators: List[Agent] = List()
) {
  @JsonProperty("type") val ldType: String = "Work"
}

object IdentifiedWork extends Indexable[IdentifiedWork] {
  override def json(t: IdentifiedWork): String =
    JsonUtil.toJson(t).get
} 
开发者ID:wellcometrust,项目名称:platform-api,代码行数:24,代码来源:Work.scala


示例19: PingMetrics

//设置package包名称以及导入依赖的类
package com.bwsw.sj.examples.pingstation.module.output.data

import java.util.Date

import com.bwsw.sj.engine.core.entities.{OutputData}
import com.fasterxml.jackson.annotation.JsonProperty


class PingMetrics extends OutputData {
  var ts: Date = null
  var ip: String = null
  @JsonProperty("avg-time") var avgTime: Double= 0
  @JsonProperty("total-ok") var totalOk: Long= 0
  @JsonProperty("total-unreachable") var totalUnreachable: Long= 0
  var total: Long = 0

  override def getDateFields(): Array[String] = {
    val fields = super.getDateFields().toBuffer
    fields.append("ts")
    fields.toArray
  }
} 
开发者ID:bwsw,项目名称:sj-fping-demo,代码行数:23,代码来源:PingMetrics.scala


示例20: Of

//设置package包名称以及导入依赖的类
package io.buoyant.namerd.storage.kubernetes

import com.fasterxml.jackson.annotation.{JsonProperty, JsonSubTypes, JsonTypeInfo}
import io.buoyant.k8s.{Status, Watch}

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonSubTypes(Array(
  new JsonSubTypes.Type(value = classOf[DtabAdded], name = "ADDED"),
  new Js 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Scala SSLException类代码示例发布时间:2022-05-23
下一篇:
Scala ValidatedNel类代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap