cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shuai Yuan <yuansh...@supertool.net.cn>
Subject problem when trying to get_range_slice()
Date Thu, 03 Jun 2010 07:57:14 GMT
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



Mime
View raw message