5 Replies Latest reply on Aug 29, 2016 11:37 AM by Tristan Tarrant

    Infinispan8 with cassandra-cache-store

    Sreeram Kosaraju Newbie



      I recently upgraded my infinispan 7 to 8.2.0 and changed the module.xml to pick up the new 8.2 jars.

      Also installed cassandra 3.7 on my two nodes and added the <persistence> and <cassandra-store> to my infinispan caches..


      The cache entries(<k<String>,v<someObject>>) are getting persisted and replicated across the 2 nodes.


      When I look at the cassandra tables (created by default by the framework), the table structure is as follows:


      CREATE TABLE mykeyspace.test (

          key blob PRIMARY KEY,

          metadata blob,

          value blob.......)


      All keys and values are stored in the hexadecimal format.

      These are unreadable and doesn't solve my purpose.


      I also tried blobAsText function in my select query to convert these values but I get the following error:


      InvalidRequest: code=2200 [Invalid query] message="In call to function system.blobastext, value 0x0301fe3e2353565269702d31302d3230312d38382d3231343135343837373734363735353633313700000000 is not a valid binary representation for type text"


      So I dropped my table and re-created manually using the below cql:


      CREATE TABLE mykeyspace.test (key text PRIMARY KEY, value blob, metadata blob);


      Now, when I restart my application, it throws the following error:


      Caused by: com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [varchar <-> java.nio.HeapByteBuffer]

              at com.datastax.driver.core.CodecRegistry.notFound(CodecRegistry.java:679) [cassandra-driver-core-3.0.0-rc1.jar:]

              at com.datastax.driver.core.CodecRegistry.createCodec(CodecRegistry.java:540) [cassandra-driver-core-3.0.0-rc1.jar:]

              at com.datastax.driver.core.CodecRegistry.findCodec(CodecRegistry.java:520) [cassandra-driver-core-3.0.0-rc1.jar:]

              at com.datastax.driver.core.CodecRegistry.codecFor(CodecRegistry.java:470) [cassandra-driver-core-3.0.0-rc1.jar:]

              at com.datastax.driver.core.AbstractGettableByIndexData.codecFor(AbstractGettableByIndexData.java:77) [cassandra-driver-core-3.0.0-rc1.jar:]

              at com.datastax.driver.core.BoundStatement.bind(BoundStatement.java:196) [cassandra-driver-core-3.0.0-rc1.jar:]

              at com.datastax.driver.core.DefaultPreparedStatement.bind(DefaultPreparedStatement.java:124) [cassandra-driver-core-3.0.0-rc1.jar:]

              at org.infinispan.persistence.cassandra.CassandraStore.load(CassandraStore.java:187) [infinispan-cachestore-cassandra-8.2.0.Final.jar:8.2.0.Final]

              ... 94 more


      I want to see the keys in plain text in my tables.

      Appreciate your help on this.