Questions tagged [scrooge]

Scrooge is a thrift code generator written in Scala, which currently generates code for Scala and Java.

Scrooge is a thrift code generator written in Scala, which currently generates code for Scala and Java.

It’s meant to be a replacement for the apache thrift code generator, and generates conforming, binary-compatible codecs by building on top of libthrift.

Features:

  • Generates native Scala thrift codecs
  • Generated code is templated using a mustache variant, making it easy to edit.
  • Finagle client/server adaptors can be optionally generated at the same time.
  • Has a plugable backend providing a dynamic way to add more generator targets.

Home page: http://twitter.github.io/scrooge/

26 questions
13
votes
2 answers

What is the repository for scrooge-sbt-plugin?

What is the repository for the current version of scrooge-sbt-plugin? Or are the setup instructions outdated? According to the documentation, I added this to a Play Framework project: In project/plugins.sbt addSbtPlugin("com.twitter" %%…
Fernando Correia
  • 21,803
  • 13
  • 83
  • 116
7
votes
1 answer

How do I install and use Scrooge

I want to write a Thrift service using Scrooge. Thrift has almost no documentation and Scrooge has even less. How do I install Scrooge on an Ubuntu or OSX machine? Once installed, and I have created a .thrift, how do I use Scrooge to generate server…
Eric Hartford
  • 16,464
  • 4
  • 33
  • 50
5
votes
1 answer

Not able to compile source generated by the scrooge thrift plugin

My plugins.sbt is addSbtPlugin("com.twitter" % "scrooge-sbt-plugin" % "4.8.0") My build.sbt is val finagleVersion = "6.45.0" lazy val myProject = Project("FinagleTest", file(".")) .settings( name := "FinagleTest", version := "1.0", …
Knows Not Much
  • 30,395
  • 60
  • 197
  • 373
5
votes
3 answers

Write a thrift server in scala using scrooge and client in python or ruby

I want to write a thrift service implementation in Scala (using Scrooge) but without the use of Finagle, since I couldn't write a ruby/python client for Finagle servers. The problem is that with scrooge the service doesn't seem to implement…
Ahmed Farghal
  • 1,294
  • 11
  • 17
4
votes
0 answers

Unable to convert Scrooge generated classes to maps using Shapeless

I'm using Scrooge to generate classes. They look something like this, here's an example: object Flags extends ThriftStructCodec3[Flags] { private val NoPassthroughFields = immutable$Map.empty[Short, TFieldBlob] val Struct = new TStruct("Flags") …
Maria Livia
  • 75
  • 1
  • 9
4
votes
0 answers

How do I generate thrift implementations in both scala and java using scrooge and sbt

lets say I have a thrift file #@namespace scala com.project.artifact.thrift namespace java com.project.artifact.java.thrift service SomeService { string helloWorld() } where different name spaces are provided for java and scala. Now I know i…
Mike McFarland
  • 657
  • 4
  • 17
3
votes
2 answers

How do I close a Finagle Thrift client?

I'm using scrooge + thrift to generate my server and client code. Everything is working just fine so far. Here's a simplified example of how I use my client: private lazy val client = Thrift.newIface[MyPingService[Future]](s"$host:$port") def…
Chris Eberle
  • 47,994
  • 12
  • 82
  • 119
3
votes
1 answer

How can I declare a method which returns an Option value in Thrift/Scrooge?

I'm using Scrooge to generate Thrift interface code as follows: struct UserInfo { 1: i64 userId, 2: string name } service userservice { UserInfo getUserById(1:i64 userId) } Scrooge will generate this method from the IDL file above: def…
Haizi
  • 678
  • 5
  • 8
3
votes
1 answer

How do I execute Scrooge from commandline?

I was able to include scrooge in my SBT project (the scrooge-sbt-plugin in my plugins.sbt as well as the library dependencies in my build.sbt), but I haven't been able to figure out how to execute scrooge from the commandline as listed here…
anshumans
  • 4,045
  • 2
  • 18
  • 25
2
votes
0 answers

Generate Scala case class with scrooge

I am trying to generate scala a Case Class from a .thrift file but scrooge will generate for my example an object + trait from a struct like below: Do you know whether it's possible to generate directly a case class using scrooge? namespace java…
tonizz
  • 116
  • 1
  • 8
2
votes
1 answer

How to use Thrift Scala classes generated by Scrooge?

I'm new to Thrift and only recently have learned how to write basic thrift services and implement client/server in Java and Python. I want to use Thrift in Scala and didn't want to use Java like syntax. So came across Scrooge. What exactly is the…
Chetan Bhasin
  • 3,503
  • 1
  • 23
  • 36
1
vote
0 answers

How to read and write parquet files from scrooge?

I have a generated scrooge scala class, I'm trying to understand how to write instances of this class into parquet file. I cant find any updated example, and there is zero documentation about it.
NetanelRabinowitz
  • 1,534
  • 2
  • 14
  • 26
1
vote
1 answer

Get scrooge to generate source files in test phase?

I have a multi module build that looks kind of like: lazy val root = (project in file(".")). settings(common). aggregate(finagle_core, finagle_thrift) lazy val finagle_core = project. settings(common). settings(Seq( name :=…
devshorts
  • 8,572
  • 4
  • 50
  • 73
1
vote
0 answers

How do I start a thrift server in Scala?

I have a thrift service implemented in scala that I would like to serve. I'm using scrooge with finagle for the server. It seems to be running fine, however, whenever I try to connect a client and actually do an RPC, the client and the server seems…
spearmunkie
  • 21
  • 1
  • 7
1
vote
0 answers

How to modify settings and tasks in plugin based on another plugin's availability?

In the build.sbt file of a plugin I have written I have the following two lines: scroogeThriftDependencies in Compile := Seq("shared_2.10") mappings in (Compile,packageBin) ~= { (ms: Seq[(File, String)]) => ms filter { case (file, toPath) => …
reikje
  • 2,850
  • 2
  • 24
  • 44
1
2