Ejemplo n.º 1
0
        public static Type GetStreamMessageType <TKey, TPayload>()
        {
            if (Config.ForceRowBasedExecution)
            {
                return(typeof(StreamMessage <TKey, TPayload>));
            }
            if (!typeof(TPayload).CanRepresentAsColumnar())
            {
                return(typeof(StreamMessage <TKey, TPayload>));
            }

            var typeOfTKey     = typeof(TKey);
            var typeOfTPayload = typeof(TPayload);

            var lookupKey = CacheKey.Create(typeOfTKey, typeOfTPayload);

            return(cachedObjects.GetOrAdd(lookupKey, key => Transformer.GenerateBatchClass <TKey, TPayload>()));
        }