Upload failed for{@link StreamVariable} variant.

@param event
StreamingEndEvent
329118
@Override
    public void streamingFailed(final StreamingErrorEvent event) {
        assertStateConsistency(fileUploadId, event.getFileName());

        if (!isUploadInterrupted()) {
            interruptUploadDueToUploadFailed();
        }
        publishUploadFailedAndFinishedEvent(fileUploadId, event.getException());
    }
1317551
private void processEvent(EventModel<?> event) {
        if (!event.getSource().isCreatedFromInstance()) {
            error("event: " + event + "has invalid source");
            return;
        }
        debug("EventFired: " + event.toString() + " from " + event.getSource().getID());
        submit(() -> event.lifecycleCallback(EventLifeCycle.START));

        if (checkEventsControllers(event)) {
            submit(() -> event.lifecycleCallback(EventLifeCycle.APPROVED));
            submit(() -> event.lifecycleCallback(EventLifeCycle.RESOURCE));
            List<ResourceModel> resourceList = getMain().getResourceManager().generateResources(event);
            event.addResources(resourceList);
            submit(() -> event.lifecycleCallback(EventLifeCycle.LISTENERS));
            List<EventListenerModel> listenersTemp = event.getAllInformations().parallelStream()
                    .map(listeners::get)
                    .filter(Objects::nonNull)
                    .flatMap(Collection::stream)
                    .distinct()
                    .collect(Collectors.toList());

            List<CompletableFuture> futures = listenersTemp.stream()
                    .map(eventListener -> submit(() -> eventListener.eventFired(event)))
                    .collect(Collectors.toList());
            try {
                timeOut(futures, 1000);
            } catch (InterruptedException e) {
                error("interrupted", e);
            }
            submit(() -> event.lifecycleCallback(EventLifeCycle.OUTPUT));
            getMain().getOutputManager().passDataToOutputPlugins(event);
            submit(() -> event.lifecycleCallback(EventLifeCycle.ENDED));
            List<EventListenerModel> finishListenersTemp = event.getAllInformations().parallelStream()
                    .map(finishListeners::get)
                    .filter(Objects::nonNull)
                    .flatMap(Collection::stream)
                    .distinct()
                    .collect(Collectors.toList());

            futures = finishListenersTemp.stream()
                    .map(eventListener -> submit(() -> eventListener.eventFired(event)))
                    .collect(Collectors.toList());

            try {
                timeOut(futures, 1000);
            } catch (InterruptedException e) {
                error("interrupted", e);
            }
        } else {
            debug("canceling: " + event.toString() + " from " + event.getSource().getID());
            submit(() -> event.lifecycleCallback(EventLifeCycle.CANCELED));
        }
    }
708352
@Override
    public void process(Object event) throws Exception {
        int secOffset = TimeUtils.secOffset();
        if (secOffset < UPLOAD_TIME_OFFSET_SEC) {
            JStormUtils.sleepMs((UPLOAD_TIME_OFFSET_SEC - secOffset) * 1000);
        } else if (secOffset == UPLOAD_TIME_OFFSET_SEC) {
            // do nothing
        } else {
            JStormUtils.sleepMs((60 - secOffset + UPLOAD_TIME_OFFSET_SEC) * 1000);
        }
        if (topologyMetricContext.getUploadedWorkerNum() > 0) {
            metricLogger.info("force upload metrics.");
            mergeAndUploadMetrics();
        }
    }
679449
@Override
    public void transferFailed(TransferEvent event) {
        TransferResource resource = event.getResource();

        downloads.remove(resource);

        StringBuilder sb = new StringBuilder().append("Failed")
            .append(event.getRequestType() == TransferEvent.RequestType.PUT ? " uploading " : " downloading ")
            .append(resource.getResourceName())
            .append(event.getRequestType() == TransferEvent.RequestType.PUT ? " into " : " from ")
            .append(resource.getRepositoryUrl()).append(". ");

        if (event.getException() != null) {
            sb.append("Reason: \n").append(event.getException());
        }

        log.warning(sb.toString());
    }
15314
function (event) {
                var
                    reader = event.target,
                    buffer,
                    len,
                    result,
                    idx;
                _gpfAssert(reader === this._reader, "Unexpected change of reader");
                if (reader.error) {
                    gpfFireEvent.call(this,
                        gpfI.IReadableStream.ERROR,
                        {
                            // According to W3C
                            // http://www.w3.org/TR/domcore/#interface-domerror
                            error: {
                                name: reader.error.name,
                                message: reader.error.message
                            }
                        },
                        this._eventsHandler
                    );
                } else if (reader.readyState === FileReader.DONE) {
                    buffer = new Int8Array(reader.result);
                    len = buffer.length;
                    result = [];
                    for (idx = 0; idx < len; ++idx) {
                        result.push(buffer[idx]);
                    }
                    gpfFireEvent.call(this, gpfI.IReadableStream.EVENT_DATA, {buffer: result}, this._eventsHandler);
                }
            }
1157428
@Override
	public void put(ContentEvent event) {
		for (SamzaSystemStream stream:systemStreams) {
			stream.send(collector,event);
		}
	}
1048278
private void postEvent(String t, ActiveConfiguration c, Exception e) {
        Map<String, Object> eventProps = new HashMap<String, Object>(4);

        eventProps.put(HttpServiceConstants.ENDPOINT_NAME, endpointName);
        eventProps.put(HttpServiceConstants.ENDPOINT_ACTIVE_PORT, c.activePort);
        eventProps.put(HttpServiceConstants.ENDPOINT_CONFIG_HOST, c.configHost);
        eventProps.put(HttpServiceConstants.ENDPOINT_CONFIG_PORT, c.configPort);
        eventProps.put(HttpServiceConstants.ENDPOINT_IS_HTTPS, isHttps);

        if (e != null) {
            eventProps.put(HttpServiceConstants.ENDPOINT_EXCEPTION, e.toString());
        }

        EventAdmin engine = owner.getEventAdmin();
        if (engine != null) {
            Event event = new Event(t, eventProps);
            engine.postEvent(event);
        }
    }
1044329
private S waitForCompletionAndThrowIfUploadFailed() throws IOException {
    try {
      return uploadOperation.get();
    } catch (InterruptedException e) {
      // If we were interrupted, we need to cancel the upload operation.
      uploadOperation.cancel(true);
      IOException exception = new ClosedByInterruptException();
      exception.addSuppressed(e);
      throw exception;
    } catch (ExecutionException e) {
      if (e.getCause() instanceof Error) {
        throw (Error) e.getCause();
      }
      throw new IOException("Upload failed", e.getCause());
    }
  }
1154819
function handle_stream_error(stream) {
    return stream.on('error', function (/*error*/) {
        // console.error(error);
        $.util.log.apply(this, arguments);
        stream.end();
    });
}
47789
function (event) {
            var
                eventsHandler;
            if (event
                && event.type() === _gpfI.IWritableStream.EVENT_ERROR) {
                gpfFireEvent.call(this, event, this._eventsHandler);
            } else if (0 === this._buffer.length) {
                eventsHandler = this._eventsHandler;
                this._eventsHandler = null;
                gpfFireEvent.call(this, _gpfI.IWritableStream.EVENT_READY, eventsHandler);
            } else {
                this._stream.write(this._buffer.shift(), this._flushed.bind(this));
            }
        }
141594
protected void onTransformerErrorOccurred(Source failedObject, Exception exception) {

        for (TransformerEventListener listener : transformerEventListeners)
            fireErrorEvent(listener, new TransformerErrorEvent(this, failedObject, exception));
    }

    /**
     * (Re)-fires a preconstructed event.
     * @param event The event to fire
     */
    protected void onTransformerErrorOccurred(TransformerErrorEvent event) {

        for (TransformerEventListener listener : transformerEventListeners)
            fireErrorEvent(listener, event);
    }

    /**
     * Fires the given event on the given listener.
     * @param listener The listener to fire the event to.
     * @param event The event to fire.
     */
    private void fireErrorEvent(TransformerEventListener listener, TransformerErrorEvent event) {

        try {
            listener.ErrorOccurred(event);
        }
        catch (RuntimeException e) {
            // Log this somehow
            System.err.println("Exception thrown while trying to invoke event listener, removing bed behaved listener.");
            e.printStackTrace();
            removeTransformerEventListener(listener);
        }
    }
444301
public void publish(Object event) {
        Objects.requireNonNull(event, Required.EVENT.toString());
        
        this.eventBus.post(event);
        this.events.getAndIncrement();
    }
1370268
public void addFilePart(final String fieldName, final InputStream stream, final String contentType)
        throws IOException
    {
        addFilePart(fieldName, stream, null, contentType);
    }
1129874
@Override
	public void setOutputType(TypeInformation<OUT> outTypeInfo, ExecutionConfig executionConfig) {
		StreamingFunctionUtils.setOutputType(userFunction, outTypeInfo, executionConfig);
	}
409891
@POST
	@Path("/upload")
	@Consumes("multipart/form-data")
	@AllowSecurityBypassedByToken
	public void upload(MultipartFormDataInput input) throws IOException {
		Map<String, List<InputPart>> formDataMap = input.getFormDataMap();
		List<InputPart> inputParts = formDataMap.get("uploadedFile");

		for (InputPart inputPart : inputParts) {
			String fileName = getFileName(inputPart.getHeaders());
			InputStream inputStream = inputPart.getBody(InputStream.class, null);
			File file = File.createTempFile(HomeWS.class.getSimpleName(), ".tmp");
			IOUtils.copy(inputStream, new FileOutputStream(file));
			uploadedFiles.put(fileName, file);
		}
	}
1292225
@Override
    public synchronized void update(ReceiveStreamEvent evt) {

        Participant participant = evt.getParticipant();    // could be null.
        ReceiveStream stream = evt.getReceiveStream();  // could be null.

        if (evt instanceof RemotePayloadChangeEvent) {
            LOGGER.severe("  - Received an RTP PayloadChangeEvent.");
            LOGGER.severe("Sorry, cannot handle payload change.");

        }
        else if (evt instanceof NewReceiveStreamEvent) {

            try {
                stream = evt.getReceiveStream();
                DataSource ds = stream.getDataSource();

                // Find out the formats.
                RTPControl ctl = (RTPControl) ds.getControl("javax.jmf.rtp.RTPControl");
                if (ctl != null) {
                    LOGGER.severe("  - Received new RTP stream: " + ctl.getFormat());
                }
                else
                    LOGGER.severe("  - Received new RTP stream");

                if (participant == null)
                    LOGGER.severe("      The sender of this stream had yet to be identified.");
                else {
                    LOGGER.severe("      The stream comes from: " + participant.getCNAME());
                }

                // create a player by passing datasource to the Media Manager
                Player p = javax.media.Manager.createPlayer(ds);
                if (p == null)
                    return;

                p.addControllerListener(this);
                p.realize();
                jingleMediaSession.mediaReceived(participant != null ? participant.getCNAME() : "");

                // Notify initialize() that a new stream had arrived.
                synchronized (dataSync) {
                    dataReceived = true;
                    dataSync.notifyAll();
                }

            }
            catch (Exception e) {
                LOGGER.severe("NewReceiveStreamEvent exception " + e.getMessage());
                return;
            }

        }
        else if (evt instanceof StreamMappedEvent) {

            if (stream != null && stream.getDataSource() != null) {
                DataSource ds = stream.getDataSource();
                // Find out the formats.
                RTPControl ctl = (RTPControl) ds.getControl("javax.jmf.rtp.RTPControl");
                LOGGER.severe("  - The previously unidentified stream ");
                if (ctl != null)
                    LOGGER.severe("      " + ctl.getFormat());
                LOGGER.severe("      had now been identified as sent by: " + participant.getCNAME());
            }
        }
        else if (evt instanceof ByeEvent) {

            LOGGER.severe("  - Got \"bye\" from: " + participant.getCNAME());

        }

    }
979281
@Override
    public final void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
        if (evt == Http2ConnectionPrefaceAndSettingsFrameWrittenEvent.INSTANCE) {
            // The user event implies that we are on the client.
            tryExpandConnectionFlowControlWindow(connection());
        } else if (evt instanceof UpgradeEvent) {
            UpgradeEvent upgrade = (UpgradeEvent) evt;
            try {
                onUpgradeEvent(ctx, upgrade.retain());
                Http2Stream stream = connection().stream(HTTP_UPGRADE_STREAM_ID);
                if (stream.getProperty(streamKey) == null) {
                    // TODO: improve handler/stream lifecycle so that stream isn't active before handler added.
                    // The stream was already made active, but ctx may have been null so it wasn't initialized.
                    // https://github.com/netty/netty/issues/4942
                    onStreamActive0(stream);
                }
                upgrade.upgradeRequest().headers().setInt(
                        HttpConversionUtil.ExtensionHeaderNames.STREAM_ID.text(), HTTP_UPGRADE_STREAM_ID);
                stream.setProperty(upgradeKey, true);
                InboundHttpToHttp2Adapter.handle(
                        ctx, connection(), decoder().frameListener(), upgrade.upgradeRequest().retain());
            } finally {
                upgrade.release();
            }
            return;
        }
        super.userEventTriggered(ctx, evt);
    }