case class TopicModel(name: String, creationTime: Long, partitions: Int, replicas: Int, topicDataType: String, keyFieldName: Option[String], headersFieldName: Option[String], valueFieldsNames: Option[Seq[String]], useAvroSchemaManager: Boolean, schema: BsonDocument, topicCompression: TopicCompression = TopicCompression.Disabled, subjectStrategy: SubjectStrategy = SubjectStrategy.None, keySchema: Option[String] = None, clusterAlias: Option[String] = None, schemaId: Option[Long] = None) extends DatastoreModel with Product with Serializable
A model for a topic, that is, a message queue of some sort. Right now this means just Kafka topics.
- name
the name of the topic, and doubles as the unique identifier for the model in the models database
- creationTime
marks the time at which the model was generated.
- partitions
the number of partitions used for the topic when wasp creates it
- replicas
the number of replicas used for the topic when wasp creates it
- topicDataType
field specifies the format to use when encoding/decoding data to/from messages, allowed values are: avro, plaintext, json, binary
- keyFieldName
optionally specify a field whose contents will be used as a message key when writing to Kafka. The field must be of type string or binary. The original field will be left as-is, so you schema must handle it (or you can use
valueFieldsNames).- headersFieldName
allows you to optionally specify a field whose contents will be used as message headers when writing to Kafka. The field must contain an array of non-null objects which must have a non-null field
headerKeyof type string and a fieldheaderValueof type binary. The original field will be left as-is, so your schema must handle it (or you can usevalueFieldsNames).- valueFieldsNames
allows you to specify a list of field names to be used to filter the fields that get passed to the value encoding; with this you can filter out fields that you don't need in the value, obviating the need to handle them in the schema. This is especially useful when specifying the
keyFieldNameorheadersFieldName. For the avro and json topic data type this is optional; for the plaintext and binary topic data types this field is mandatory and the list must contain a single value field name that has the proper type (string for plaintext and binary for binary).- useAvroSchemaManager
if a schema registry should be used or not to handle the schema evolution (it makes sense only for avro message datatype)
- schema
the Avro schema to use when encoding the value, for plaintext and binary this field is ignored. For json and avro the field names need to match 1:1 with the valueFieldsNames or the schema output of the strategy
- topicCompression
to use to compress messages
- subjectStrategy
subject strategy to use when registering the schema to the schema registry for the schema registry implementations that support it. This property makes sense only for avro and only if useAvroSchemaManager is set to true
- keySchema
the schema to be used to encode the key as avro
- Alphabetic
- By Inheritance
- TopicModel
- Serializable
- Serializable
- Product
- Equals
- DatastoreModel
- Model
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
TopicModel(name: String, creationTime: Long, partitions: Int, replicas: Int, topicDataType: String, keyFieldName: Option[String], headersFieldName: Option[String], valueFieldsNames: Option[Seq[String]], useAvroSchemaManager: Boolean, schema: BsonDocument, topicCompression: TopicCompression = TopicCompression.Disabled, subjectStrategy: SubjectStrategy = SubjectStrategy.None, keySchema: Option[String] = None, clusterAlias: Option[String] = None, schemaId: Option[Long] = None)
- name
the name of the topic, and doubles as the unique identifier for the model in the models database
- creationTime
marks the time at which the model was generated.
- partitions
the number of partitions used for the topic when wasp creates it
- replicas
the number of replicas used for the topic when wasp creates it
- topicDataType
field specifies the format to use when encoding/decoding data to/from messages, allowed values are: avro, plaintext, json, binary
- keyFieldName
optionally specify a field whose contents will be used as a message key when writing to Kafka. The field must be of type string or binary. The original field will be left as-is, so you schema must handle it (or you can use
valueFieldsNames).- headersFieldName
allows you to optionally specify a field whose contents will be used as message headers when writing to Kafka. The field must contain an array of non-null objects which must have a non-null field
headerKeyof type string and a fieldheaderValueof type binary. The original field will be left as-is, so your schema must handle it (or you can usevalueFieldsNames).- valueFieldsNames
allows you to specify a list of field names to be used to filter the fields that get passed to the value encoding; with this you can filter out fields that you don't need in the value, obviating the need to handle them in the schema. This is especially useful when specifying the
keyFieldNameorheadersFieldName. For the avro and json topic data type this is optional; for the plaintext and binary topic data types this field is mandatory and the list must contain a single value field name that has the proper type (string for plaintext and binary for binary).- useAvroSchemaManager
if a schema registry should be used or not to handle the schema evolution (it makes sense only for avro message datatype)
- schema
the Avro schema to use when encoding the value, for plaintext and binary this field is ignored. For json and avro the field names need to match 1:1 with the valueFieldsNames or the schema output of the strategy
- topicCompression
to use to compress messages
- subjectStrategy
subject strategy to use when registering the schema to the schema registry for the schema registry implementations that support it. This property makes sense only for avro and only if useAvroSchemaManager is set to true
- keySchema
the schema to be used to encode the key as avro
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- val clusterAlias: Option[String]
- val creationTime: Long
-
def
datastoreProduct: DatastoreProduct
- Definition Classes
- TopicModel → DatastoreModel
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getJsonSchema: String
- val headersFieldName: Option[String]
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val keyFieldName: Option[String]
- val keySchema: Option[String]
-
val
name: String
- Definition Classes
- TopicModel → Model
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val partitions: Int
- val replicas: Int
- val schema: BsonDocument
- val schemaId: Option[Long]
- val subjectStrategy: SubjectStrategy
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- val topicCompression: TopicCompression
- val topicDataType: String
- val useAvroSchemaManager: Boolean
- val valueFieldsNames: Option[Seq[String]]
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()