Esempio n. 1
0
 public override IDisposable Subscribe(IStreamObserver <TOuterKey, TResult> observer)
 {
     if (Properties.IsColumnar && CanGenerateColumnar())
     {
         return(Source.Subscribe(GetPipe(observer)));
     }
     else
     {
         return(Source.Subscribe(CreatePipe(observer)));
     }
 }
Esempio n. 2
0
        public override IDisposable Subscribe(IStreamObserver <CompoundGroupKey <TOuterKey, TInnerKey>, TSource> observer)
        {
            var pipe = Properties.IsColumnar
                ? GetPipe(observer)
                : CreatePipe(observer);

            return(Source.Subscribe(pipe));
        }
Esempio n. 3
0
        public override IDisposable Subscribe(IStreamObserver <CompoundGroupKey <TOuterKey, TInnerKey>, TSource> observer)
        {
            if (totalBranchesL2 <= 1)
            {
                return(singleThreadedShuffler.Subscribe(observer));
            }

            numBranches++;
            if (pipe == null)
            {
                if (this.Properties.IsColumnar && CanGenerateColumnar())
                {
                    pipe = GetPipe(observer, totalBranchesL2, shuffleId);
                }
                else
                {
                    pipe = CreatePipe(observer);
                }
            }
            var o = observer;

            pipe.AddObserver(o);

            var d = o as IDisposable;

            if (numBranches < totalBranchesL2)
            {
                return(d ?? Utility.EmptyDisposable);
            }
            else
            {
                // Reset status for next set of subscribe calls
                var oldpipe = pipe;
                pipe        = null;
                numBranches = 0;

                if (d == null)
                {
                    return(Source.Subscribe(oldpipe));
                }
                else
                {
                    return(Utility.CreateDisposable(Source.Subscribe(oldpipe), d));
                }
            }
        }
Esempio n. 4
0
        public override IDisposable Subscribe(IStreamObserver <CompoundGroupKey <TOuterKey, TInnerKey>, TSource> observer)
        {
            IStreamObserver <TOuterKey, TSource> pipe = null;

            if (Properties.IsColumnar)
            {
                pipe = GetPipe(observer);
            }
            else
            {
                pipe = CreatePipe(observer);
            }

            return(Source.Subscribe(pipe));
        }
Esempio n. 5
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public IDisposable Connect()
 {
     return(Source.Subscribe(Config.StreamScheduler.RegisterStreamObserver(this)));
 }