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

Jackson Chung updated CASSANDRA-3220:
-------------------------------------

    Attachment: patch3220.v5.diff

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

{noformat}
$ 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)
{noformat}

so sticking with just simply manually convert.


result from jmx:
{noformat}
$>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)]) 
)
{noformat}

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
                
> add describe_ring to cli
> ------------------------
>
>                 Key: CASSANDRA-3220
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3220
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jackson Chung
>            Assignee: Jackson Chung
>            Priority: Minor
>             Fix For: 1.0.4
>
>         Attachments: patch3220.diff, patch3220.v2.diff, patch3220.v3.diff, 
> patch3220.v4.diff, patch3220.v5.diff
>
>
> 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:
> {noformat}
> [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
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to