avro-scala-macro-annotations | Compile-time tools for working with Avros in Scala | Computer Vision library
kandi X-RAY | avro-scala-macro-annotations Summary
kandi X-RAY | avro-scala-macro-annotations Summary
Compile-time tools for working with Avros in Scala
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of avro-scala-macro-annotations
avro-scala-macro-annotations Key Features
avro-scala-macro-annotations Examples and Code Snippets
{"type":"record","name":"MyRecord","namespace":"tutorial","doc":"Auto-generated schema","fields":[{"name":"x","type":{"type":"record","name":"Rec","doc":"Auto-generated schema","fields":[{"name":"i","type":"int","doc":"Auto-Generated Field"}]
package sample
@AvroRecord
case class A(var i: Int)
@AvroRecord
case class B(var a: Option[A] = None)
{"type":"record","name":"B","namespace":"sample","doc":"Auto-generated schema","fields":[{"name":
libraryDependencies += "com.julianpeeters" % "avro-scala-macro-annotations_2.11" % "0.11.1"
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
package sample
import com.julianpeeters.avro.an
Community Discussions
Trending Discussions on avro-scala-macro-annotations
QUESTION
I am experiencing a reproducible error while producing Avro messages with reactive kafka and avro4s. Once the identityMapCapacity
of the client (CachedSchemaRegistryClient
) is reached, serialization fails with
ANSWER
Answered 2017-Nov-20 at 07:35edit 2017.11.20
The issue in my case was that each instance of GenericRecord
carrying my message has been serialized by a different instance of RecordFormat
, containing a different instance of the Schema
. The implicit resolution here generated a new instance each time.
def toAvro[A](a: A)(implicit recordFormat: RecordFormat[A]): GenericRecord = recordFormat.to(a)
The solution was to pin the RecordFormat
instance to a val
and reuse it explicitly. Many thanks to https://github.com/heliocentrist for explaining the details.
original response:
After waiting for a while (also no answer for the github issue) I had to implement my own SchemaRegistryClient
. Over 90% is copied from the original CachedSchemaRegistryClient
, just translated into scala. Using a scala mutable.Map
fixed the memory leak. I have not performed any comprehensive tests, so use at your own risk.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install avro-scala-macro-annotations
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page