public EventEnumerator(Span <Bucket> buckets, int firstEventIndex, int lastEventIndex)
 {
     _buckets            = buckets;
     _firstEventIndex    = firstEventIndex;
     _lastEventIndex     = lastEventIndex;
     _canMove            = _buckets.Length > 0;
     _currentBucketIndex = 0;
     _currentEventIndex  = _firstEventIndex - 1;
     _currentItem        = default;
 }
Beispiel #2
0
 public PartitionedEnumerator(Span<Bucket> buckets, int firstEventIndex, int lastEventIndex, long partitionSize, long partitionPadding)
 {
     _buckets = buckets;
     _firstEventIndex = firstEventIndex;
     _lastEventIndex = lastEventIndex;
     _canMove = _buckets.Length > 0;
     _currentBucketIndex = 0;
     _currentEventIndex = _firstEventIndex - 1;
     _currentItem = default;
 }
        public bool MoveNext()
        {
            if (!_canMove)
            {
                return(false);
            }

            var result = EnumerationHelper.MoveNext(_buckets, ref _currentBucketIndex, ref _currentEventIndex, _lastEventIndex);

            if (result)
            {
                _currentItem = new EventBucketInfo(
                    _buckets[_currentBucketIndex].Events[_currentEventIndex],
                    _currentBucketIndex,
                    _currentEventIndex
                    );
            }

            return(result);
        }