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

Benjamin Lerer commented on CASSANDRA-9052:
-------------------------------------------

This ticket has nothing to do with CASSANDRA-8281. In CASSANDRA-8281 the 
problem was that some non daemon thread was preventing the JVM to shutdown 
there was no Exception. 
According to the stacktrace the Exception is trigger by the call to {{addRow}} 
not by the call to {{close}}. This ticket is in fact a duplicate of the other 
ticket that you have open CASSANDRA-8808.

> CQLSSTableWriter close does not work - Regression bug: CASSANDRA-8281
> ---------------------------------------------------------------------
>
>                 Key: CASSANDRA-9052
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9052
>             Project: Cassandra
>          Issue Type: Bug
>         Environment: cassandra-all:2.1.2
> cassandra-all:2.1.3
>            Reporter: Sebastian YEPES FERNANDEZ
>            Assignee: Benjamin Lerer
>              Labels: API, CQL, SSTableWriter
>
> Hello,
> I have just noticed that the last C* version 2.1.3 reintroduced an old bug 
> "CASSANDRA-8281".
> When closing the CQLSSTableWriter after adding rows it generated the 
> following Exception:
> {code:title=Exception|borderStyle=solid}
> Exception in thread "main" java.lang.ExceptionInInitializerError
>         at org.apache.cassandra.db.Keyspace.initCf(Keyspace.java:324)
>         at org.apache.cassandra.db.Keyspace.<init>(Keyspace.java:277)
>         at org.apache.cassandra.db.Keyspace.open(Keyspace.java:119)
>         at org.apache.cassandra.db.Keyspace.open(Keyspace.java:96)
>         at 
> org.apache.cassandra.cql3.statements.UpdateStatement.addUpdateForKey(UpdateStatement.java:101)
>         at 
> org.apache.cassandra.io.sstable.CQLSSTableWriter.rawAddRow(CQLSSTableWriter.java:225)
>         at 
> org.apache.cassandra.io.sstable.CQLSSTableWriter.addRow(CQLSSTableWriter.java:144)
>         at 
> org.apache.cassandra.io.sstable.CQLSSTableWriter.addRow(CQLSSTableWriter.java:119)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:606)
>         at 
> org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSite.invoke(PojoMetaMethodSite.java:189)
>         at 
> org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
>         at 
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
>         at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:110)
>         at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:122)
>         at BulkDataLoader.main(BulkDataLoader.groovy:26)
> Caused by: java.lang.NullPointerException
>         at 
> org.apache.cassandra.config.DatabaseDescriptor.getFlushWriters(DatabaseDescriptor.java:1053)
>         at 
> org.apache.cassandra.db.ColumnFamilyStore.<clinit>(ColumnFamilyStore.java:85)
>         ... 18 more
> {code}
> Note that is this works correctly in 2.1.2 and not with 2.1.3, we can 
> reproduce this issue with the following code:
> {code:title=test.java|borderStyle=solid}
> import org.apache.cassandra.config.Config;
> import org.apache.cassandra.io.sstable.CQLSSTableWriter;
> public static void main(String[] args) {
>   Config.setClientMode(true);
>   // These folders needs must exist: mkdir -p /tmp/kspc/t1
>   CQLSSTableWriter w1 = CQLSSTableWriter.builder()
>     .inDirectory("/tmp/kspc/t1")
>     .forTable("CREATE TABLE kspc.t1 ( id  int, PRIMARY KEY (id));")
>     .using("INSERT INTO kspc.t1 (id) VALUES ( ? );")
>     .build();
>   try {
>     w1.addRow(1);
>     w1.close();
>   } catch (Exception e) {
>     System.out.println(e);
>   }
> }
> {code}



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

Reply via email to