コード例 #1
0
        public virtual void ProcessElement(StreamRecord <T> record)
        {
            var element      = record.Value;
            var newTimestamp = UserFunction.ExtractTimestamp(element, record.HasTimestamp ? record.Timestamp : long.MinValue);

            Output.Collect(record.Replace(record.Value, newTimestamp));
        }
        public virtual void ProcessElement(StreamRecord <TElement> record)
        {
            var element      = record.Value;
            var newTimestamp = UserFunction.ExtractTimestamp(element, record.HasTimestamp ? record.Timestamp : long.MinValue);

            Output.Collect(record.Replace(record.Value, newTimestamp));

            var nextWatermark = UserFunction.CheckAndGetNextWatermark(element, newTimestamp);

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