cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jay Zhuang (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CASSANDRA-13021) Nodetool compactionstats fails with NullPointerException
Date Mon, 12 Dec 2016 22:26:58 GMT

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

Jay Zhuang edited comment on CASSANDRA-13021 at 12/12/16 10:26 PM:
-------------------------------------------------------------------

[~jasobrown] Thanks for the review.
Updated the patch to use 1 and print empty string instead of "null". Which will be consistent
with 3.X.

In 3.x, null value is printed as empty: https://github.com/apache/cassandra/blob/cassandra-3.X/src/java/org/apache/cassandra/tools/nodetool/formatter/TableBuilder.java#L96
But in 3.0, it's printed as string {{"null"}}: https://github.com/apache/cassandra/blob/cassandra-3.0/src/java/org/apache/cassandra/tools/nodetool/CompactionStats.java#L86


sample output when id is null:
{code}
$ ./nodetool compactionstats
pending tasks: 1
   id   compaction type                keyspace        table     completed          total
   unit   progress
             Compaction   this_is_test_keyspace   test_table   38987528168   108264402785
  bytes     36.01%
Active compaction remaining time :   0h05m30s
{code}

[13021-3.0-update2.txt|https://issues.apache.org/jira/secure/attachment/12842886/13021-3.0-update2.txt]


was (Author: jay.zhuang):
[~jasobrown] Thanks for the review.
Updated the patch to use 1 and print empty string instead of "null". Which will be consistent
with 3.X.

In 3.x, null value is printed as empty: https://github.com/apache/cassandra/blob/cassandra-3.X/src/java/org/apache/cassandra/tools/nodetool/formatter/TableBuilder.java#L96
But in 3.0, it's printed as string {{"null"}}: https://github.com/apache/cassandra/blob/cassandra-3.0/src/java/org/apache/cassandra/tools/nodetool/CompactionStats.java#L86



> 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
>            Assignee: Jay Zhuang
>             Fix For: 3.0.x
>
>         Attachments: 13021-3.0-update.txt, 13021-3.0-update2.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)

Mime
View raw message