Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
if ("skinny-3of12".equalsIgnoreCase(operation)) {
Select select = QueryBuilder.select(new String[] { "activity_id", "start_time", "end_time" }).from("activities");
select.where(QueryBuilder.eq("activity_id",
UUID.fromString("72b493f0-e59d-11e3-9bd6-0050568317e1")));
Activity3of12 a;
startTime = System.currentTimeMillis();
for (int i = 0; i < count; i++) {
a = cassandraOps.selectOne(select, Activity3of12.class);
log.info("{}, {}, {}", a.getActivityId(), a.getStartTime(), a.getEndTime());
}
}
else if ("skinny".equalsIgnoreCase(operation)) {
Select select = QueryBuilder.select().from("activities");
select.where(QueryBuilder.eq("activity_id",
UUID.fromString("72b493f0-e59d-11e3-9bd6-0050568317e1")));
Activity a;
startTime = System.currentTimeMillis();
for (int i = 0; i < count; i++) {
a = cassandraOps.selectOne(select, Activity.class);
log.info("{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}",
a.getActivity_id(), a.getActivity_model_id(), a.getActivity_state(), a.getAsset_id(),
a.getAttrs().size(), a.getCreation_time(), a.getCustomer_id(), a.getEnd_time(),
a.getLast_modified_time(), a.getPerson_id(), a.getPoi_id(), a.getStart_time());
}
}
long endTime = System.currentTimeMillis();
log.info("Duration: {} ms", endTime - startTime);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment