in src/main/java/com/aliyun/openservices/aliyun/log/producer/internals/LogAccumulator.java [217:229]
public List<ProducerBatch> remainingBatches() {
if (!closed) {
throw new IllegalStateException(
"cannot get the remaining batches before the log accumulator closed");
}
List<ProducerBatch> remainingBatches = new ArrayList<ProducerBatch>();
while (appendsInProgress()) {
drainTo(remainingBatches);
}
drainTo(remainingBatches);
batches.clear();
return remainingBatches;
}