Class CassandraTypeDeserializer


  • @ThreadSafe
    @Immutable
    public final class CassandraTypeDeserializer
    extends Object
    • Field Detail

      • TYPE_MAP

        private static final Map<Class<? extends org.apache.cassandra.db.marshal.AbstractType>,​TypeDeserializer> TYPE_MAP
    • Constructor Detail

      • CassandraTypeDeserializer

        private CassandraTypeDeserializer()
    • Method Detail

      • deserialize

        public static Object deserialize​(com.datastax.driver.core.DataType dataType,
                                         ByteBuffer bb)
        Deserialize from snapshot/datastax-sourced cassandra data.
        Parameters:
        dataType - the DataType of the object
        bb - the bytes of the column to deserialize
        Returns:
        the deserialized object.
      • deserialize

        public static Object deserialize​(org.apache.cassandra.db.marshal.AbstractType<?> abstractType,
                                         ByteBuffer bb)
        Deserialize from cdc-log-sourced cassandra data.
        Parameters:
        abstractType - the AbstractType of the non-collection column
        bb - the bytes of the non-collection column to deserialize
        Returns:
        the deserialized object.
      • deserialize

        public static Object deserialize​(org.apache.cassandra.db.marshal.CollectionType<?> collectionType,
                                         org.apache.cassandra.db.rows.ComplexColumnData ccd)
        Deserialize from cdc-log-sourced cassandra data.
        Parameters:
        collectionType - the CollectionType of the collection column
        ccd - the ComplexColumnData of the collection column to deserialize
        Returns:
        the deserialized object.
      • getSchemaBuilder

        public static org.apache.kafka.connect.data.SchemaBuilder getSchemaBuilder​(org.apache.cassandra.db.marshal.AbstractType<?> abstractType)
        Construct a kafka connect SchemaBuilder object from a Cassandra data type
        Parameters:
        abstractType - implementation of Cassandra's AbstractType
        Returns:
        the kafka connect SchemaBuilder object
      • getTypeDeserializer

        public static TypeDeserializer getTypeDeserializer​(org.apache.cassandra.db.marshal.AbstractType<?> abstractType)
        Get TypeDeserializer of AbstractType
        Parameters:
        abstractType - the AbstractType of a column in cassandra
        Returns:
        the TypeDeserializer of the AbstractType.