private UniformPair<EventBean[]> Output(
            bool isSynthesize,
            bool isJoin)
        {
            IList<EventBean> newEvents = new List<EventBean>(4);
            foreach (var level in processor.GroupByRollupDesc.Levels) {
                var groupGenerators = outputLimitGroupRepsPerLevel[level.LevelNumber];
                foreach (var entry in groupGenerators) {
                    processor.GenerateOutputBatched(entry.Key, level, entry.Value, true, isSynthesize, newEvents, null);
                }
            }

            var newEventsArr = newEvents.ToArrayOrNull();

            EventBean[] oldEventsArr = null;
            if (processor.IsSelectRStream) {
                IList<EventBean> oldEventList = new List<EventBean>(4);
                foreach (var entry in groupRepsOutputLastUnordRStream) {
                    oldEventList.AddAll(entry.Values);
                    entry.Clear();
                }

                if (!oldEventList.IsEmpty()) {
                    oldEventsArr = oldEventList.ToArray();
                }
            }

            first = true;

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

            return new UniformPair<EventBean[]>(newEventsArr, oldEventsArr);
        }
Esempio n. 2
0
        private UniformPair <EventBean[]> Output(bool isSynthesize, bool isJoin)
        {
            IList <EventBean> newEvents = new List <EventBean>(4);

            foreach (var level in _processor.Prototype.GroupByRollupDesc.Levels)
            {
                var groupGenerators = _outputLimitGroupRepsPerLevel[level.LevelNumber];
                foreach (var entry in groupGenerators)
                {
                    _processor.GenerateOutputBatched(isJoin, entry.Key, level, entry.Value, true, isSynthesize, newEvents, null);
                }
            }
            var newEventsArr = (newEvents.IsEmpty()) ? null : newEvents.ToArrayOrNull();

            foreach (var outputLimitGroupRepsPerLevelItem in _outputLimitGroupRepsPerLevel)
            {
                outputLimitGroupRepsPerLevelItem.Clear();
            }

            EventBean[] oldEventsArr = null;
            if (_groupRepsOutputLastUnordRStream != null)
            {
                IList <EventBean> oldEventList = new List <EventBean>(4);
                foreach (var entry in _groupRepsOutputLastUnordRStream)
                {
                    oldEventList.AddAll(entry.Values);
                }
                if (!oldEventList.IsEmpty())
                {
                    oldEventsArr = oldEventList.ToArrayOrNull();
                    foreach (var groupRepsOutputLastUnordRStreamItem in _groupRepsOutputLastUnordRStream)
                    {
                        groupRepsOutputLastUnordRStreamItem.Clear();
                    }
                }
            }

            if (newEventsArr == null && oldEventsArr == null)
            {
                return(null);
            }
            return(new UniformPair <EventBean[]>(newEventsArr, oldEventsArr));
        }
        private UniformPair <EventBean[]> Output(bool isSynthesize, bool isJoin)
        {
            IList <EventBean> newEvents = new List <EventBean>(4);

            foreach (var level in _processor.Prototype.GroupByRollupDesc.Levels)
            {
                IDictionary <object, EventBean[]> groupGenerators = _processor.OutputLimitGroupRepsPerLevel[level.LevelNumber];
                foreach (KeyValuePair <object, EventBean[]> entry in groupGenerators)
                {
                    _processor.GenerateOutputBatched(isJoin, entry.Key, level, entry.Value, true, isSynthesize, newEvents, null);
                }
            }
            var newEventsArr = (newEvents.IsEmpty()) ? null : newEvents.ToArray();

            EventBean[] oldEventsArr = null;
            if (_processor.Prototype.IsSelectRStream)
            {
                IList <EventBean> oldEventList = new List <EventBean>(4);
                foreach (var entry in _groupRepsOutputLastUnordRStream)
                {
                    oldEventList.AddAll(entry.Values);
                    entry.Clear();
                }
                if (!oldEventList.IsEmpty())
                {
                    oldEventsArr = oldEventList.ToArray();
                }
            }

            _first = true;

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