Cassandra 2.0.5、Storm バージョン 0.9.0.1 のテーブルに単純な行を挿入しようとしています。
私のテストは次のとおりです。
ID (int) と文 (text) 列で構成されるテーブルがあります。id は主キーです。
私のスパウトは文を生成し、ID (コードの静的インクリメント) を追加します。
これは私のトポロジです:
TridentTopology topology = new TridentTopology();
StateFactory cassandraStateFactory = CassandraMapState.nonTransactional(options);
Fields fields = new Fields("id", "sentence");
MyTridentTupleMapper tupleMapper = new MyTridentTupleMapper(keyspace, fields);
CassandraUpdater updater = new CassandraUpdater(tupleMapper);
TridentState wordCounts = topology.newStream("spout1", spout)
.each(new Fields("sentence"), new AddId(), new Fields("id"))
.partitionPersist(cassandraStateFactory, fields, updater);
LocalCluster cluster = new LocalCluster();
cluster.submitTopology("test", config, topology.build());
MyTridentTupleMapper のコード:
次の例外が発生します。
2014-02-08 22:20:14 ERROR executor:0 -
java.lang.RuntimeException: java.lang.ClassCastException: storm.trident.state.map.SnapshottableMap cannot be cast to com.hmsonline.storm.cassandra.trident.CassandraState
at backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:90)
at backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:61)
at backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:62)
at backtype.storm.daemon.executor$fn__3498$fn__3510$fn__3557.invoke(executor.clj:730)
at backtype.storm.util$async_loop$fn__444.invoke(util.clj:403)
at clojure.lang.AFn.run(AFn.java:24)
at java.lang.Thread.run(Thread.java:744)
なぜこれが返されるのかわかりません。助けていただければ幸いです。