Exemple #1
0
        public override void Open()
        {
            base.Open();

            _currentWatermark  = long.MinValue;
            _watermarkInterval = ExecutionConfig.AutoWatermarkInterval;

            if (_watermarkInterval > 0)
            {
                var now = ProcessingTimeService.CurrentProcessingTime;
                ProcessingTimeService.RegisterTimer <bool>(now + _watermarkInterval, this);
            }
        }
Exemple #2
0
        public virtual void OnProcessingTime(long timestamp)
        {
            // emit watermark
            var newWatermark = UserFunction.CurrentWatermark;

            if (newWatermark != null && newWatermark.Timestamp > _currentWatermark)
            {
                _currentWatermark = newWatermark.Timestamp;
                Output.EmitWatermark(newWatermark);
            }

            // register next timer
            var now = ProcessingTimeService.CurrentProcessingTime;

            ProcessingTimeService.RegisterTimer <bool>(now + _watermarkInterval, this);
        }