如何在Scala中声明复合串行器

时间:2014-09-13 10:33:05

标签: scala cassandra hector cassandra-cli serializer

import me.prettyprint.cassandra.serializers._
import me.prettyprint.hector.api._
import me.prettyprint.hector.api.factory.HFactory

val se = StringSerializer.get()
val le = LongSerializer.get.asInstanceOf[Serializer[Long]]
val be = BooleanSerializer.get.asInstanceOf[Serializer[Boolean]]

但我没有得到如何声明CompositeSerializer 我试过了

val ce = CompositeSerializer.get

val ce = CompositeSerializer.get.asInstanceOf[Serializer[Composite]]

但没有任何作用

1 个答案:

答案 0 :(得分:0)

val ce = new CompositeSerializer()