Loading kinetic-simulator/src/main/java/com/seagate/kinetic/simulator/internal/BatchOperationHandler.java +7 −5 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ public class BatchOperationHandler { throws InvalidBatchException, InvalidRequestException { if (this.batch != null) { throw new InvalidRequestException("Alread in batch mode."); this.waitForBatchToFinish(); } // init with this context Loading Loading @@ -124,9 +124,11 @@ public class BatchOperationHandler { private synchronized void waitForBatchToFinish() { long timeout = 0; long totalWaitTime = 0; long period = 3000; long start = System.currentTimeMillis(); while (batch != null) { try { Loading @@ -137,14 +139,14 @@ public class BatchOperationHandler { return; } timeout += period; totalWaitTime = (System.currentTimeMillis() - start); if (timeout >= MAX_TIME_OUT) { if (totalWaitTime >= MAX_TIME_OUT) { throw new RuntimeException( "Timeout waiting for batch mode to finish"); } else { logger.warning("waiting for batch mode to finish., total wait time =" + timeout); + totalWaitTime); } } catch (InterruptedException e) { logger.log(Level.WARNING, e.getMessage(), e); Loading Loading
kinetic-simulator/src/main/java/com/seagate/kinetic/simulator/internal/BatchOperationHandler.java +7 −5 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ public class BatchOperationHandler { throws InvalidBatchException, InvalidRequestException { if (this.batch != null) { throw new InvalidRequestException("Alread in batch mode."); this.waitForBatchToFinish(); } // init with this context Loading Loading @@ -124,9 +124,11 @@ public class BatchOperationHandler { private synchronized void waitForBatchToFinish() { long timeout = 0; long totalWaitTime = 0; long period = 3000; long start = System.currentTimeMillis(); while (batch != null) { try { Loading @@ -137,14 +139,14 @@ public class BatchOperationHandler { return; } timeout += period; totalWaitTime = (System.currentTimeMillis() - start); if (timeout >= MAX_TIME_OUT) { if (totalWaitTime >= MAX_TIME_OUT) { throw new RuntimeException( "Timeout waiting for batch mode to finish"); } else { logger.warning("waiting for batch mode to finish., total wait time =" + timeout); + totalWaitTime); } } catch (InterruptedException e) { logger.log(Level.WARNING, e.getMessage(), e); Loading