@Override public int put(final List<T> buffer, final int from, final int to) throws IOException { for (int i = from; i < to; i++) { loadGenerator.recycle((Operation) buffer.get(i)); } return super.put(buffer, from, to); }
private boolean allOperationsCompleted() { try { if (generator.isStopped()) { return counterResults.longValue() >= generator.generatedOpCount(); } } catch (final RemoteException ignored) { } return false; }
private boolean isNothingToRecycle() { final long resultCount = counterResults.sum(); return recycleFlag && generator.isNothingToRecycle() && // all generated ops executed at least once resultCount > 0 && resultCount >= generator.generatedOpCount() && // no successful op results latestSuccOpResultByItem.size() == 0; }
@Override protected void doStart() throws IllegalStateException { try { resultsTransferTask.start(); } catch (final RemoteException ignored) { } try { driver.start(); } catch (final RemoteException ignored) { } catch (final IllegalStateException e) { LogUtil.exception(Level.WARN, e, "{}: failed to start the storage driver \"{}\"", id, driver); } try { generator.start(); } catch (final RemoteException ignored) { } catch (final IllegalStateException e) { LogUtil.exception( Level.WARN, e, "{}: failed to start the load generator \"{}\"", id, generator); } }
@Override protected final void doShutdown() { try (final Instance ctx = CloseableThreadContext.put(KEY_STEP_ID, id) .put(KEY_CLASS_NAME, getClass().getSimpleName())) { generator.stop(); Loggers.MSG.debug("{}: load generator \"{}\" stopped", id, generator.toString()); } catch (final RemoteException ignored) { } try (final Instance ctx = CloseableThreadContext.put(KEY_STEP_ID, id) .put(KEY_CLASS_NAME, getClass().getSimpleName())) { driver.shutdown(); Loggers.MSG.debug("{}: storage driver {} shutdown", id, driver.toString()); } catch (final RemoteException ignored) { } }
@Override protected final void doClose() throws InterruptRunException { try (final Instance logCtx = CloseableThreadContext.put(KEY_STEP_ID, id) .put(KEY_CLASS_NAME, getClass().getSimpleName())) { try { generator.close(); } catch (final IOException e) { LogUtil.exception( Level.ERROR, e, "Failed to close the load generator \"{}\"", generator.toString()); } try { driver.close(); } catch (final IOException e) { LogUtil.exception( Level.ERROR, e, "Failed to close the storage driver \"{}\"", driver.toString()); } try { resultsTransferTask.close(); } catch (final IOException e) { LogUtil.exception( Level.WARN, e, "{}: failed to stop the service coroutine {}", resultsTransferTask); } Loggers.MSG.debug("{}: closed the load step context", id); } } }
"{}: done due to all {} load operations have been completed", id, generator.generatedOpCount()); return true;
false, shuffleFlag)) { loadGenerator.start(); TimeUnit.SECONDS.sleep(TIME_LIMIT); System.out.println(loadGenerator.toString() + " rate: " + counter.sum() / TIME_LIMIT);
false, shuffleFlag)) { loadGenerator.start(); TimeUnit.SECONDS.sleep(TIME_LIMIT); System.out.println(
@Override public boolean put(final T item) throws IOException { loadGenerator.recycle((Operation) item); return super.put(item); }
false, shuffleFlag)) { loadGenerator.start(); TimeUnit.SECONDS.sleep(TIME_LIMIT); System.out.println(loadGenerator.toString() + " rate: " + counter.sum() / TIME_LIMIT);
@Override public int put(final List<T> buffer) throws IOException { for (int i = 0; i < buffer.size(); i++) { loadGenerator.recycle((Operation) buffer.get(i)); } return super.put(buffer); } }
false, shuffleFlag)) { loadGenerator.start(); TimeUnit.SECONDS.sleep(TIME_LIMIT); System.out.println(
false, shuffleFlag)) { loadGenerator.start(); TimeUnit.SECONDS.sleep(TIME_LIMIT); System.out.println(
false, shuffleFlag)) { loadGenerator.start(); TimeUnit.SECONDS.sleep(TIME_LIMIT); System.out.println(