/** * @return Current snapshot of streaming progress. */ public StreamState getCurrentState() { return new StreamState(planId, description, coordinator.getAllSessionInfo()); }
@Override public void onSuccess(StreamState streamState) { ProgressEventType type; String message; if (streamState.hasFailedSession()) { type = ProgressEventType.ERROR; message = "Some bootstrap stream failed"; } else { type = ProgressEventType.SUCCESS; message = "Bootstrap streaming success"; } ProgressEvent currentProgress = new ProgressEvent(type, receivedFiles.get(), totalFilesToReceive.get(), message); fireProgressEvent("bootstrap", currentProgress); }
/** * @return Current snapshot of streaming progress. */ public StreamState getCurrentState() { return new StreamState(planId, description, coordinator.getAllSessionInfo()); }
@Override public void onSuccess(StreamState streamState) { ProgressEventType type; String message; if (streamState.hasFailedSession()) { type = ProgressEventType.ERROR; message = "Some bootstrap stream failed"; } else { type = ProgressEventType.SUCCESS; message = "Bootstrap streaming success"; } ProgressEvent currentProgress = new ProgressEvent(type, receivedFiles.get(), totalFilesToReceive.get(), message); fireProgressEvent("bootstrap", currentProgress); }
/** * @return Current snapshot of streaming progress. */ public StreamState getCurrentState() { return new StreamState(planId, description, coordinator.getAllSessionInfo()); }
@Override public void onSuccess(StreamState streamState) { ProgressEventType type; String message; if (streamState.hasFailedSession()) { type = ProgressEventType.ERROR; message = "Some bootstrap stream failed"; } else { type = ProgressEventType.SUCCESS; message = "Bootstrap streaming success"; } ProgressEvent currentProgress = new ProgressEvent(type, receivedFiles.get(), totalFilesToReceive.get(), message); fireProgressEvent("bootstrap", currentProgress); }
/** * @return Current snapshot of streaming progress. */ public StreamState getCurrentState() { return new StreamState(planId, description, coordinator.getAllSessionInfo()); }
private synchronized void maybeComplete() { if (!coordinator.hasActiveSessions()) { StreamState finalState = getCurrentState(); if (finalState.hasFailedSession()) { logger.warn("[Stream #{}] Stream failed", planId); setException(new StreamException(finalState, "Stream failed")); } else { logger.info("[Stream #{}] All sessions completed", planId); set(finalState); } } } }
public static StreamState fromCompositeData(CompositeData cd) { assert cd.getCompositeType().equals(COMPOSITE_TYPE); Object[] values = cd.getAll(ITEM_NAMES); UUID planId = UUID.fromString((String) values[0]); String description = (String) values[1]; Set<SessionInfo> sessions = Sets.newHashSet(Iterables.transform(Arrays.asList((CompositeData[]) values[2]), new Function<CompositeData, SessionInfo>() { public SessionInfo apply(CompositeData input) { return SessionInfoCompositeData.fromCompositeData(input); } })); return new StreamState(planId, description, sessions); } }
private synchronized void maybeComplete() { if (!coordinator.hasActiveSessions()) { StreamState finalState = getCurrentState(); if (finalState.hasFailedSession()) { logger.warn("[Stream #{}] Stream failed", planId); setException(new StreamException(finalState, "Stream failed")); } else { logger.info("[Stream #{}] All sessions completed", planId); set(finalState); } } } }
public static StreamState fromCompositeData(CompositeData cd) { assert cd.getCompositeType().equals(COMPOSITE_TYPE); Object[] values = cd.getAll(ITEM_NAMES); UUID planId = UUID.fromString((String) values[0]); String description = (String) values[1]; Set<SessionInfo> sessions = Sets.newHashSet(Iterables.transform(Arrays.asList((CompositeData[]) values[2]), new Function<CompositeData, SessionInfo>() { public SessionInfo apply(CompositeData input) { return SessionInfoCompositeData.fromCompositeData(input); } })); return new StreamState(planId, description, sessions); } }
private synchronized void maybeComplete() { if (!coordinator.hasActiveSessions()) { StreamState finalState = getCurrentState(); if (finalState.hasFailedSession()) { logger.warn("[Stream #{}] Stream failed", planId); setException(new StreamException(finalState, "Stream failed")); } else { logger.info("[Stream #{}] All sessions completed", planId); set(finalState); } } } }
public static StreamState fromCompositeData(CompositeData cd) { assert cd.getCompositeType().equals(COMPOSITE_TYPE); Object[] values = cd.getAll(ITEM_NAMES); UUID planId = UUID.fromString((String) values[0]); String description = (String) values[1]; Set<SessionInfo> sessions = Sets.newHashSet(Iterables.transform(Arrays.asList((CompositeData[]) values[2]), new Function<CompositeData, SessionInfo>() { public SessionInfo apply(CompositeData input) { return SessionInfoCompositeData.fromCompositeData(input); } })); return new StreamState(planId, description, sessions); } }
private synchronized void maybeComplete() { if (!coordinator.hasActiveSessions()) { StreamState finalState = getCurrentState(); if (finalState.hasFailedSession()) { logger.warn("[Stream #{}] Stream failed", planId); setException(new StreamException(finalState, "Stream failed")); } else { logger.info("[Stream #{}] All sessions completed", planId); set(finalState); } } } }
public static StreamState fromCompositeData(CompositeData cd) { assert cd.getCompositeType().equals(COMPOSITE_TYPE); Object[] values = cd.getAll(ITEM_NAMES); UUID planId = UUID.fromString((String) values[0]); String description = (String) values[1]; Set<SessionInfo> sessions = Sets.newHashSet(Iterables.transform(Arrays.asList((CompositeData[]) values[2]), new Function<CompositeData, SessionInfo>() { public SessionInfo apply(CompositeData input) { return SessionInfoCompositeData.fromCompositeData(input); } })); return new StreamState(planId, description, sessions); } }