List<Event> events = new ArrayList();
for (String file : files) {
File f = new File(file);
byte[] body = Files.toByteArray(f);
Event event = EventBuilder.withBody(body);
// event.getHeaders().put(Metadata.RESOURCE_NAME_KEY, f.getName());
events.add(event);
}
long startTime = System.currentTimeMillis();
for (int i = 0; i < iters; i++) {
if (i % 10000 == 0) {
LOGGER.info("iter: {}", i);
}
for (Event event : events) {
event = EventBuilder.withBody(event.getBody(), new HashMap(event.getHeaders()));
event.getHeaders().put("id", UUID.randomUUID().toString());
load(event);
}
}
float secs = (System.currentTimeMillis() - startTime) / 1000.0f;