cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kuku1 (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CASSANDRA-12012) CQLSSTableWriter and composite clustering keys trigger NPE
Date Mon, 25 Jul 2016 15:11:20 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-12012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15391929#comment-15391929
] 

Kuku1 edited comment on CASSANDRA-12012 at 7/25/16 3:11 PM:
------------------------------------------------------------

I've added that before but it also gave me different Exceptions to fiddle with:

{code}
Exception in thread "main" java.lang.ExceptionInInitializerError
        at org.apache.cassandra.SchemaLoader.cleanupAndLeaveDirs(SchemaLoader.ja
va:427)
        at de.xxx.bdrc.cassandrajsonimporter.CassandraJsonImporter.main(Cassand
raJsonImporter.java:67)
Caused by: java.lang.NullPointerException
        at org.apache.cassandra.config.DatabaseDescriptor.getMaxMutationSize(Dat
abaseDescriptor.java:1258)
        at org.apache.cassandra.db.commitlog.CommitLog.<init>(CommitLog.java:66)

        at org.apache.cassandra.db.commitlog.CommitLog.construct(CommitLog.java:
78)
        at org.apache.cassandra.db.commitlog.CommitLog.<clinit>(CommitLog.java:6
2)
        ... 2 more
{code}

Maybe there is something else I am missing, for example a configuration file? 
I am running the program on a Client which does not have Cassandra installed/running.



was (Author: kuku1):
I've added that before but it also gave me different Exceptions to fiddle with:

{code}
Exception in thread "main" java.lang.ExceptionInInitializerError
        at org.apache.cassandra.SchemaLoader.cleanupAndLeaveDirs(SchemaLoader.ja
va:427)
        at de.vwag.bdrc.cassandrajsonimporter.CassandraJsonImporter.main(Cassand
raJsonImporter.java:67)
Caused by: java.lang.NullPointerException
        at org.apache.cassandra.config.DatabaseDescriptor.getMaxMutationSize(Dat
abaseDescriptor.java:1258)
        at org.apache.cassandra.db.commitlog.CommitLog.<init>(CommitLog.java:66)

        at org.apache.cassandra.db.commitlog.CommitLog.construct(CommitLog.java:
78)
        at org.apache.cassandra.db.commitlog.CommitLog.<clinit>(CommitLog.java:6
2)
        ... 2 more
{code}

Maybe there is something else I am missing, for example a configuration file? 
I am running the program on a Client which does not have Cassandra installed/running.


> CQLSSTableWriter and composite clustering keys trigger NPE
> ----------------------------------------------------------
>
>                 Key: CASSANDRA-12012
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-12012
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Streaming and Messaging
>            Reporter: Pierre N.
>            Assignee: Mahdi Mohammadi
>
> It triggers when using multiple clustering keys in the primary keys
> {code}
> package tests;
> import java.io.File;
> import org.apache.cassandra.io.sstable.CQLSSTableWriter;
> import org.apache.cassandra.config.Config;
> public class DefaultWriter {
>     
>     public static void main(String[] args) throws Exception {
>         Config.setClientMode(true);
>         
>         String createTableQuery = "CREATE TABLE ks_test.table_test ("
>         + "    pk1 int,"
>         + "    ck1 int,"
>         + "    ck2 int,"
>         + "    PRIMARY KEY ((pk1), ck1, ck2)"
>         + ");";
>         String insertQuery = "INSERT INTO ks_test.table_test(pk1, ck1, ck2) VALUES(?,?,?)";
>         
>         CQLSSTableWriter writer = CQLSSTableWriter.builder()
>             .inDirectory(Files.createTempDirectory("sst").toFile())
>             .forTable(createTableQuery)
>             .using(insertQuery)
>             .build();
>         writer.close();
>     }
> }
> {code}
> Exception : 
> {code}
> Exception in thread "main" java.lang.ExceptionInInitializerError
> 	at org.apache.cassandra.db.Keyspace.initCf(Keyspace.java:368)
> 	at org.apache.cassandra.db.Keyspace.<init>(Keyspace.java:305)
> 	at org.apache.cassandra.db.Keyspace.open(Keyspace.java:129)
> 	at org.apache.cassandra.db.Keyspace.open(Keyspace.java:106)
> 	at org.apache.cassandra.db.Keyspace.openAndGetStore(Keyspace.java:159)
> 	at org.apache.cassandra.cql3.restrictions.PrimaryKeyRestrictionSet.hasSupportingIndex(PrimaryKeyRestrictionSet.java:156)
> 	at org.apache.cassandra.cql3.restrictions.PrimaryKeyRestrictionSet.<init>(PrimaryKeyRestrictionSet.java:118)
> 	at org.apache.cassandra.cql3.restrictions.PrimaryKeyRestrictionSet.mergeWith(PrimaryKeyRestrictionSet.java:213)
> 	at org.apache.cassandra.cql3.restrictions.StatementRestrictions.addSingleColumnRestriction(StatementRestrictions.java:266)
> 	at org.apache.cassandra.cql3.restrictions.StatementRestrictions.addRestriction(StatementRestrictions.java:250)
> 	at org.apache.cassandra.cql3.restrictions.StatementRestrictions.<init>(StatementRestrictions.java:159)
> 	at org.apache.cassandra.cql3.statements.UpdateStatement$ParsedInsert.prepareInternal(UpdateStatement.java:183)
> 	at org.apache.cassandra.cql3.statements.ModificationStatement$Parsed.prepare(ModificationStatement.java:782)
> 	at org.apache.cassandra.cql3.statements.ModificationStatement$Parsed.prepare(ModificationStatement.java:768)
> 	at org.apache.cassandra.cql3.QueryProcessor.getStatement(QueryProcessor.java:505)
> 	at org.apache.cassandra.io.sstable.CQLSSTableWriter$Builder.getStatement(CQLSSTableWriter.java:508)
> 	at org.apache.cassandra.io.sstable.CQLSSTableWriter$Builder.using(CQLSSTableWriter.java:439)
> 	at tests.DefaultWriter.main(DefaultWriter.java:29)
> Caused by: java.lang.NullPointerException
> 	at org.apache.cassandra.config.DatabaseDescriptor.getFlushWriters(DatabaseDescriptor.java:1188)
> 	at org.apache.cassandra.db.ColumnFamilyStore.<clinit>(ColumnFamilyStore.java:127)
> 	... 18 more
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message