-
Notifications
You must be signed in to change notification settings - Fork 186
Thrift columns
These columns are especially useful if you are building Thrift services. They are deeply integrated with Twitter Scrooge and relevant to the Twitter ecosystem(Finagle, Zipkin, Storm etc)
They are available via the phantom-thrift
module and you need to import the Thrift package to get all necessary types into scope.
import com.websudos.phantom.thrift._
In the below scenario, the Cassandra type is always text and the type you need to pass to the column is a Thrift struct, specifically com.twitter.scrooge .ThriftStruct
.
phantom will use a CompactThriftSerializer
, store the record as a binary string and then reparse it on fetch.
Thrift serialization and de-serialization is extremely fast, so you don't need to worry about speed or performance overhead. You generally use these to store collections(small number of items), not big things.
phantom columns | Cassandra columns |
---|---|
ThriftColumn.<type> | text |
ThriftListColumn.<type> | list<text> |
ThriftSetColumn.<type> | set<text> |
ThriftMapColumn.<type, type> | map<text, text> |
To stay up-to-date with our latest releases and news, follow us on Twitter: @outworkers.
- Issues and questions
- Adopters
- Roadmap
- Changelog
- Tutorials
- Commercial support
- Using phantom in your project
- Primitive columns
- Optional primitive columns
- Collection columns
- Collection operators
- Automated schema generation
- Indexing columns
- Data modeling with phantom
- Querying with phantom
- Asynchronous iterators
- Batch statements
- Apache Thrift integration
- Apache ZooKeeper integration
- The phantom testkit