cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebastian YEPES FERNANDEZ (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-8281) CQLSSTableWriter close does not work
Date Fri, 13 Feb 2015 22:57:39 GMT

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

Sebastian YEPES FERNANDEZ commented on CASSANDRA-8281:
------------------------------------------------------

I am running on Groovy but it can be reproduced 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);

  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();

  CQLSSTableWriter w2 = CQLSSTableWriter.builder()
    .inDirectory("/tmp/kspc/t2")
    .forTable("CREATE TABLE kspc.t2 ( id  int, PRIMARY KEY (id));")
    .using("INSERT INTO kspc.t2 (id) VALUES ( ? );")
    .build();

  try {
    w1.addRow(1);
    w2.addRow(1);
    w1.close();
    w2.close();
  } catch (Exception e) {
    System.out.println(e);
  }
}
{code}

{code:title=The error|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:226)
        at org.apache.cassandra.io.sstable.CQLSSTableWriter.addRow(CQLSSTableWriter.java:145)
        at org.apache.cassandra.io.sstable.CQLSSTableWriter.addRow(CQLSSTableWriter.java:120)
        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:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
        at com.allthingsmonitoring.utils.BulkDataLoader.main(BulkDataLoader.groovy:415)
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}


> CQLSSTableWriter close does not work
> ------------------------------------
>
>                 Key: CASSANDRA-8281
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8281
>             Project: Cassandra
>          Issue Type: Bug
>          Components: API
>         Environment: Cassandra 2.1.1
>            Reporter: Xu Zhongxing
>            Assignee: Benjamin Lerer
>             Fix For: 2.1.3
>
>         Attachments: CASSANDRA-8281-V2-2.1.txt, CASSANDRA-8281-V2-trunk.txt, CASSANDRA-8281.txt
>
>
> I called CQLSSTableWriter.close(). But the program still cannot exit. But the same code
works fine on Cassandra 2.0.10.
> It seems that CQLSSTableWriter cannot be closed, and blocks the program from exit.



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

Mime
View raw message