Ejemplo n.º 1
0
        private UniformPair <EventBean[]> Output(bool isSynthesize, bool join)
        {
            IList <EventBean> newEvents = new List <EventBean>(4);

            _processor.GenerateOutputBatchedArr(join, _groupReps.GetEnumerator(), true, isSynthesize, newEvents, null);
            _groupReps.Clear();
            EventBean[] newEventsArr = (newEvents.IsEmpty()) ? null : newEvents.ToArrayOrNull();

            EventBean[] oldEventsArr = null;
            if (_groupRepsOutputLastUnordRStream != null && !_groupRepsOutputLastUnordRStream.IsEmpty())
            {
                ICollection <EventBean> oldEvents = _groupRepsOutputLastUnordRStream.Values;
                oldEventsArr = oldEvents.ToArrayOrNull();
            }

            if (newEventsArr == null && oldEventsArr == null)
            {
                return(null);
            }
            return(new UniformPair <EventBean[]>(newEventsArr, oldEventsArr));
        }
Ejemplo n.º 2
0
        private UniformPair <EventBean[]> Output(bool isSynthesize, bool join)
        {
            // generate latest new-events from group representatives
            IList <EventBean> newEvents = new List <EventBean>(4);

            _processor.GenerateOutputBatchedArr(join, _groupReps.GetEnumerator(), true, isSynthesize, newEvents, null);
            var newEventsArr = (newEvents.IsEmpty()) ? null : newEvents.ToArrayOrNull();

            // use old-events as retained, if any
            EventBean[] oldEventsArr = null;
            if (!_groupRepsOutputLastUnordRStream.IsEmpty())
            {
                var oldEvents = _groupRepsOutputLastUnordRStream.Values;
                oldEventsArr = oldEvents.ToArrayOrNull();
                _groupRepsOutputLastUnordRStream.Clear();
            }
            _first = true;

            if (newEventsArr == null && oldEventsArr == null)
            {
                return(null);
            }
            return(new UniformPair <EventBean[]>(newEventsArr, oldEventsArr));
        }