[ 
https://issues.apache.org/jira/browse/CASSANDRA-12667?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yuki Morishita updated CASSANDRA-12667:
---------------------------------------
    Reviewer: Yuki Morishita

Isn't it better to set DiskOptimizationStrategy in 
{{DatabaseDescriptor.clientInitialization}}?

> CQLSSTableWriter can fail because DiskOptimizationStrategy is null
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-12667
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-12667
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>            Reporter: Jeremiah Jordan
>            Assignee: Jeremiah Jordan
>
> CASSANDRA-11580 made DiskOptimizationStrategy an object, so now we can NPE 
> with a DD.clientInit where it will be null.
> {code}
> java.lang.RuntimeException: java.lang.NullPointerException
>       at 
> org.apache.cassandra.io.sstable.SSTableSimpleUnsortedWriter.close(SSTableSimpleUnsortedWriter.java:137)
>       at 
> org.apache.cassandra.io.sstable.CQLSSTableWriter.close(CQLSSTableWriter.java:325)
>       at 
> com.datastax.bdp.spark.writer.BulkTableWriter.writeSSTables(BulkTableWriter.scala:246)
>       at 
> com.datastax.bdp.spark.writer.BulkTableWriter.write(BulkTableWriter.scala:261)
>       at 
> com.datastax.bdp.spark.writer.BulkTableWriter$BulkSaveRDDFunctions$$anonfun$bulkSaveToCassandra$1.apply(BulkTableWriter.scala:319)
>       at 
> com.datastax.bdp.spark.writer.BulkTableWriter$BulkSaveRDDFunctions$$anonfun$bulkSaveToCassandra$1.apply(BulkTableWriter.scala:319)
>       at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:66)
>       at org.apache.spark.scheduler.Task.run(Task.scala:89)
>       at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:227)
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>       at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.NullPointerException
>       at java.util.Objects.requireNonNull(Objects.java:203)
>       at org.apache.cassandra.io.sstable.SSTable.<init>(SSTable.java:87)
>       at 
> org.apache.cassandra.io.sstable.format.SSTableWriter.<init>(SSTableWriter.java:83)
>       at 
> org.apache.cassandra.io.sstable.format.big.BigTableWriter.<init>(BigTableWriter.java:78)
>       at 
> org.apache.cassandra.io.sstable.format.big.BigFormat$WriterFactory.open(BigFormat.java:92)
>       at 
> org.apache.cassandra.io.sstable.format.SSTableWriter.create(SSTableWriter.java:102)
>       at 
> org.apache.cassandra.io.sstable.SimpleSSTableMultiWriter.create(SimpleSSTableMultiWriter.java:119)
>       at 
> org.apache.cassandra.io.sstable.SSTableTxnWriter.create(SSTableTxnWriter.java:147)
>       at 
> org.apache.cassandra.io.sstable.AbstractSSTableSimpleWriter.createWriter(AbstractSSTableSimpleWriter.java:75)
>       at 
> org.apache.cassandra.io.sstable.SSTableSimpleUnsortedWriter$DiskWriter.run(SSTableSimpleUnsortedWriter.java:207)
> {code}



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

Reply via email to