You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by fatih <fa...@gmail.com> on 2017/05/19 13:58:36 UTC

How to store Binary Object in Cassandra Backup Store

Hi 

I am working with BinaryObjects and i wanted to use Cassandra as a backup
store. However i could not manage. Could please explain how i can achieve
this.  

Persistence configuration i use is as below 

<persistence keyspace=“=triggers” table=“eventstreaming”><keyPersistence
class=“java.lang.String”
strategy=“PRIMITIVE”/><strategy=“BLOB”/></persistence>


The error I get is as below 

2017-05-19 16:07:12,497 [dockerjava-netty-3-4] INFO  ignite@localhost -
STDERR: [14:07:12,493][SEVERE][flusher-0-#27%null%][CassandraCacheStore]
Failed to process 1 of 1 elements, during BULK_WRITE operation with
Cassandra
2017-05-19 16:07:12,497 [dockerjava-netty-3-4] INFO  ignite@localhost -
STDERR: class org.apache.ignite.IgniteException: Failed to execute Cassandra
BULK_WRITE operation
2017-05-19 16:07:12,497 [dockerjava-netty-3-4] INFO  ignite@localhost -
STDERR: at
org.apache.ignite.cache.store.cassandra.session.CassandraSessionImpl.execute(CassandraSessionImpl.java:262)
2017-05-19 16:07:12,497 [dockerjava-netty-3-4] INFO  ignite@localhost -
STDERR: at
org.apache.ignite.cache.store.cassandra.CassandraCacheStore.writeAll(CassandraCacheStore.java:332)
2017-05-19 16:07:12,497 [dockerjava-netty-3-4] INFO  ignite@localhost -
STDERR: at
org.apache.ignite.internal.processors.cache.store.GridCacheWriteBehindStore.updateStore(GridCacheWriteBehindStore.java:685)
2017-05-19 16:07:12,498 [dockerjava-netty-3-4] INFO  ignite@localhost -
STDERR: at
org.apache.ignite.internal.processors.cache.store.GridCacheWriteBehindStore.applyBatch(GridCacheWriteBehindStore.java:618)
2017-05-19 16:07:12,498 [dockerjava-netty-3-4] INFO  ignite@localhost -
STDERR: at
org.apache.ignite.internal.processors.cache.store.GridCacheWriteBehindStore.access$1700(GridCacheWriteBehindStore.java:69)
2017-05-19 16:07:12,498 [dockerjava-netty-3-4] INFO  ignite@localhost -
STDERR: at
org.apache.ignite.internal.processors.cache.store.GridCacheWriteBehindStore$Flusher.flushCache(GridCacheWriteBehindStore.java:850)
2017-05-19 16:07:12,498 [dockerjava-netty-3-4] INFO  ignite@localhost -
STDERR: at
org.apache.ignite.internal.processors.cache.store.GridCacheWriteBehindStore$Flusher.body(GridCacheWriteBehindStore.java:754)
2017-05-19 16:07:12,498 [dockerjava-netty-3-4] INFO  ignite@localhost -
STDERR: at
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
2017-05-19 16:07:12,498 [dockerjava-netty-3-4] INFO  ignite@localhost -
STDERR: at java.lang.Thread.run(Thread.java:745)
2017-05-19 16:07:12,498 [dockerjava-netty-3-4] INFO  ignite@localhost -
STDERR: Caused by: java.lang.IllegalArgumentException: Couldn't deserialize
instance of class 'org.apache.ignite.internal.binary.BinaryObjectImpl' using
PRIMITIVE strategy. Please use BLOB strategy for this case.
2017-05-19 16:07:12,498 [dockerjava-netty-3-4] INFO  ignite@localhost -
STDERR: at
org.apache.ignite.cache.store.cassandra.persistence.PersistenceController.bindValues(PersistenceController.java:431)
2017-05-19 16:07:12,498 [dockerjava-netty-3-4] INFO  ignite@localhost -
STDERR: at
org.apache.ignite.cache.store.cassandra.persistence.PersistenceController.bindKeyValue(PersistenceController.java:203)
2017-05-19 16:07:12,498 [dockerjava-netty-3-4] INFO  ignite@localhost -
STDERR: at
org.apache.ignite.cache.store.cassandra.CassandraCacheStore$4.bindStatement(CassandraCacheStore.java:346)
2017-05-19 16:07:12,498 [dockerjava-netty-3-4] INFO  ignite@localhost -
STDERR: at
org.apache.ignite.cache.store.cassandra.CassandraCacheStore$4.bindStatement(CassandraCacheStore.java:332)
2017-05-19 16:07:12,498 [dockerjava-netty-3-4] INFO  ignite@localhost -
STDERR: at
org.apache.ignite.cache.store.cassandra.session.CassandraSessionImpl.execute(CassandraSessionImpl.java:226)
2017-05-19 16:07:12,498 [dockerjava-netty-3-4] INFO  ignite@localhost -
STDERR: ... 8 more





--
View this message in context: http://apache-ignite-developers.2346864.n4.nabble.com/How-to-store-Binary-Object-in-Cassandra-Backup-Store-tp17827.html
Sent from the Apache Ignite Developers mailing list archive at Nabble.com.

Re: How to store Binary Object in Cassandra Backup Store

Posted by irudyak <ir...@gmail.com>.
You are using invalid persistence descriptor. It should be something like:

*<persistence keyspace="my_keyspace" table="my_table">
	<keyPersistence class="java.lang.String" strategy="PRIMITIVE"/>
	<valuePersistence class="org.mycompany.MyValueClass" strategy="BLOB"/>
</persistence>*

You can find more details about persistence descriptor configuration here: 
https://apacheignite-mix.readme.io/docs/base-concepts#section-persistencesettingsbean
<https://apacheignite-mix.readme.io/docs/base-concepts#section-persistencesettingsbean>  



--
View this message in context: http://apache-ignite-developers.2346864.n4.nabble.com/How-to-store-Binary-Object-in-Cassandra-Backup-Store-tp17827p17843.html
Sent from the Apache Ignite Developers mailing list archive at Nabble.com.