CKeyspaceDefinition definition = JsonUtil.objectFromJsonResource(CKeyspaceDefinition.class, this.getClass().getClassLoader(), "MultiInsertKeyspace.js");
//Rebuild the keyspace and get the object mapper
cm.buildKeyspace(definition, true);
ObjectMapper om = cm.getObjectMapper(definition);
om.setLogCql(true);
// Set up test data
// we will insert 20 objects
int nDataItems = 20;
List<Map<String, Object>> values2 = generateNObjects(nDataItems);
List<Map<String, Object>> updatedValues2 = Lists.newArrayList();
for (Map<String, Object> baseValue : values2) {
updatedValues2.add(JsonUtil.rhombusMapFromJsonMap(baseValue, definition.getDefinitions().get("object2")));
}
Map<String, List<Map<String, Object>>> multiInsertMap = Maps.newHashMap();
multiInsertMap.put(objectType, updatedValues2);
//Insert data
om.insertBatchMixed(multiInsertMap);
// generate a executorIterator
SortedMap<String, Object> indexValues = Maps.newTreeMap();
indexValues.put("account_id", UUID.fromString("00000003-0000-0030-0040-000000030000"));
indexValues.put("user_id", UUID.fromString("00000003-0000-0030-0040-000000030000"));
Criteria criteria = new Criteria();
criteria.setIndexKeys(indexValues);
CObjectCQLGenerator cqlGenerator = om.getCqlGenerator_ONLY_FOR_TESTING();
CQLStatementIterator unBoundedIterator = cqlGenerator.makeCQLforList(objectType, criteria, false);
Session session = cm.getRhombusSession(definition);
CQLExecutor cqlExecutor = new CQLExecutor(session, true, definition.getConsistencyLevel());
CQLExecutorIterator cqlExecutorIterator = new CQLExecutorIterator(cqlExecutor, unBoundedIterator);