Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Fix Version/s: 1.0.6
    • Component/s: Tools
    • Labels:
      None

      Description

      Lately I have found the describe_ring feature was needed to debug/analyze issue, but the cli does not have this available.

      So just in case it is useful, please see the attached patch.

      here is the sample output:

      [default@unknown] help;
      ...
      ...
      decr                    Decrements a counter column.
      describe ring           Describe the token range information.
      describe cluster        Describe the cluster configuration.
      ...
      ...
      
      [default@unknown] help describe ring;
      describe ring <keyspace>;
      
      Describes the token range settings for the named keyspace.
      
      Required Parameters:
      - keyspace: Name of the keyspace to describe the token range.
      
      Examples:
      describe ring <keyspace>; - Describes the token range settings for the named keyspace.
      
      [default@unknown] describe ring Keyspace3;
      TokenRange: 
              TokenRange(start_token:9739248273232290250409572410247679660, end_token:9739248273232290250409572410247679660, endpoints:[192.168.0.125], rpc_endpoints:[192.168.0.125], endpoint_details:[EndpointDetails(host:192.168.0.125, port:9160, datacenter:168)])
      [default@unknown] describe ring fooks;
      Keyspace with name 'fooks' wasn't found, , please, authorize to one of the keyspaces first.
      [default@unknown] describe ring;
      Syntax error at position 13: mismatched input ';' expecting set null
      
      
      1. patch3220.diff
        5 kB
        Jackson Chung
      2. patch3220.v2.diff
        6 kB
        Jackson Chung
      3. patch3220.v3.diff
        10 kB
        Jackson Chung
      4. patch3220.v4.diff
        11 kB
        Jackson Chung
      5. patch3220.v5.diff
        12 kB
        Jackson Chung

        Activity

        Jackson Chung created issue -
        Hide
        Jackson Chung added a comment -

        — src/java/org/apache/cassandra/cli/CliClient.java (revision 1171325)
        — src/java/org/apache/cassandra/cli/Cli.g (revision 1171325)
        — src/resources/org/apache/cassandra/cli/CliHelp.yaml (revision 1171325)

        Show
        Jackson Chung added a comment - — src/java/org/apache/cassandra/cli/CliClient.java (revision 1171325) — src/java/org/apache/cassandra/cli/Cli.g (revision 1171325) — src/resources/org/apache/cassandra/cli/CliHelp.yaml (revision 1171325)
        Jackson Chung made changes -
        Field Original Value New Value
        Attachment patch3220.diff [ 12494840 ]
        Hide
        Jackson Chung added a comment -

        more sample... i didn't actually test the authentication keyspace and actually on a cluster, but they should work.

        [default@unknown] describe ring system;
        null
        InvalidRequestException(why:There is no ring for the keyspace: system)
                at org.apache.cassandra.thrift.Cassandra$describe_ring_result.read(Cassandra.java:23267)
                at org.apache.cassandra.thrift.Cassandra$Client.recv_describe_ring(Cassandra.java:1262)
                at org.apache.cassandra.thrift.Cassandra$Client.describe_ring(Cassandra.java:1237)
                at org.apache.cassandra.cli.CliClient.executeDescribeRing(CliClient.java:1437)
                at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:288)
                at org.apache.cassandra.cli.CliMain.processStatementInteractive(CliMain.java:222)
                at org.apache.cassandra.cli.CliMain.main(CliMain.java:350)
        
        Show
        Jackson Chung added a comment - more sample... i didn't actually test the authentication keyspace and actually on a cluster, but they should work. [default@unknown] describe ring system; null InvalidRequestException(why:There is no ring for the keyspace: system) at org.apache.cassandra.thrift.Cassandra$describe_ring_result.read(Cassandra.java:23267) at org.apache.cassandra.thrift.Cassandra$Client.recv_describe_ring(Cassandra.java:1262) at org.apache.cassandra.thrift.Cassandra$Client.describe_ring(Cassandra.java:1237) at org.apache.cassandra.cli.CliClient.executeDescribeRing(CliClient.java:1437) at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:288) at org.apache.cassandra.cli.CliMain.processStatementInteractive(CliMain.java:222) at org.apache.cassandra.cli.CliMain.main(CliMain.java:350)
        Hide
        Jonathan Ellis added a comment -

        What part of this was necessary to troubleshoot? Is it feasible to add that to nodetool ring instead?

        Show
        Jonathan Ellis added a comment - What part of this was necessary to troubleshoot? Is it feasible to add that to nodetool ring instead?
        Hide
        Brandon Williams added a comment -

        What part of this was necessary to troubleshoot?

        It's kind of pain to test things like CASSANDRA-1777 without it, since we don't have anything off-the-shelf that calls describe_ring. I had to write my own test app for that saga.

        Show
        Brandon Williams added a comment - What part of this was necessary to troubleshoot? It's kind of pain to test things like CASSANDRA-1777 without it, since we don't have anything off-the-shelf that calls describe_ring. I had to write my own test app for that saga.
        Hide
        Jackson Chung added a comment -

        hm, i was running into issue reported in #3044 and #2388

        2011-09-14 22:58:44,004 ERROR CliDriver (SessionState.java:printError(343)) - Failed with exception java.io.IOException:java.io.IOException: Could not get input splits
        java.io.IOException: java.io.IOException: Could not get input splits
            at org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:341)
            at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:133)
            at org.apache.hadoop.hive.ql.Driver.getResults(Driver.java:1114)
            at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:187)
            at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:241)
            at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:456)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
        Caused by: java.io.IOException: Could not get input splits
            at org.apache.cassandra.hadoop.ColumnFamilyInputFormat.getSplits(ColumnFamilyInputFormat.java:157)
            at org.apache.hadoop.hive.cassandra.input.HiveCassandraStandardColumnInputFormat.getSplits(HiveCassandraStandardColumnInputFormat.java:326)
            at org.apache.hadoop.hive.ql.exec.FetchOperator.getRecordReader(FetchOperator.java:281)
            at org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:320)
            ... 10 more
        Caused by: java.util.concurrent.ExecutionException: java.io.IOException: failed connecting to all endpoints
            at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
            at java.util.concurrent.FutureTask.get(FutureTask.java:83)
            at org.apache.cassandra.hadoop.ColumnFamilyInputFormat.getSplits(ColumnFamilyInputFormat.java:153)
            ... 13 more
        Caused by: java.io.IOException: failed connecting to all endpoints
            at org.apache.cassandra.hadoop.ColumnFamilyInputFormat.getSubSplits(ColumnFamilyInputFormat.java:234)
            at org.apache.cassandra.hadoop.ColumnFamilyInputFormat.access$200(ColumnFamilyInputFormat.java:70)
            at org.apache.cassandra.hadoop.ColumnFamilyInputFormat$SplitCallable.call(ColumnFamilyInputFormat.java:190)
            at org.apache.cassandra.hadoop.ColumnFamilyInputFormat$SplitCallable.call(ColumnFamilyInputFormat.java:175)
            at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
            at java.util.concurrent.FutureTask.run(FutureTask.java:138)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
            at java.lang.Thread.run(Thread.java:662)
        

        The "failed connecting to all endpoints" was actually supposedly printing the endpoints:
        throw new IOException("failed connecting to all endpoints " + StringUtils.join(range.endpoints, ","));

        Since the stacktrace doesn't print anything after the endpoints, that's when i learned that my range.endpoints are null, and hence prompted me to find out what my range is.

        The reason i choose to do it in the cli as I was thinking on the how the code internally has been getting it and see mostly using the thrift API. I could see if that could be done in nodetool, but could you explain why it is better?

        Show
        Jackson Chung added a comment - hm, i was running into issue reported in #3044 and #2388 2011-09-14 22:58:44,004 ERROR CliDriver (SessionState.java:printError(343)) - Failed with exception java.io.IOException:java.io.IOException: Could not get input splits java.io.IOException: java.io.IOException: Could not get input splits at org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:341) at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:133) at org.apache.hadoop.hive.ql.Driver.getResults(Driver.java:1114) at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:187) at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:241) at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:456) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.hadoop.util.RunJar.main(RunJar.java:156) Caused by: java.io.IOException: Could not get input splits at org.apache.cassandra.hadoop.ColumnFamilyInputFormat.getSplits(ColumnFamilyInputFormat.java:157) at org.apache.hadoop.hive.cassandra.input.HiveCassandraStandardColumnInputFormat.getSplits(HiveCassandraStandardColumnInputFormat.java:326) at org.apache.hadoop.hive.ql.exec.FetchOperator.getRecordReader(FetchOperator.java:281) at org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:320) ... 10 more Caused by: java.util.concurrent.ExecutionException: java.io.IOException: failed connecting to all endpoints at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222) at java.util.concurrent.FutureTask.get(FutureTask.java:83) at org.apache.cassandra.hadoop.ColumnFamilyInputFormat.getSplits(ColumnFamilyInputFormat.java:153) ... 13 more Caused by: java.io.IOException: failed connecting to all endpoints at org.apache.cassandra.hadoop.ColumnFamilyInputFormat.getSubSplits(ColumnFamilyInputFormat.java:234) at org.apache.cassandra.hadoop.ColumnFamilyInputFormat.access$200(ColumnFamilyInputFormat.java:70) at org.apache.cassandra.hadoop.ColumnFamilyInputFormat$SplitCallable.call(ColumnFamilyInputFormat.java:190) at org.apache.cassandra.hadoop.ColumnFamilyInputFormat$SplitCallable.call(ColumnFamilyInputFormat.java:175) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) The "failed connecting to all endpoints" was actually supposedly printing the endpoints: throw new IOException("failed connecting to all endpoints " + StringUtils.join(range.endpoints, ",")); Since the stacktrace doesn't print anything after the endpoints, that's when i learned that my range.endpoints are null, and hence prompted me to find out what my range is. The reason i choose to do it in the cli as I was thinking on the how the code internally has been getting it and see mostly using the thrift API. I could see if that could be done in nodetool, but could you explain why it is better?
        Jonathan Ellis made changes -
        Assignee Jackson Chung [ cywjackson ]
        Fix Version/s 1.0.0 [ 12316349 ]
        Component/s Tools [ 12312979 ]
        Reviewer brandon.williams
        Jonathan Ellis made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Brandon Williams added a comment -

        There are some very unhelpful errors when mistakes are made:

        [default@unknown] describe ring;
        Syntax error at position 13: mismatched input ';' expecting set null
        [default@unknown] describe ring Keyspace1;
        TokenRange: 
                TokenRange(start_token:113427455640312821154458202477256070484, end_token:170141183460469231731687303715884105726, endpoints:[10.179.111.137], rpc_endpoints:[10.179.111.137], endpoint_details:[])
                TokenRange(start_token:56713727820156410577229101238628035242, end_token:113427455640312821154458202477256070484, endpoints:[10.179.64.227], rpc_endpoints:[10.179.64.227], endpoint_details:[EndpointDetails(host:10.179.64.227, port:9160, datacenter:null)])
                TokenRange(start_token:170141183460469231731687303715884105726, end_token:56713727820156410577229101238628035242, endpoints:[10.179.65.102], rpc_endpoints:[10.179.65.102], endpoint_details:[])
        [default@unknown] describe ring system;   
        null
        [default@unknown] describe ring slkdhjsldjf;
        Keyspace with name 'slkdhjsldjf' wasn't found, , please, authorize to one of the keyspaces first.
        

        In particular: omitting the keyspace or using 'system'. Also, datacenter is null?

        Show
        Brandon Williams added a comment - There are some very unhelpful errors when mistakes are made: [default@unknown] describe ring; Syntax error at position 13: mismatched input ';' expecting set null [default@unknown] describe ring Keyspace1; TokenRange: TokenRange(start_token:113427455640312821154458202477256070484, end_token:170141183460469231731687303715884105726, endpoints:[10.179.111.137], rpc_endpoints:[10.179.111.137], endpoint_details:[]) TokenRange(start_token:56713727820156410577229101238628035242, end_token:113427455640312821154458202477256070484, endpoints:[10.179.64.227], rpc_endpoints:[10.179.64.227], endpoint_details:[EndpointDetails(host:10.179.64.227, port:9160, datacenter:null)]) TokenRange(start_token:170141183460469231731687303715884105726, end_token:56713727820156410577229101238628035242, endpoints:[10.179.65.102], rpc_endpoints:[10.179.65.102], endpoint_details:[]) [default@unknown] describe ring system; null [default@unknown] describe ring slkdhjsldjf; Keyspace with name 'slkdhjsldjf' wasn't found, , please, authorize to one of the keyspaces first. In particular: omitting the keyspace or using 'system'. Also, datacenter is null?
        Hide
        Jackson Chung added a comment - - edited

        i agree on all the points. I could use a help on what should be expected though. For instance, when "use keyspace" is issued without keyspace name, you get the similar output:

        [default@Keyspace3] use keyspace;
        Syntax error at position 4: mismatched input 'keyspace' expecting set null
        

        The stacktrace is:
        java.lang.RuntimeException: Syntax error at position 4: mismatched input 'keyspace' expecting set null
        at org.apache.cassandra.cli.CliCompiler.compileQuery(CliCompiler.java:88)
        at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:197)
        at org.apache.cassandra.cli.CliMain.processStatementInteractive(CliMain.java:222)
        at org.apache.cassandra.cli.CliMain.main(CliMain.java:350)
        Caused by: java.lang.RuntimeException: Syntax error at position 4: mismatched input 'keyspace' expecting set null
        at org.apache.cassandra.cli.CliParser.reportError(CliParser.java:197)
        at org.apache.cassandra.cli.CliParser.entityName(CliParser.java:7745)
        at org.apache.cassandra.cli.CliParser.keyspace(CliParser.java:7259)
        at org.apache.cassandra.cli.CliParser.useKeyspace(CliParser.java:5713)
        at org.apache.cassandra.cli.CliParser.statement(CliParser.java:528)
        at org.apache.cassandra.cli.CliParser.root(CliParser.java:229)
        at org.apache.cassandra.cli.CliCompiler.compileQuery(CliCompiler.java:79)

        In any case. For this, I think I could use the "describe keyspace" pattern, which in the case where no keyspace is given, it ask you to use one first; and then if you are authenticated to one, and run describe ring without the keyspace name, describe the current one. Agree?

        [default@unknown] describe;
        Authenticate to a Keyspace, before using `describe` or `describe <column_family>`
        [default@unknown] use Keyspace3;
        Authenticated to keyspace: Keyspace3
        [default@Keyspace3] describe;
        Keyspace: Keyspace3:
          Replication Strategy: org.apache.cassandra.locator.SimpleStrategy
          Durable Writes: true
            Options: [replication_factor:4]
          Column Families:
            ColumnFamily: testcf
              Key Validation Class: org.apache.cassandra.db.marshal.BytesType
              Default column value validator: org.apache.cassandra.db.marshal.BytesType
              Columns sorted by: org.apache.cassandra.db.marshal.BytesType
              Row cache size / save period in seconds / keys to save : 0.0/0/all
              Key cache size / save period in seconds: 100.0/14400
              GC grace seconds: 864000
              Compaction min/max thresholds: 4/32
              Read repair chance: 1.0
              Replicate on write: true
              Built indexes: []
              Compaction Strategy: org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy
        

        For using system, it error out because:
        [default@system] describe ring system;
        null
        InvalidRequestException(why:There is no ring for the keyspace: system)
        at org.apache.cassandra.thrift.Cassandra$describe_ring_result.read(Cassandra.java:23267)
        at org.apache.cassandra.thrift.Cassandra$Client.recv_describe_ring(Cassandra.java:1262)
        at org.apache.cassandra.thrift.Cassandra$Client.describe_ring(Cassandra.java:1237)
        at org.apache.cassandra.cli.CliClient.executeDescribeRing(CliClient.java:1437)
        at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:288)
        at org.apache.cassandra.cli.CliMain.processStatementInteractive(CliMain.java:222)
        at org.apache.cassandra.cli.CliMain.main(CliMain.java:350)

        It's probably because this keyspace uses internal strategy "org.apache.cassandra.locator.LocalStrategy"? In any case, exception is thrown because in the CassandraServer.java:

        public List<TokenRange> describe_ring(String keyspace)throws InvalidRequestException
            {
                if (keyspace == null || !Schema.instance.getNonSystemTables().contains(keyspace))
                    throw new InvalidRequestException("There is no ring for the keyspace: " + keyspace);
        

        So my option in the cli are either:
        1) do what CassandraServer does: invalidate it if the keyspace given is a system table, make some pretty error
        2) catch the invalidrequest exception, check if it is about "There is no ring"... in the message, and error out with some pretty print.

        (i don't like the 2nd option because the message is currently hardcoded within the CassandraServer. There is no enum or constant for message string to reference on.

        I don't think the datacenter=null is part of the problem here. It looks to be another bug with the datacenter value not populated to the EndpointDetails. If anything, it is a bug from https://issues.apache.org/jira/browse/CASSANDRA-2882 ?

        Show
        Jackson Chung added a comment - - edited i agree on all the points. I could use a help on what should be expected though. For instance, when "use keyspace" is issued without keyspace name, you get the similar output: [default@Keyspace3] use keyspace; Syntax error at position 4: mismatched input 'keyspace' expecting set null The stacktrace is: java.lang.RuntimeException: Syntax error at position 4: mismatched input 'keyspace' expecting set null at org.apache.cassandra.cli.CliCompiler.compileQuery(CliCompiler.java:88) at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:197) at org.apache.cassandra.cli.CliMain.processStatementInteractive(CliMain.java:222) at org.apache.cassandra.cli.CliMain.main(CliMain.java:350) Caused by: java.lang.RuntimeException: Syntax error at position 4: mismatched input 'keyspace' expecting set null at org.apache.cassandra.cli.CliParser.reportError(CliParser.java:197) at org.apache.cassandra.cli.CliParser.entityName(CliParser.java:7745) at org.apache.cassandra.cli.CliParser.keyspace(CliParser.java:7259) at org.apache.cassandra.cli.CliParser.useKeyspace(CliParser.java:5713) at org.apache.cassandra.cli.CliParser.statement(CliParser.java:528) at org.apache.cassandra.cli.CliParser.root(CliParser.java:229) at org.apache.cassandra.cli.CliCompiler.compileQuery(CliCompiler.java:79) In any case. For this, I think I could use the "describe keyspace" pattern, which in the case where no keyspace is given, it ask you to use one first; and then if you are authenticated to one, and run describe ring without the keyspace name, describe the current one. Agree? [default@unknown] describe; Authenticate to a Keyspace, before using `describe` or `describe <column_family>` [default@unknown] use Keyspace3; Authenticated to keyspace: Keyspace3 [default@Keyspace3] describe; Keyspace: Keyspace3: Replication Strategy: org.apache.cassandra.locator.SimpleStrategy Durable Writes: true Options: [replication_factor:4] Column Families: ColumnFamily: testcf Key Validation Class: org.apache.cassandra.db.marshal.BytesType Default column value validator: org.apache.cassandra.db.marshal.BytesType Columns sorted by: org.apache.cassandra.db.marshal.BytesType Row cache size / save period in seconds / keys to save : 0.0/0/all Key cache size / save period in seconds: 100.0/14400 GC grace seconds: 864000 Compaction min/max thresholds: 4/32 Read repair chance: 1.0 Replicate on write: true Built indexes: [] Compaction Strategy: org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy For using system, it error out because: [default@system] describe ring system; null InvalidRequestException(why:There is no ring for the keyspace: system) at org.apache.cassandra.thrift.Cassandra$describe_ring_result.read(Cassandra.java:23267) at org.apache.cassandra.thrift.Cassandra$Client.recv_describe_ring(Cassandra.java:1262) at org.apache.cassandra.thrift.Cassandra$Client.describe_ring(Cassandra.java:1237) at org.apache.cassandra.cli.CliClient.executeDescribeRing(CliClient.java:1437) at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:288) at org.apache.cassandra.cli.CliMain.processStatementInteractive(CliMain.java:222) at org.apache.cassandra.cli.CliMain.main(CliMain.java:350) It's probably because this keyspace uses internal strategy "org.apache.cassandra.locator.LocalStrategy"? In any case, exception is thrown because in the CassandraServer.java: public List<TokenRange> describe_ring( String keyspace) throws InvalidRequestException { if (keyspace == null || !Schema.instance.getNonSystemTables().contains(keyspace)) throw new InvalidRequestException( "There is no ring for the keyspace: " + keyspace); So my option in the cli are either: 1) do what CassandraServer does: invalidate it if the keyspace given is a system table, make some pretty error 2) catch the invalidrequest exception, check if it is about "There is no ring"... in the message, and error out with some pretty print. (i don't like the 2nd option because the message is currently hardcoded within the CassandraServer. There is no enum or constant for message string to reference on. I don't think the datacenter=null is part of the problem here. It looks to be another bug with the datacenter value not populated to the EndpointDetails. If anything, it is a bug from https://issues.apache.org/jira/browse/CASSANDRA-2882 ?
        Jonathan Ellis made changes -
        Status Patch Available [ 10002 ] In Progress [ 3 ]
        Sylvain Lebresne made changes -
        Fix Version/s 1.0.1 [ 12317948 ]
        Fix Version/s 1.0.0 [ 12316349 ]
        Jonathan Ellis made changes -
        Fix Version/s 1.0.2 [ 12318740 ]
        Fix Version/s 1.0.1 [ 12317948 ]
        Hide
        Pavel Yaskevich added a comment -

        I think that this should handle empty <keyspace> argument in the same way `describe` does.
        If you want to show exception message instead of "null" you should catch InvalidRequestionException and TException inside of your method.
        According to "datacenter=null" problem, it was already fixed by CASSANDRA-3403.

        Also you have a doubled "," in the error message, it should be "String.format("Keyspace with name '%s' wasn't found, please, authorize to one of the keyspaces first.", entityName)".

        Show
        Pavel Yaskevich added a comment - I think that this should handle empty <keyspace> argument in the same way `describe` does. If you want to show exception message instead of "null" you should catch InvalidRequestionException and TException inside of your method. According to "datacenter=null" problem, it was already fixed by CASSANDRA-3403 . Also you have a doubled "," in the error message, it should be "String.format("Keyspace with name '%s' wasn't found, please, authorize to one of the keyspaces first.", entityName)".
        Sylvain Lebresne made changes -
        Fix Version/s 1.0.3 [ 12318940 ]
        Fix Version/s 1.0.2 [ 12318740 ]
        Hide
        Jackson Chung added a comment - - edited

        v2:

        [default@unknown] describe ring system;
        There is no ring for the keyspace: system

        [default@unknown] describe ring;
        Authenticate to a Keyspace, before using `describe ring` or `describe ring <keyspace>`

        [default@blah] describe ring;
        TokenRange:
        TokenRange(start_token:0, end_token:56713727820156410577229101238628035242, endpoints:[/0.0.0.0])
        TokenRange(start_token:56713727820156410577229101238628035242, end_token:113427455640312821154458202477256070485, endpoints:[/0.0.0.0])
        TokenRange(start_token:113427455640312821154458202477256070485, end_token:0, endpoints:[0.0.0.0])

        [default@blah] describe ring blah;
        TokenRange:
        TokenRange(start_token:0, end_token:56713727820156410577229101238628035242, endpoints:[/0.0.0.0])
        TokenRange(start_token:56713727820156410577229101238628035242, end_token:113427455640312821154458202477256070485, endpoints:[/0.0.0.0])
        TokenRange(start_token:113427455640312821154458202477256070485, end_token:0, endpoints:[0.0.0.0])

        [default@blah] describe ring dah;
        Sorry, no Keyspace was found with name: dah

        Show
        Jackson Chung added a comment - - edited v2: [default@unknown] describe ring system; There is no ring for the keyspace: system [default@unknown] describe ring; Authenticate to a Keyspace, before using `describe ring` or `describe ring <keyspace>` [default@blah] describe ring; TokenRange: TokenRange(start_token:0, end_token:56713727820156410577229101238628035242, endpoints: [/0.0.0.0] ) TokenRange(start_token:56713727820156410577229101238628035242, end_token:113427455640312821154458202477256070485, endpoints: [/0.0.0.0] ) TokenRange(start_token:113427455640312821154458202477256070485, end_token:0, endpoints: [0.0.0.0] ) [default@blah] describe ring blah; TokenRange: TokenRange(start_token:0, end_token:56713727820156410577229101238628035242, endpoints: [/0.0.0.0] ) TokenRange(start_token:56713727820156410577229101238628035242, end_token:113427455640312821154458202477256070485, endpoints: [/0.0.0.0] ) TokenRange(start_token:113427455640312821154458202477256070485, end_token:0, endpoints: [0.0.0.0] ) [default@blah] describe ring dah; Sorry, no Keyspace was found with name: dah
        Jackson Chung made changes -
        Attachment patch3220.v2.diff [ 12502985 ]
        Jackson Chung made changes -
        Status In Progress [ 3 ] Patch Available [ 10002 ]
        Pavel Yaskevich made changes -
        Reviewer brandon.williams xedin
        Hide
        Pavel Yaskevich added a comment -

        Committed with minor changes such as: removed unnecessary return and if/else statements, changed output format to return TokenRange statements without any header.

        Show
        Pavel Yaskevich added a comment - Committed with minor changes such as: removed unnecessary return and if/else statements, changed output format to return TokenRange statements without any header.
        Pavel Yaskevich made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Jonathan Ellis added a comment -

        Is it feasible to add that to nodetool ring instead?

        I still think nodetool is the right place to put this. cli / cqlsh should be interacting with data, let's keep the ops part in nodetool as much as possible.

        Show
        Jonathan Ellis added a comment - Is it feasible to add that to nodetool ring instead? I still think nodetool is the right place to put this. cli / cqlsh should be interacting with data, let's keep the ops part in nodetool as much as possible.
        Hide
        Jackson Chung added a comment -

        ok, i have done a nodetool version. most of the thing work.. except somehow jconsole/jmxterm doesn't. First the nodetool output:

        $ nodetool -h zaranth -p 8199 describering Keyspace1
        TokenRange:
        TokenRange(start_token:0, end_token:56713727820156410577229101238628035242, endpoints:[184.106.233.162], rpc_endpoints:[184.106.233.162], endpoint_details:[EndpointDetails(host:184.106.233.162, datacenter:datacenter1, rack:rack1)])
        TokenRange(start_token:56713727820156410577229101238628035242, end_token:113427455640312821154458202477256070485, endpoints:[184.106.203.196], rpc_endpoints:[184.106.203.196], endpoint_details:[EndpointDetails(host:184.106.203.196, datacenter:datacenter1, rack:rack1)])
        TokenRange(start_token:113427455640312821154458202477256070485, end_token:0, endpoints:[184.106.204.143], rpc_endpoints:[184.106.204.143], endpoint_details:[EndpointDetails(host:184.106.204.143, datacenter:datacenter1, rack:rack1)])

        $nodetool -h zaranth -p 8199 describering
        Missing keyspace argument for describering.
        usage: java org.apache.cassandra.tools.NodeCmd --host <arg> <command>
        ...

        $ nodetool -h zaranth -p 8199 describering system
        There is no ring for the keyspace: system
        usage: java org.apache.cassandra.tools.NodeCmd --host <arg> <command>
        ...

        $ nodetool -h zaranth -p 8199 describering thisdoesnotexist
        There is no ring for the keyspace: thisdoesnotexist
        usage: java org.apache.cassandra.tools.NodeCmd --host <arg> <command>

        now the problem with jconsole/jmxterm:

        $>run getTokenRanges Keyspace1 
        #calling operation getTokenRanges of mbean org.apache.cassandra.db:type=StorageService
        org.cyclopsgroup.jmxterm.io.RuntimeIOException: Runtime IO exception: error unmarshalling return; nested exception is: 
                java.io.StreamCorruptedException: unexpected block data
                at org.cyclopsgroup.jmxterm.cc.CommandCenter.doExecute(CommandCenter.java:157)
                at org.cyclopsgroup.jmxterm.cc.CommandCenter.execute(CommandCenter.java:207)
                at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:156)
                at org.cyclopsgroup.jmxterm.boot.CliMain.main(CliMain.java:48)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:353)
                at org.codehaus.classworlds.Launcher.launch(Launcher.java:264)
                at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
                at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at org.codehaus.classworlds.uberjar.boot.Bootstrapper.bootstrap(Bootstrapper.java:209)
                at org.codehaus.classworlds.uberjar.boot.Bootstrapper.main(Bootstrapper.java:116)
        Caused by: java.rmi.UnmarshalException: error unmarshalling return; nested exception is: 
                java.io.StreamCorruptedException: unexpected block data
                at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:173)
                at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source)
                at javax.management.remote.rmi.RMIConnectionImpl_Stub.invoke(Unknown Source)
                at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(RMIConnector.java:995)
                at org.cyclopsgroup.jmxterm.cmd.RunCommand.execute(RunCommand.java:137)
                at org.cyclopsgroup.jmxterm.cc.CommandCenter.doExecute(CommandCenter.java:189)
                at org.cyclopsgroup.jmxterm.cc.CommandCenter.doExecute(CommandCenter.java:153)
                ... 17 more
        Caused by: java.io.StreamCorruptedException: unexpected block data
                at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1342)
                at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)
                at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)
                at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
                at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
                at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
                at java.util.ArrayList.readObject(ArrayList.java:593)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
                at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1848)
                at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
                at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
                at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
                at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:306)
                at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:155)
                ... 23 more
        
        Show
        Jackson Chung added a comment - ok, i have done a nodetool version. most of the thing work.. except somehow jconsole/jmxterm doesn't. First the nodetool output: $ nodetool -h zaranth -p 8199 describering Keyspace1 TokenRange: TokenRange(start_token:0, end_token:56713727820156410577229101238628035242, endpoints: [184.106.233.162] , rpc_endpoints: [184.106.233.162] , endpoint_details: [EndpointDetails(host:184.106.233.162, datacenter:datacenter1, rack:rack1)] ) TokenRange(start_token:56713727820156410577229101238628035242, end_token:113427455640312821154458202477256070485, endpoints: [184.106.203.196] , rpc_endpoints: [184.106.203.196] , endpoint_details: [EndpointDetails(host:184.106.203.196, datacenter:datacenter1, rack:rack1)] ) TokenRange(start_token:113427455640312821154458202477256070485, end_token:0, endpoints: [184.106.204.143] , rpc_endpoints: [184.106.204.143] , endpoint_details: [EndpointDetails(host:184.106.204.143, datacenter:datacenter1, rack:rack1)] ) $nodetool -h zaranth -p 8199 describering Missing keyspace argument for describering. usage: java org.apache.cassandra.tools.NodeCmd --host <arg> <command> ... $ nodetool -h zaranth -p 8199 describering system There is no ring for the keyspace: system usage: java org.apache.cassandra.tools.NodeCmd --host <arg> <command> ... $ nodetool -h zaranth -p 8199 describering thisdoesnotexist There is no ring for the keyspace: thisdoesnotexist usage: java org.apache.cassandra.tools.NodeCmd --host <arg> <command> now the problem with jconsole/jmxterm: $>run getTokenRanges Keyspace1 #calling operation getTokenRanges of mbean org.apache.cassandra.db:type=StorageService org.cyclopsgroup.jmxterm.io.RuntimeIOException: Runtime IO exception: error unmarshalling return; nested exception is: java.io.StreamCorruptedException: unexpected block data at org.cyclopsgroup.jmxterm.cc.CommandCenter.doExecute(CommandCenter.java:157) at org.cyclopsgroup.jmxterm.cc.CommandCenter.execute(CommandCenter.java:207) at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:156) at org.cyclopsgroup.jmxterm.boot.CliMain.main(CliMain.java:48) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:353) at org.codehaus.classworlds.Launcher.launch(Launcher.java:264) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.uberjar.boot.Bootstrapper.bootstrap(Bootstrapper.java:209) at org.codehaus.classworlds.uberjar.boot.Bootstrapper.main(Bootstrapper.java:116) Caused by: java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.io.StreamCorruptedException: unexpected block data at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:173) at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source) at javax.management.remote.rmi.RMIConnectionImpl_Stub.invoke(Unknown Source) at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(RMIConnector.java:995) at org.cyclopsgroup.jmxterm.cmd.RunCommand.execute(RunCommand.java:137) at org.cyclopsgroup.jmxterm.cc.CommandCenter.doExecute(CommandCenter.java:189) at org.cyclopsgroup.jmxterm.cc.CommandCenter.doExecute(CommandCenter.java:153) ... 17 more Caused by: java.io.StreamCorruptedException: unexpected block data at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1342) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350) at java.util.ArrayList.readObject(ArrayList.java:593) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1848) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350) at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:306) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:155) ... 23 more
        Hide
        Jackson Chung added a comment -

        new patch (v3) for nodetool

        Show
        Jackson Chung added a comment - new patch (v3) for nodetool
        Jackson Chung made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Jackson Chung added a comment -

        attaching patch3220.v3.diff .. note this patch still have the above mentioned problem of jconsole/jmxterm

        also i called

        DatabaseDescriptor.loadSchemas();
        if (!Schema.instance.getNonSystemTables().contains(keyspace))
        

        not sure if that's too heavy ( loadSchemas()).

        The CassandraServer.describe_ring is refactor'ed to call StorageService.instance.getTokenRanges(keyspace);

        Show
        Jackson Chung added a comment - attaching patch3220.v3.diff .. note this patch still have the above mentioned problem of jconsole/jmxterm also i called DatabaseDescriptor.loadSchemas(); if (!Schema.instance.getNonSystemTables().contains(keyspace)) not sure if that's too heavy ( loadSchemas()). The CassandraServer.describe_ring is refactor'ed to call StorageService.instance.getTokenRanges(keyspace);
        Jackson Chung made changes -
        Attachment patch3220.v3.diff [ 12503160 ]
        Jackson Chung made changes -
        Status Reopened [ 4 ] Patch Available [ 10002 ]
        Hide
        Pavel Yaskevich added a comment -

        Calling loadSchemas() on the client side on each request is inappropriate, all validations should be done on the server size. You can add "describeRing" JMX method to the StorageServiceMBean instead of "getTokenRanges(String)" and do all keyspace validation in there.

        Show
        Pavel Yaskevich added a comment - Calling loadSchemas() on the client side on each request is inappropriate, all validations should be done on the server size. You can add "describeRing" JMX method to the StorageServiceMBean instead of "getTokenRanges(String)" and do all keyspace validation in there.
        Sylvain Lebresne made changes -
        Fix Version/s 1.0.4 [ 12319064 ]
        Fix Version/s 1.0.3 [ 12318940 ]
        Hide
        Jackson Chung added a comment -

        ok patch3220.v4.diff

        1) remove loadSchema/check for keyspace on client
        2) move the check to StorageService, make it throw IRE
        3) handle the IRE in the NodeCmd just like CliClient
        4) change all the name to describeRing to be consistent

        still have problem if running simply via jmx

        Show
        Jackson Chung added a comment - ok patch3220.v4.diff 1) remove loadSchema/check for keyspace on client 2) move the check to StorageService, make it throw IRE 3) handle the IRE in the NodeCmd just like CliClient 4) change all the name to describeRing to be consistent still have problem if running simply via jmx
        Jackson Chung made changes -
        Attachment patch3220.v4.diff [ 12503464 ]
        Hide
        Pavel Yaskevich added a comment -

        v4 looks much better. Jonathan, what do we do with changes made to CLI, should I revert them?

        Show
        Pavel Yaskevich added a comment - v4 looks much better. Jonathan, what do we do with changes made to CLI, should I revert them?
        Hide
        Jonathan Ellis added a comment -

        Yes, let's remove it from the cli in favor of nodetool.

        Show
        Jonathan Ellis added a comment - Yes, let's remove it from the cli in favor of nodetool.
        Hide
        Jackson Chung added a comment -

        working on the "unexpected block data"

        it seems like i cannot return any object coming from thrift in the jmx (./interface/thrift/gen-java/org/apache/cassandra/thrift/*)

        I tried by creating a test method that simply return a TokenRange, a KeyRange, an EndpointDetails in the StorageServiceMBean (return new <the object>())

        Is there a restriction on that?

        Maybe I should make the jmx method to return a String (List of String?) instead?

        Show
        Jackson Chung added a comment - working on the "unexpected block data" it seems like i cannot return any object coming from thrift in the jmx (./interface/thrift/gen-java/org/apache/cassandra/thrift/*) I tried by creating a test method that simply return a TokenRange, a KeyRange, an EndpointDetails in the StorageServiceMBean (return new <the object>()) Is there a restriction on that? Maybe I should make the jmx method to return a String (List of String?) instead?
        Hide
        Jonathan Ellis added a comment -

        it seems like i cannot return any object coming from thrift in the jmx

        Odd – it should work since Thrift objects implement Serializable, but then again, it doesn't totally shock me that you're running into problems since that's definitely not a common use case.

        Maybe I should make the jmx method to return a String (List of String?) instead?

        That's probably the best solution. We already prefer to avoid non-primitive types over JMX (CASSANDRA-2805).

        Show
        Jonathan Ellis added a comment - it seems like i cannot return any object coming from thrift in the jmx Odd – it should work since Thrift objects implement Serializable, but then again, it doesn't totally shock me that you're running into problems since that's definitely not a common use case. Maybe I should make the jmx method to return a String (List of String?) instead? That's probably the best solution. We already prefer to avoid non-primitive types over JMX ( CASSANDRA-2805 ).
        Hide
        Jackson Chung added a comment -

        ok, converting the methods on the jmx to return a list of String instead then.

        PS: i've tried to use guava Lists.transform, but that fails with the following

        $ nodetool -h faranth describering Keyspace1
        TokenRange: 
        Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
                at $Proxy0.describeRing(Unknown Source)
                at org.apache.cassandra.tools.NodeProbe.describeRing(NodeProbe.java:624)
                at org.apache.cassandra.tools.NodeCmd.printDescribeRing(NodeCmd.java:766)
                at org.apache.cassandra.tools.NodeCmd.main(NodeCmd.java:737)
        Caused by: java.rmi.UnmarshalException: error unmarshalling return; nested exception is: 
                java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.cassandra.service.StorageService$3
                at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:173)
                at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source)
                at javax.management.remote.rmi.RMIConnectionImpl_Stub.invoke(Unknown Source)
                at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(RMIConnector.java:995)
                at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:288)
                ... 4 more
        Caused by: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.cassandra.service.StorageService$3
                at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1332)
                at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)
                at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)
                at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
                at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
                at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
                at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:306)
                at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:155)
                ... 8 more
        Caused by: java.io.NotSerializableException: org.apache.cassandra.service.StorageService$3
                at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
                at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
                at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
                at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
                at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
                at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
                at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:274)
                at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:315)
                at sun.rmi.transport.Transport$1.run(Transport.java:159)
                at java.security.AccessController.doPrivileged(Native Method)
                at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
                at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                at java.lang.Thread.run(Thread.java:662)
        

        so sticking with just simply manually convert.

        result from jmx:

        $>run describeRing Keyspace1 
        #calling operation describeRing of mbean org.apache.cassandra.db:type=StorageService
        #operation returns: 
        ( TokenRange(start_token:0, end_token:0, endpoints:[192.168.11.6], rpc_endpoints:[192.168.11.6], endpoint_details:[EndpointDetails(host:192.168.11.6, datacenter:168, rack:11)]) )
        

        the code using guava's Lists.transfrom is still there, please feel free to take a look to see if i did some stupid mistake

        Show
        Jackson Chung added a comment - ok, converting the methods on the jmx to return a list of String instead then. PS: i've tried to use guava Lists.transform, but that fails with the following $ nodetool -h faranth describering Keyspace1 TokenRange: Exception in thread "main" java.lang.reflect.UndeclaredThrowableException at $Proxy0.describeRing(Unknown Source) at org.apache.cassandra.tools.NodeProbe.describeRing(NodeProbe.java:624) at org.apache.cassandra.tools.NodeCmd.printDescribeRing(NodeCmd.java:766) at org.apache.cassandra.tools.NodeCmd.main(NodeCmd.java:737) Caused by: java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.cassandra.service.StorageService$3 at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:173) at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source) at javax.management.remote.rmi.RMIConnectionImpl_Stub.invoke(Unknown Source) at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(RMIConnector.java:995) at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:288) ... 4 more Caused by: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.cassandra.service.StorageService$3 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1332) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350) at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:306) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:155) ... 8 more Caused by: java.io.NotSerializableException: org.apache.cassandra.service.StorageService$3 at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:274) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:315) at sun.rmi.transport.Transport$1.run(Transport.java:159) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:155) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) so sticking with just simply manually convert. result from jmx: $>run describeRing Keyspace1 #calling operation describeRing of mbean org.apache.cassandra.db:type=StorageService #operation returns: ( TokenRange(start_token:0, end_token:0, endpoints:[192.168.11.6], rpc_endpoints:[192.168.11.6], endpoint_details:[EndpointDetails(host:192.168.11.6, datacenter:168, rack:11)]) ) the code using guava's Lists.transfrom is still there, please feel free to take a look to see if i did some stupid mistake
        Jackson Chung made changes -
        Attachment patch3220.v5.diff [ 12504182 ]
        Sylvain Lebresne made changes -
        Fix Version/s 1.0.5 [ 12319144 ]
        Fix Version/s 1.0.4 [ 12319064 ]
        Sylvain Lebresne made changes -
        Fix Version/s 1.0.6 [ 12319161 ]
        Fix Version/s 1.0.5 [ 12319144 ]
        Hide
        Pavel Yaskevich added a comment -

        Committed nodetool version with minor naming changes and removed 'describe ring' from CLI.

        Show
        Pavel Yaskevich added a comment - Committed nodetool version with minor naming changes and removed 'describe ring' from CLI.
        Pavel Yaskevich made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Gavin made changes -
        Workflow no-reopen-closed, patch-avail [ 12633390 ] patch-available, re-open possible [ 12749350 ]
        Gavin made changes -
        Workflow patch-available, re-open possible [ 12749350 ] reopen-resolved, no closed status, patch-avail, testing [ 12756955 ]

          People

          • Assignee:
            Jackson Chung
            Reporter:
            Jackson Chung
            Reviewer:
            Pavel Yaskevich
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development