Reputation: 455
I'm using cassandra unit for testing in my project (Java) and it's great but the problem is:loading test data takes quite a long time (100 secs for ~25 000 plain inserts).
I have some ideas but they don't seem to be feasible for cassandra unit:
Do you have other ideas? Thanks.
Upvotes: 1
Views: 695
Reputation: 20790
The way to load up a lot of data all at once is to use the unlogged batch mechanism:
BEGIN UNLOGGED BATCH
INSERT INTO ...;
INSERT INTO ...;
INSERT INTO ...;
...
APPLY BATCH;
It may not be fast, but for test purposes it should not be a problem and you should avoid timeouts that a straight set of INSERT will likely generate (because you fill up the log file and Cassandra stops accepting data for a while after that.)
Upvotes: 1