cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Ellis <jbel...@gmail.com>
Subject Re: problem when trying to get_range_slice()
Date Fri, 04 Jun 2010 02:07:28 GMT
use smaller slices and page through the data

2010/6/3 Shuai Yuan <yuanshuai@supertool.net.cn>:
> Hi all,
>
> ----my env----
>
> 6 servers with about 200GB data.
>
> data structure,
>
> 64B rowkey + (5B column)*20,
> rowkey and column.value are all random bytes from a-z,A-Z,0-9
>
> ----problem----
>
> when I tried iterate over the data in the storage, I always get
> org::apache::cassandra::TimedOutException
> (RpcTimeout = 2minutes)
>
> ----questions----
>
> 1.How could I iterate over my data then?
>
> 2.In the code below, I gave key_start/end/count twice, one for
> get_range_slice() and the other for SlicePreditor. Are they the same?
>
> Thanks!
>
> ----scan-data application----
>
>        CassandraFactory factory(argv[1], 9160);
>        tr1::shared_ptr<Cassandra> client(factory.create());
>
>        Keyspace *key_space = client->getKeyspace("campaign");
>
>        map<string, vector<Column> > mResult;
>        ColumnParent cp;
>        SlicePredicate sp;
>        string szStart, szEnd;
>        uint32_t uCount = 100; //try to retrieve 100 keys?
>
>        szStart =
> "0000000000000000000000000000000000000000000000000000000000000000";
>        szEnd =
> "1000000000000000000000000000000000000000000000000000000000000000";
>
>        cp.column_family = "test_col";
>
>        sp.__isset.slice_range = true;
>        sp.slice_range.start =
> "0000000000000000000000000000000000000000000000000000000000000000";
>        sp.slice_range.finish =
> "1000000000000000000000000000000000000000000000000000000000000000";
>        sp.slice_range.count = 100;
>
>        try {
>                mResult = key_space->getRangeSlice(cp, sp, szStart, szEnd,
> uCount); //by libcassandra, mainly invoking get_range_slice()
>
>                /* then iterate the result and output */
>                        }
>                }
>        } catch (org::apache::cassandra::InvalidRequestException &ire) {
>                cout << ire.why << endl;
>                delete key_space;
>                return 1;
>        }
>
>        return 0;
> --
> Kevin Yuan
> www.yuan-shuai.info
>
>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

Mime
View raw message