@Override public void run() { RealtimeRecordDelayFilter.this.deliverIndirect(OUTPUT_PORT_NAME_RECORDS, monitoringRecord); } }, schedTimeFromNow, this.timeunit);
final boolean deliverIndirect(final String outputPortName, final Object data) { // NOPMD package for inner class return this.deliver(outputPortName, data); }
@Override public void terminate(final boolean error) { this.executor.shutdown(); if (!error) { long shutdownDelaySecondsFromNow = TimeUnit.SECONDS.convert( (this.latestSchedulingTime - this.timer.getCurrentTime(this.timeunit)) + this.shutdownDelay, this.timeunit); if (shutdownDelaySecondsFromNow < 0) { shutdownDelaySecondsFromNow = 0; } shutdownDelaySecondsFromNow += 2; // Add a buffer for the timeout. Having exactly the second for the last // event is unnecessarily tight. try { this.logger.info("Awaiting termination delay of {} seconds ...", shutdownDelaySecondsFromNow); if (!this.executor.awaitTermination(shutdownDelaySecondsFromNow, TimeUnit.SECONDS)) { this.logger.error("Termination delay triggerred before all scheduled records sent"); } } catch (final InterruptedException e) { this.logger.error("Interrupted while awaiting termination delay", e); } } }
delayFilterConfiguration.setProperty(RealtimeRecordDelayFilter.CONFIG_PROPERTY_NAME_ACCELERATION_FACTOR, Double.toString(this.realtimeAccelerationFactor)); final RealtimeRecordDelayFilter rtFilter = new RealtimeRecordDelayFilter(delayFilterConfiguration, analysisInstance);
TimerWithPrecision tmpTimer; try { tmpTimer = TimerWithPrecision.valueOf(this.strTimerOrigin); } catch (final IllegalArgumentException ex) { this.logger.warn("{} is no valid timer precision! Using MILLISECONDS instead.", this.strTimerOrigin);
monitoringThroughputFilter = new MonitoringThroughputFilter(configuration, this.analysisController); this.analysisController.connect(this.simpleListReader, ListReader.OUTPUT_PORT_NAME, monitoringThroughputFilter, MonitoringThroughputFilter.INPUT_PORT_NAME_RECORDS);
delayFilterConfiguration.setProperty(RealtimeRecordDelayFilter.CONFIG_PROPERTY_NAME_ACCELERATION_FACTOR, Double.toString(this.realtimeAccelerationFactor)); final RealtimeRecordDelayFilter rtFilter = new RealtimeRecordDelayFilter(delayFilterConfiguration, analysisInstance);
@Override public void terminate(final boolean error) { this.executor.shutdown(); if (!error) { long shutdownDelaySecondsFromNow = TimeUnit.SECONDS.convert((this.latestSchedulingTime - this.timer.getCurrentTime(this.timeunit)) + this.shutdownDelay, this.timeunit); if (shutdownDelaySecondsFromNow < 0) { shutdownDelaySecondsFromNow = 0; } shutdownDelaySecondsFromNow += 2; // Add a buffer for the timeout. Having exactly the second for the last event is unnecessarily tight. try { this.log.info("Awaiting termination delay of " + shutdownDelaySecondsFromNow + " seconds ..."); if (!this.executor.awaitTermination(shutdownDelaySecondsFromNow, TimeUnit.SECONDS)) { this.log.error("Termination delay triggerred before all scheduled records sent"); } } catch (final InterruptedException e) { this.log.error("Interrupted while awaiting termination delay", e); } } }
@Override public void run() { RealtimeRecordDelayFilter.this.deliverIndirect(OUTPUT_PORT_NAME_RECORDS, monitoringRecord); } }, schedTimeFromNow, this.timeunit);
final boolean deliverIndirect(final String outputPortName, final Object data) { // NOPMD package for inner class return this.deliver(outputPortName, data); }
TimerWithPrecision tmpTimer; try { tmpTimer = TimerWithPrecision.valueOf(this.strTimerOrigin); } catch (final IllegalArgumentException ex) { this.log.warn(this.strTimerOrigin + " is no valid timer precision! Using MILLISECONDS instead.");
delayFilterConfiguration.setProperty(RealtimeRecordDelayFilter.CONFIG_PROPERTY_NAME_ACCELERATION_FACTOR, Double.toString(this.accelerationFactor)); final RealtimeRecordDelayFilter delayFilter = new RealtimeRecordDelayFilter(delayFilterConfiguration, this.analysisController); this.analysisController.connect(this.countingFilterReader, CountingFilter.OUTPUT_PORT_NAME_RELAYED_EVENTS, delayFilter, RealtimeRecordDelayFilter.INPUT_PORT_NAME_RECORDS);
IMonitoringRecord.class }, description = "Receives the records to be delayed") public final void inputRecord(final IMonitoringRecord monitoringRecord) { final long currentTime = this.timer.getCurrentTime(this.timeunit);
final long currentTime = this.timer.getCurrentTime(this.timeunit);