private String formatTransferDetails(ThreadWatcher watcher) { String detailsText = ""; long bytesPerSecond = watcher.getBytesPerSecond(); detailsText = byteFormatter.formatByteSize(bytesPerSecond) + "/s"; if (watcher.isTimeRemainingAvailable()) { if (detailsText.trim().length() > 0) { detailsText += " - "; } long secondsRemaining = watcher.getTimeRemaining(); detailsText += "ETA: " + timeFormatter.formatTime(secondsRemaining, false); } return detailsText; }
private void displayProgressStatus(String prefix, ThreadWatcher watcher) { String progressMessage = prefix + watcher.getCompletedThreads() + "/" + watcher.getThreadCount(); // Show percentage of bytes transferred, if this info is available. if (watcher.isBytesTransferredInfoAvailable()) { String bytesTotalStr = byteFormatter.formatByteSize(watcher.getBytesTotal()); long percentage = (int) (((double)watcher.getBytesTransferred() / watcher.getBytesTotal()) * 100); String detailsText = formatTransferDetails(watcher); progressMessage += " - " + percentage + "% of " + bytesTotalStr + (detailsText.length() > 0 ? " (" + detailsText + ")" : ""); } else { long percentage = (int) (((double)watcher.getCompletedThreads() / watcher.getThreadCount()) * 100); progressMessage += " - " + percentage + "%"; } printProgressLine(progressMessage); }
@Override public org.jets3t.service.multithread.CancelEventTrigger getCancelEventListener() { return (org.jets3t.service.multithread.CancelEventTrigger) super.getCancelEventListener(); }
(new ThreadGroupManager(runnables, new ThreadWatcher(runnables.length), this.storageService.getJetS3tProperties(), true)
/** * @return * the expected total of bytes that will be transferred by the watched threads. * @throws IllegalStateException * if the bytes transferred information is not available - check this availability * with the {@link #isBytesTransferredInfoAvailable()} method. */ public long getBytesTotal() throws IllegalStateException { if (!isBytesTransferredInfoAvailable()) { throw new IllegalStateException("Bytes Transferred Info is not available in this object"); } return BytesProgressWatcher.sumBytesToTransfer(progressWatchers); }
/** * Convenience method to trigger an event cancellation via {@link CancelEventTrigger#cancelTask} * if this thread watcher is associated with an operation that can be cancelled. */ public void cancelTask() { if (isCancelTaskSupported()) { cancelEventListener.cancelTask(this); } }
(new ThreadGroupManager(runnables, new ThreadWatcher(runnables.length), this.storageService.getJetS3tProperties(), true)
/** * @return * the expected total of bytes that will be transferred by the watched threads. * @throws IllegalStateException * if the bytes transferred information is not available - check this availability * with the {@link #isBytesTransferredInfoAvailable()} method. */ public long getBytesTotal() throws IllegalStateException { if (!isBytesTransferredInfoAvailable()) { throw new IllegalStateException("Bytes Transferred Info is not available in this object"); } return BytesProgressWatcher.sumBytesToTransfer(progressWatchers); }
/** * Convenience method to trigger an event cancellation via {@link CancelEventTrigger#cancelTask} * if this thread watcher is associated with an operation that can be cancelled. */ public void cancelTask() { if (isCancelTaskSupported()) { cancelEventListener.cancelTask(this); } }
private void displayProgressStatus(String prefix, ThreadWatcher watcher) { String progressMessage = prefix + watcher.getCompletedThreads() + "/" + watcher.getThreadCount(); // Show percentage of bytes transferred, if this info is available. if (watcher.isBytesTransferredInfoAvailable()) { String bytesTotalStr = byteFormatter.formatByteSize(watcher.getBytesTotal()); long percentage = (int) (((double)watcher.getBytesTransferred() / watcher.getBytesTotal()) * 100); String detailsText = formatTransferDetails(watcher); progressMessage += " - " + percentage + "% of " + bytesTotalStr + (detailsText.length() > 0 ? " (" + detailsText + ")" : ""); } else { long percentage = (int) (((double)watcher.getCompletedThreads() / watcher.getThreadCount()) * 100); progressMessage += " - " + percentage + "%"; } printProgressLine(progressMessage); }
(new ThreadGroupManager(runnables, new ThreadWatcher(runnables.length), this.storageService.getJetS3tProperties(), true)
private String formatTransferDetails(ThreadWatcher watcher) { String detailsText = ""; long bytesPerSecond = watcher.getBytesPerSecond(); detailsText = byteFormatter.formatByteSize(bytesPerSecond) + "/s"; if (watcher.isTimeRemainingAvailable()) { if (detailsText.trim().length() > 0) { detailsText += " - "; } long secondsRemaining = watcher.getTimeRemaining(); detailsText += "ETA: " + timeFormatter.formatTime(secondsRemaining, false); } return detailsText; }
/** * @return * the count of bytes that have been transferred by the watched threads. * @throws IllegalStateException * if the bytes transferred information is not available - check this availability * with the {@link #isBytesTransferredInfoAvailable()} method. */ public long getBytesTransferred() { if (!isBytesTransferredInfoAvailable()) { throw new IllegalStateException("Bytes Transferred Info is not available in this object"); } return BytesProgressWatcher.sumBytesTransferred(progressWatchers); }
@Override public org.jets3t.service.multithread.CancelEventTrigger getCancelEventListener() { return (org.jets3t.service.multithread.CancelEventTrigger) super.getCancelEventListener(); }
(new ThreadGroupManager(runnables, new ThreadWatcher(runnables.length), this.storageService.getJetS3tProperties(), true)
/** * @return * the count of bytes that have been transferred by the watched threads. * @throws IllegalStateException * if the bytes transferred information is not available - check this availability * with the {@link #isBytesTransferredInfoAvailable()} method. */ public long getBytesTransferred() { if (!isBytesTransferredInfoAvailable()) { throw new IllegalStateException("Bytes Transferred Info is not available in this object"); } return BytesProgressWatcher.sumBytesTransferred(progressWatchers); }
(new ThreadGroupManager(runnables, new ThreadWatcher(runnables.length), this.storageService.getJetS3tProperties(), true)
(new ThreadGroupManager(runnables, new ThreadWatcher(runnables.length), this.storageService.getJetS3tProperties(), true)
(new ThreadGroupManager(runnables, new ThreadWatcher(runnables.length), this.storageService.getJetS3tProperties(), true)
(new ThreadGroupManager(runnables, new ThreadWatcher(runnables.length), this.storageService.getJetS3tProperties(), true)