This is a standalone deserialize/parse example if you just want to deserialize thrift decoupled from cassandra server 1. acquire thrift template specification files from who ever built it (eg: EXAMPLE.thrift) 2. Install thrift on local machine 3. generate thrift clients for nodejs usin
(thriftEncodedData, callback)
| 35 | */ |
| 36 | |
| 37 | function parseThrift(thriftEncodedData, callback) { |
| 38 | var thrift = require("thrift"); |
| 39 | var transport = new thrift.TFramedTransport(thriftEncodedData); |
| 40 | var protocol = new thrift.TBinaryProtocol(transport); |
| 41 | |
| 42 | var clientClass = require("../gen-nodejs/GENERATED").YOUR_CLASS_NAME; |
| 43 | var client = new clientClass(); |
| 44 | client.read(protocol); |
| 45 | callback(null, client); |
| 46 | } |