guardian / marley

Marley is a library for serialising Scrooge generated classes representing Thrift objects as Avro with minimal boilerplate.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Marley Maven Central

Marley is a library for serialising Scrooge generated classes representing Thrift objects as Avro with minimal boilerplate.

Installation

libraryDependencies ++= Seq(
  "com.gu" %% "marley" % "0.2.16"
)

Usage

import com.gu.marley._

implicit val enumSer = AvroSerialisable.enum[ExampleEnum]
implicit val structSer = AvroSerialisable.struct[ExampleStruct]

AvroFile.write(Seq(struct))(file)

val readStructs: Iterable[ExampleStruct] = AvroFile.read[ExampleStruct](file)

Is this usable in production?

Marley has been extracted from a project where it's been running successfully for a number of months.

Marley is macro based and doesn't perform any runtime reflection. I haven't done any micro-benchmarking, but it's currently serialising more than 5000 reasonably complicated messages/minute on an EC2 t2.medium without breaking a sweat.

License

Marley is licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Marley is a library for serialising Scrooge generated classes representing Thrift objects as Avro with minimal boilerplate.

License:Other


Languages

Language:Scala 96.1%Language:Thrift 3.9%