Exemplo n.º 1
0
        public SelectEvalInsertWildcardVariant(
            SelectExprForgeContext selectExprForgeContext,
            EventType resultEventType,
            VariantEventType variantEventType)
            : base(selectExprForgeContext, resultEventType)

        {
            this.variantEventType = variantEventType;
        }
Exemplo n.º 2
0
        public SelectEvalInsertNoWildcardSingleColCoercionBeanWrapVariant(
            SelectExprForgeContext selectExprForgeContext,
            EventType resultEventType,
            VariantEventType variantEventType)
            : base(selectExprForgeContext, resultEventType)

        {
            this.variantEventType = variantEventType;
        }
Exemplo n.º 3
0
        private EventType HandleVariantType(
            CreateSchemaDesc spec,
            StatementCompileTimeServices services)
        {
            if (spec.CopyFrom != null && !spec.CopyFrom.IsEmpty()) {
                throw new ExprValidationException("Copy-from types are not allowed with variant types");
            }

            var eventTypeName = spec.SchemaName;

            // determine typing
            var isAny = false;
            ISet<EventType> types = new LinkedHashSet<EventType>();
            foreach (var typeName in spec.Types) {
                if (typeName.Trim().Equals("*")) {
                    isAny = true;
                }
                else {
                    var eventType = services.EventTypeCompileTimeResolver.GetTypeByName(typeName);
                    if (eventType == null) {
                        throw new ExprValidationException(
                            "Event type by name '" +
                            typeName +
                            "' could not be found for use in variant stream by name '" +
                            eventTypeName +
                            "'");
                    }

                    types.Add(eventType);
                }
            }

            var eventTypes = types.ToArray();
            var variantSpec = new VariantSpec(eventTypes, isAny ? TypeVariance.ANY : TypeVariance.PREDEFINED);

            var visibility =
                services.ModuleVisibilityRules.GetAccessModifierEventType(@base.StatementRawInfo, spec.SchemaName);
            var eventBusVisibility =
                services.ModuleVisibilityRules.GetBusModifierEventType(@base.StatementRawInfo, eventTypeName);
            EventTypeUtility.ValidateModifiers(spec.SchemaName, eventBusVisibility, visibility);

            var metadata = new EventTypeMetadata(
                eventTypeName,
                @base.ModuleName,
                EventTypeTypeClass.VARIANT,
                EventTypeApplicationType.VARIANT,
                visibility,
                eventBusVisibility,
                false,
                EventTypeIdPair.Unassigned());
            var variantEventType = new VariantEventType(metadata, variantSpec);
            services.EventTypeCompileTimeRegistry.NewType(variantEventType);
            return variantEventType;
        }
        public SelectEvalInsertWildcardJoinVariant(
            SelectExprForgeContext context,
            EventType resultEventType,
            SelectExprProcessorForge joinWildcardProcessorForge,
            VariantEventType variantEventType)
            : base(context, resultEventType)

        {
            this.joinWildcardProcessorForge = joinWildcardProcessorForge;
            this.variantEventType = variantEventType;
        }
Exemplo n.º 5
0
        /// <summary>
        /// NOTE: Code-generation-invoked method, method name and parameter order matters
        /// </summary>
        /// <param name="eventsPerStream">events</param>
        /// <param name="numEvaluators">num evals</param>
        /// <param name="props">props</param>
        /// <param name="variantEventType">variant</param>
        /// <returns>bean</returns>
        public static EventBean SelectExprInsertWildcardSSWrapRevision(
            EventBean[] eventsPerStream,
            int numEvaluators,
            IDictionary<string, object> props,
            VariantEventType variantEventType)
        {
            DecoratingEventBean wrapper = (DecoratingEventBean) eventsPerStream[0];
            if (wrapper != null) {
                IDictionary<string, object> map = wrapper.DecoratingProperties;
                if ((numEvaluators == 0) && (!map.IsEmpty())) {
                    // no action
                }
                else {
                    props.PutAll(map);
                }
            }

            EventBean theEvent = eventsPerStream[0];
            return variantEventType.GetValueAddEventBean(theEvent);
        }