use of com.yahoo.vespaxmlparser.VespaXMLFeedReader in project vespa by vespa-engine.
the class SimpleFeeder method run.
public SimpleFeeder run() throws Throwable {
VespaXMLFeedReader reader = new VespaXMLFeedReader(in, docTypeMgr);
VespaXMLFeedReader.Operation op = new VespaXMLFeedReader.Operation();
printHeader();
while (failure == null) {
reader.read(op);
if (op.getType() == VespaXMLFeedReader.OperationType.INVALID) {
break;
}
Message msg = newMessage(op);
if (msg == null) {
err.println("ignoring operation; " + op.getType());
// ignore
continue;
}
msg.setContext(System.currentTimeMillis());
msg.setRoute(route);
Error err = session.sendBlocking(msg).getError();
if (err != null) {
throw new IOException(err.toString());
}
++numMessages;
}
while (failure == null && numReplies < numMessages) {
Thread.sleep(100);
}
if (failure != null) {
throw failure;
}
printReport();
return this;
}
Aggregations