incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vladimir Prudnikov <v.prudni...@gmail.com>
Subject Custom data type class in pycassa
Date Sat, 10 Aug 2013 14:20:16 GMT
Hi all,
I use pycassa and I want to store lists and tuples in cassandra by
serializing them using MessagePack. Seems like custom data type is what I
need. Here is data type I created:
##########################################
class MyListType(CassandraType):
    @staticmethod
    def pack(value):
        return msgpack.packb(value)

    @staticmethod
    def unpack(value):
        return msgpack.unpackb(value)
##########################################
Now I'm creating a new column family and use instance of this class in
column_validation_classes but unsuccessful. It raises
"InvalidRequestException: InvalidRequestException(why="Unable to find
abstract-type class 'org.apache.cassandra.db.marshal.MyListType'")".

What I'm doing wrong? How to do it properly?
Thanks.
-- 
Vladimir Prudnikov

Mime
View raw message