[
https://issues.apache.org/jira/browse/CASSANDRA-5312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13592886#comment-13592886
]
chris erway commented on CASSANDRA-5312:
----------------------------------------
I figured it out after reading the SSTable version & file-naming stuff in
[Descriptor.java|https://github.com/apache/cassandra/blob/cassandra-1.2.1/src/java/org/apache/cassandra/io/sstable/Descriptor.java#L89].
These JSON files were dumped from older 1.1.x tables, and I was loading them
on a new 1.2 cluster that uses Murmur3 hashes, but was specifying the old "hd",
"hf", and "ib" names as output filenames (Keyspace-CFName-hd-1-Data.db above).
So:
{noformat}
$ sudo -u cassandra json2sstable -K Keyspace -c CFName
Keyspace-CFName-hd-1-Data.db.json Keyspace-CFName-ib-1-Data.db
log4j:WARN No appenders could be found for logger
(org.apache.cassandra.config.DatabaseDescriptor).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more
info.
Importing 21 keys...
21 keys imported successfully.
{noformat}
BTW, the JSON format used by sstable2json changed in 1.2 & here's a quick
migration assistant for anyone who finds this useful:
{noformat}
sed 's/^"\([^"]*\)": \(.*\)\]\]/{"key": "\1", "columns": \2]]}/'
{noformat}
Sorry for filing a bogus issue!
> json2sstable throws java.lang.ClassCastException when using Murmur3
> -------------------------------------------------------------------
>
> Key: CASSANDRA-5312
> URL: https://issues.apache.org/jira/browse/CASSANDRA-5312
> Project: Cassandra
> Issue Type: Bug
> Components: Tools
> Affects Versions: 1.2.1
> Environment: DataStax community AMI
> Reporter: chris erway
> Priority: Minor
>
> Tried to import some JSON tables using json2sstable today on a new cluster
> using the Murmur3Partitioner. It threw this exception:
> $ sudo -u cassandra json2sstable -K Keyspace -c CFName
> Keyspace-CFName-hd-1-Data.db.json Keyspace-CFName-hd-1-Data.db
> log4j:WARN No appenders could be found for logger
> (org.apache.cassandra.config.DatabaseDescriptor).
> log4j:WARN Please initialize the log4j system properly.
> log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more
> info.
> Importing 21 keys...
> java.lang.ClassCastException: org.apache.cassandra.utils.Murmur3BloomFilter
> cannot be cast to org.apache.cassandra.utils.Murmur2BloomFilter
> at
> org.apache.cassandra.utils.FilterFactory.serialize(FilterFactory.java:56)
> at
> org.apache.cassandra.io.sstable.SSTableWriter$IndexWriter.close(SSTableWriter.java:482)
> at
> org.apache.cassandra.io.sstable.SSTableWriter.closeAndOpenReader(SSTableWriter.java:325)
> at
> org.apache.cassandra.io.sstable.SSTableWriter.closeAndOpenReader(SSTableWriter.java:319)
> at
> org.apache.cassandra.tools.SSTableImport.importUnsorted(SSTableImport.java:379)
> at
> org.apache.cassandra.tools.SSTableImport.importJson(SSTableImport.java:313)
> at org.apache.cassandra.tools.SSTableImport.main(SSTableImport.java:535)
> ERROR: org.apache.cassandra.utils.Murmur3BloomFilter cannot be cast to
> org.apache.cassandra.utils.Murmur2BloomFilter
> There's a related issue in CASSANDRA-4196 having to do with bulk loading that
> suggests a fix might involve passing the right type down to the FilterFactory.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira