Ejemplo n.º 1
0
        private UniformPair<EventBean[]> Output(
            bool isSynthesize,
            bool join)
        {
            IList<EventBean> newEvents = new List<EventBean>(4);
            processor.GenerateOutputBatchedArrFromIterator(
                join,
                groupReps.GetEnumerator(),
                true,
                isSynthesize,
                newEvents,
                null);
            groupReps.Clear();
            var newEventsArr = newEvents.IsEmpty() ? null : newEvents.ToArray();

            EventBean[] oldEventsArr = null;
            if (!groupRepsOutputLastUnordRStream.IsEmpty()) {
                var oldEvents = groupRepsOutputLastUnordRStream.Values;
                oldEventsArr = oldEvents.ToArray();
                groupRepsOutputLastUnordRStream.Clear();
            }

            if (newEventsArr == null && oldEventsArr == null) {
                return null;
            }

            return new UniformPair<EventBean[]>(newEventsArr, oldEventsArr);
        }
        private UniformPair<EventBean[]> Output(
            bool isSynthesize,
            bool join)
        {
            // generate latest new-events from group representatives
            IList<EventBean> newEvents = new List<EventBean>(4);
            processor.GenerateOutputBatchedArrFromIterator(
                join,
                groupReps.GetEnumerator(),
                true,
                isSynthesize,
                newEvents,
                null);
            var newEventsArr = newEvents.IsEmpty() ? null : newEvents.ToArray();

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

            first = true;

            if (newEventsArr == null && oldEventsArr == null) {
                return null;
            }

            return new UniformPair<EventBean[]>(newEventsArr, oldEventsArr);
        }