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

Jason Brown commented on CASSANDRA-13021:
-----------------------------------------

ftr, it looks like {{CompactionInfo#asMap}} can return {{null}} for some of 
those values that are in the map, as there are fields in {[CompactionInfo}} 
that are allowed to be null.

wrt to the patch, it looks like this behavior is in 2.2, at least, and 3.0. 
Things were refactored in 3.X and there is an equivalent [null check 
already|https://github.com/apache/cassandra/blob/cassandra-3.X/src/java/org/apache/cassandra/tools/nodetool/formatter/TableBuilder.java#L80].
 I propose you use 1 as your space marker (like 3.X and up), instead of 4 or 
the length of an arbitrary string. wdyt?

> Nodetool compactionstats fails with NullPointerException
> --------------------------------------------------------
>
>                 Key: CASSANDRA-13021
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13021
>             Project: Cassandra
>          Issue Type: Bug
>         Environment: 3.0.10
>            Reporter: Jay Zhuang
>             Fix For: 3.0.x
>
>         Attachments: 13021-3.0-update.txt, 13021-3.0.txt
>
>
> Found in 3.0.10:
> {code}
> $ nodetool compactionstats
> pending tasks: 2
> error: null
> -- StackTrace --
> java.lang.NullPointerException
>         at 
> org.apache.cassandra.tools.nodetool.CompactionStats.addLine(CompactionStats.java:102)
>         at 
> org.apache.cassandra.tools.nodetool.CompactionStats.execute(CompactionStats.java:70)
>         at 
> org.apache.cassandra.tools.NodeTool$NodeToolCmd.run(NodeTool.java:247)
>         at org.apache.cassandra.tools.NodeTool.main(NodeTool.java:161)
> {code}



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

Reply via email to