cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cain (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-9071) CQLSSTableWriter gives java.lang.AssertionError: Empty partition
Date Wed, 15 Apr 2015 15:20:59 GMT

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

Cain commented on CASSANDRA-9071:
---------------------------------

I hava the same problem with cassandra 2.1.4. When I was loading large dataset into C* with
SSTableSimpleUnsortedWriter,
I got an  *java.lang.AssertionError: Empty partition*

{code:title=test.java|borderStyle=solid}
        System.setProperty("cassandra.config","file:///Users/zn/workspace/sstable-csv-m/conf/cassandra.yaml");
        String keyspace = "app";
        File directory = new File("app/sstables/");
        if (!directory.exists()){
            directory.mkdir();
        }
        Murmur3Partitioner partitioner = new Murmur3Partitioner();
        SSTableSimpleUnsortedWriter usersWriter = new SSTableSimpleUnsortedWriter(
                directory,partitioner,keyspace,"Users",AsciiType.instance,null,32);

        long timestamp = System.currentTimeMillis() * 1000;
        StringBuilder s = new StringBuilder("test");
        for (int x=0;x<60000;x++){
            s.append("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
        }
        String x = s.toString();
        for(int i=0; i< 1000000; i++)
        {
                ByteBuffer uuid = ByteBuffer.wrap(decompose(UUID.randomUUID()));
                usersWriter.newRow(uuid);
                usersWriter.addColumn(bytes("id"), bytes(i), timestamp);
                usersWriter.addColumn(bytes("lastname"), bytes(x), timestamp);
                if ((i % 1000) == 0){
                    System.out.println((i/1000) + " " + "K records wrote");
                }
        }
        usersWriter.close();
        System.exit(0);
{code}

After some debuging work, I found, the buffer which was pushed in *writeQueue* had some empty
*ColumnFamily*, which casued the exception.
!https://issues.apache.org/jira/secure/attachment/12725602/Screen+Shot+2015-04-15+at+11.14.40+PM.png!


I am new to cassandra and java, so how to quick fix this bug?


> CQLSSTableWriter gives java.lang.AssertionError: Empty partition
> ----------------------------------------------------------------
>
>                 Key: CASSANDRA-9071
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9071
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>         Environment: java 7 / 8
> cassandra 2.1.3 snapshot build locally with last commit https://github.com/apache/cassandra/commit/6ee4b0989d9a3ae3e704918622024fa57fdf63e7
> macos Yosemite 10.10.2
>            Reporter: Ajit Joglekar
>            Assignee: Benedict
>             Fix For: 2.1.5
>
>         Attachments: EmailWriter.java, Screen Shot 2015-04-15 at 11.14.40 PM.png, data.csv.gz
>
>
> I am always getting the following error:
> Exception in thread "main" java.lang.AssertionError: Empty partition
> at org.apache.cassandra.io.sstable.SSTableSimpleUnsortedWriter$DiskWriter.run(SSTableSimpleUnsortedWriter.java:228)
> It happens at a certain point that seems to be repeatable. Only issue is I am converting
400 million records into multiple SSTables and creating small test is a challenge
> Last comment from Benedict looks relevant here https://issues.apache.org/jira/browse/CASSANDRA-8619
> Is there a work around, quick fix, fix that I can try out locally?
> Thanks,
> -Ajit



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

Mime
View raw message