try { final long remainingOpCount = countLimit - generatedOpCount(); if (remainingOpCount > 0) { final List<I> items = getItems(itemInput, n); if (items == null) { itemInputFinishFlag = true; "End of items input \"{}\", generated op count: {}", itemInput.toString(), generatedOpCount()); } else { n = items.size(); if (n > 0) { pendingOpCount += buildOps(items, opBuff, n); t.printStackTrace(System.err); } finally { if (isFinished()) { try { stop(); } catch (final IllegalStateException ignored) {
@Override protected final void doStop() throws IllegalStateException { super.doStop(); Loggers.MSG.debug( "{}: generated {}, recycled {}, output {} operations", LoadGeneratorImpl.this.toString(), builtTasksCounter.sum(), recycledOpCounter.sum(), outputOpCounter.sum()); }
new LoadGeneratorImpl( itemInput, opsBuilder,
private boolean isFinished() { return outputFinishFlag || itemInputFinishFlag && opInputFinishFlag && generatedOpCount() == outputOpCounter.sum(); }
new LoadGeneratorImpl( itemInput, opsBuilder,
new LoadGeneratorImpl( itemInput, opsBuilder,
@Override protected final void doClose() throws InterruptRunException, IOException { recycleQueue.clear(); // the item input may be instantiated by the load generator builder which has no reference to it // so the load // generator builder should close it if (itemInput != null) { try { inputLock.tryLock(Fiber.WARN_DURATION_LIMIT_NANOS, TimeUnit.NANOSECONDS); itemInput.close(); } catch (final InterruptedException e) { throw new InterruptRunException(e); } catch (final Exception e) { LogUtil.exception(Level.WARN, e, "{}: failed to close the item input", toString()); } } // ops builder is instantiated by the load generator builder which forgets it so the load // generator should // close it opsBuilder.close(); }
new LoadGeneratorImpl<>( itemInput, opsBuilder,
new LoadGeneratorImpl( itemInput, opsBuilder,
new LoadGeneratorImpl( itemInput, opsBuilder,
new LoadGeneratorImpl<>( itemInput, opsBuilder,