#24
protected int calculate(int pending) {
if (!this.balancing)
return this.maxFlushCount;
//TODO make it smarter
int flushCount = this.highwater / pending;
if (flushCount > this.maxFlushCount)
flushCount = this.maxFlushCount;
if (flushCount < this.minFlushCount)
flushCount = this.minFlushCount;
return flushCount;
}
#24