// nothing to do here.
if (this.iterator.hasNext() || streamEnded) {
return;
}
QueryResult qr;
try {
qr = client.streamNext(queryResult.getFields());
} catch (ConnectionException e) {
logger.error("connection exception while streaming", e);
throw new RuntimeException(e);
}
// null reply indicates EndOfStream, mark stream as ended and return
if (qr == null) {
streamEnded = true;
return;
}
// For scatter streaming queries, VtGate sends fields data from each
// shard. Since fields has already been fetched, just ignore these and
// fetch the next batch.
if (qr.getRows().size() == 0) {
fetchMoreIfNeeded();
} else {
// We got more rows, update the current buffer and iterator
queryResult = qr;
iterator = queryResult.getRows().iterator();