cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank Du (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CASSANDRA-1088) Enable cassandra-cli to list rows, and page through rows in a column family
Date Tue, 18 May 2010 04:12:42 GMT

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

Frank Du commented on CASSANDRA-1088:
-------------------------------------

Hi Eric, 

I ran svn update to latest source code, and tested it. There is an issue, which is detailed
below. However, there is no problem with {{set}} and {{get}} commands. I double checked antlr
grammar to make sure it won't cause the issue. Meanwhile, CliCompiler.getKey() is not used
by the new command. Therefore, I am wondering if it may be caused by other issue. How about
cleaning up data and test it again?

The mentioned issue stopped the {{list}} command, which I reported in CASSANDRA-1073: https://issues.apache.org/jira/browse/CASSANDRA-1073

Here is the total process:

1. Keyspace1 definition is not shown, though it is defined in cassandra.yaml. Therefore I
added a keyspace 'FrankDu', in the main() method of CliMain:

        List<CfDef> cf_defs = new ArrayList<CfDef>();
        cf_defs.add(new CfDef("FrankDu", "CF1").setComment("CF1").setComparator_type("BytesType"));
        KsDef ks_def = new KsDef("FrankDu", "org.apache.cassandra.locator.RackUnawareStrategy",
1, cf_defs);
        
        thriftClient_.system_add_keyspace(ks_def);

2. Ran cassandra inside eclipse first. Then started CliMain. The keyspace 'FrankDu' got created.
Every commands works fine: {{set}}, {{get}}, {{list}}. So I inserted some rows.

3. Stopped both programs. Disabled the code of keyspace creation. Then ran cassandra first,
and then started CliMain. This time, {{set}} and {{get}} works fine. But {{list}} command
caused an java.io.EOFException in cassandra console log. It was first reported in issue CASSANDRA-1073.


Now I will add detailed reproduce steps to CASSANDRA-1073, and attach last error log. The
{{list}} command cannot work because of the issue. Could you please take a look into it? Thank
you very much!

Best Regards,
Frank

> Enable cassandra-cli to list rows, and page through rows in a column family
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-1088
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1088
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Tools
>            Reporter: Frank Du
>             Fix For: 0.7
>
>         Attachments: patch.txt
>
>
> I have been looking for showing rows and paging through rows. Finally I write this extension
to cassandra-cli tool. 
> Let's assume that we have the following data in column family named 'CF1':
> =========================
> Row 1:
> key: fdu1, name: 'Frank Du', city: 'NYC'
> Row 2:
> key: fdu2, name: 'Jonathan Ellis'
> Row 3:
> key: fdu3, name: 'Eric Evans'
> Syntax:
> =========================
> LIST keyRangeExpression limitClause?
> keyRangeExpression:
>         columnFamilyName[ startKey : endKey ]  ( [ 'superCoumnName' ] )? 
> limitClause: 
>         LIMIT count (OFFSET offset)? 
>         \| LIMIT offset, count
> The limit clause is the same with MySql.
> Examples:
> =========================
> // list all the 3 rows in CF1
> list CF1[ '' : '' ]    
> // list all rows, offset from index 1. So it will show 2 rows
> list CF1[ '' : '' ] limit 1, 10    
>  // show the rows 'fdu2' and 'fdu3'
> list CF1[ 'fdu2' : '' ] limit 10 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message