示例#1
0
        private bool CanGenerateGroupedAFAEventListPipe()
        {
            var typeOfTKey      = typeof(TKey);
            var typeOfTPayload  = typeof(TPayload);
            var typeOfTRegister = typeof(TRegister);

            if (!typeOfTPayload.CanRepresentAsColumnar())
            {
                return(false);
            }
            if (!typeOfTRegister.CanRepresentAsColumnar())
            {
                return(false);
            }
            if (typeOfTKey.GetPartitionType() != null)
            {
                return(false);
            }

            var lookupKey = CacheKey.Create((object)this.afa);

            var generatedPipeType = cachedPipes.GetOrAdd(lookupKey, key => GroupedAfaEventListTemplate.GenerateAFA(this));

            this.errorMessages = generatedPipeType.Item2;
            return(generatedPipeType.Item1 != null);
        }
示例#2
0
        private UnaryPipe <TKey, TPayload, TRegister> GetGroupedAFAEventListPipe(IStreamObserver <TKey, TRegister> observer)
        {
            var lookupKey         = CacheKey.Create((object)this.afa);
            var generatedPipeType = cachedPipes.GetOrAdd(lookupKey, key => GroupedAfaEventListTemplate.GenerateAFA(this));

            var instance    = Activator.CreateInstance(generatedPipeType.Item1, this, observer, this.afa, this.MaxDuration);
            var returnValue = (UnaryPipe <TKey, TPayload, TRegister>)instance;

            return(returnValue);
        }