public override void OnNext(StreamMessage <PartitionKey <TKey>, TPayload> batch)
        {
            var colkey     = batch.key.col;
            var col_bv     = batch.bitvector.col;
            var col_vsync  = batch.vsync.col;
            var col_vother = batch.vother.col;

            for (int i = 0; i < batch.Count; i++)
            {
                if ((col_bv[i >> 6] & (1L << (i & 0x3f))) != 0 && col_vother[i] >= 0)
                {
                    continue;
                }
                else if (col_vother[i] == StreamEvent.PunctuationOtherTime)
                {
                    this.array[this.populationCount++] = PartitionedStreamEvent.CreatePunctuation <TKey, TPayload>(colkey[i].Key, col_vsync[i]);
                }
                else if (col_vother[i] == PartitionedStreamEvent.LowWatermarkOtherTime)
                {
                    this.array[this.populationCount++] = PartitionedStreamEvent.CreateLowWatermark <TKey, TPayload>(col_vsync[i]);
                }
                else
                {
                    this.array[this.populationCount++] = new PartitionedStreamEvent <TKey, TPayload>(colkey[i].Key, col_vsync[i], col_vother[i], batch[i]);
                }

                if (this.populationCount == this.arrayLength)
                {
                    this.observer.OnNext(new ArraySegment <PartitionedStreamEvent <TKey, TPayload> >(this.array, 0, this.arrayLength));
                    this.populationCount = 0;
                    this.array           = this.generator();
                    this.arrayLength     = this.array.Length;
                }
            }
            batch.Free();
        }
示例#2
0
 public int Compare(PartitionedStreamEvent <TKey, TPayload> x, PartitionedStreamEvent <TKey, TPayload> y)
 {
     return(x.SyncTime.CompareTo(y.SyncTime));
 }
示例#3
0
 protected override void OnCompleted(long punctuationTime)
 {
     OnNext(new ArraySegment <PartitionedStreamEvent <TKey, TPayload> >(new[] { PartitionedStreamEvent.CreateLowWatermark <TKey, TPayload>(punctuationTime) }));
 }