Cassandra json2sstable Null Pointer Exception
I'm using Cassandra 0.7.4. I have been breaking my head for most of today to make a simple import with json2sstable util. I'm in Test Cluster.
I create a simple keyspace KS1.
I create a simple CF mycf.
I insert a row with only one column like set mycf[key1][col1]='col1value'
I export the above with sstable2json util to a file called out. But when I try the reverse (import) it always gives NPE.
C:\>json2sstable -K KS1 -c mycf C:/out C:/var/lib/cassandra/data/kS1/mycf-f-2-Data.db
java.lang.NullPointerException
at org.apache.cassandra.db.ColumnFamily.create(ColumnFamily.java:67)
at org.apache.cassandra.db.ColumnFamily.create(ColumnFamily.java:61)
at org.apache.cassandra.tools.SSTableImport.importJson(SSTableImport.java:194)
at org.apache.cassandra.tools.SSTableImport.main(SSTableImport.java:421)
ERROR: null
I looked at the source code. There is an assert where the CFMetaData is checked to b开发者_StackOverflow中文版e not null. This is obviously saying it is null but why?
any suggestions greatly appreciated.
Ok this is what I did - I couldnt delete the post so just recording what I did. I did a fresh install of Cassandra 0.7.4. I did the same steps again. This time I just changed the timestamp value of the column a little (some random increase). The NPE was gone but it gave a out of memory error. I read here if you get the OOM error you can resolve it by changing the compaction setting in cassandra.yaml. Changed that and it works now. I really dont know which of the steps fixed the problem.
精彩评论