simplereach/helenus — pull request #88 by psanford (2012-11-19 23:28:42+00:00)
Title: Fix handling of reversed CFs for thrift users.

This is a fix for reversed types causing crashes when using the thrift interface. The Issue is very similar to # 67 except for thrift instead of CQL.

Helenus would crash on the following cf:

create column family run_log
with column_type = 'Standard'
and comparator = 'ReversedType(org.apache.cassandra.db.marshal.TimeUUIDType)'
and default_validation_class = 'UTF8Type'
and key_validation_class = 'UTF8Type'
and memtable_operations = 0.590625
and memtable_throughput = 126
and memtable_flush_after = 1440
and rows_cached = 0.0
and row_cache_save_period = 0
and keys_cached = 200000.0
and key_cache_save_period = 14400
and read_repair_chance = 1.0
and gc_grace = 864000
and min_compaction_threshold = 4
and max_compaction_threshold = 32
and replicate_on_write = true
and row_cache_provider = 'ConcurrentLinkedHashCacheProvider';

with this error:

TypeError: Cannot read property 'ser' of undefined
at getSerializer (/home/psanford/projects/nearbuy/storenet/node/cassandra/node_modules/helenus/lib/marshal/index.js:215:48)
at new Marshal (/home/psanford/projects/nearbuy/storenet/node/cassandra/node_modules/helenus/lib/marshal/index.js:254:20)
at new ColumnFamily (/home/psanford/projects/nearbuy/storenet/node/cassandra/node_modules/helenus/lib/column_family.js:186:27)
at onComplete (/home/psanford/projects/nearbuy/storenet/node/cassandra/node_modules/helenus/lib/keyspace.js:87:33)
at onReturn (/home/psanford/projects/nearbuy/storenet/node/cassandra/node_modules/helenus/lib/connection.js:357:7)
at exports.Connection.connection.addListener.self.transport.receiver.client._reqs.(anonymous function) (/home/psanford/projects/nearbuy/storenet/node/cassandra/node_modules/helenus/node_modules/helenus-thrift/lib/thrift/connection.js:80:11)
at Object.CassandraClient.recv_describe_keyspace (/home/psanford/projects/nearbuy/storenet/node/cassandra/node_modules/helenus/lib/cassandra/Cassandra.js:6641:12)
at exports.Connection (/home/psanford/projects/nearbuy/storenet/node/cassandra/node_modules/helenus/node_modules/helenus-thrift/lib/thrift/connection.js:83:37)
at Socket.TFramedTransport.receiver (/home/psanford/projects/nearbuy/storenet/node/cassandra/node_modules/helenus/node_modules/helenus-thrift/lib/thrift/transport.js:70:9)
at Socket.EventEmitter.emit (events.js:88:17)

This patch makes sure to parse the inner type the same way a normal column type is parsed.