コード例 #1
0
 public void AcceptHelperVisitorCodegen(
     CodegenClassScope classScope,
     CodegenMethod method,
     CodegenInstanceAux instance)
 {
     ResultSetProcessorRowPerGroupImpl.AcceptHelperVisitorCodegen(method, instance);
 }
コード例 #2
0
 public void ApplyJoinResultCodegen(
     CodegenClassScope classScope,
     CodegenMethod method,
     CodegenInstanceAux instance)
 {
     ResultSetProcessorRowPerGroupImpl.ApplyJoinResultCodegen(this, classScope, method, instance);
 }
コード例 #3
0
 public void ContinueOutputLimitedLastAllNonBufferedJoinCodegen(
     CodegenClassScope classScope,
     CodegenMethod method,
     CodegenInstanceAux instance)
 {
     ResultSetProcessorRowPerGroupImpl.ContinueOutputLimitedLastAllNonBufferedJoinCodegen(this, method);
 }
コード例 #4
0
 public void ProcessOutputLimitedJoinCodegen(
     CodegenClassScope classScope,
     CodegenMethod method,
     CodegenInstanceAux instance)
 {
     ResultSetProcessorRowPerGroupImpl.ProcessOutputLimitedJoinCodegen(this, classScope, method, instance);
 }
コード例 #5
0
 public void GetEnumeratorJoinCodegen(
     CodegenClassScope classScope,
     CodegenMethod method,
     CodegenInstanceAux instance)
 {
     ResultSetProcessorRowPerGroupImpl.GetEnumeratorJoinCodegen(this, classScope, method, instance);
 }
コード例 #6
0
 public static void StopMethodCodegenUnbound(
     ResultSetProcessorRowPerGroupForge forge,
     CodegenClassScope classScope,
     CodegenMethod method,
     CodegenInstanceAux instance)
 {
     ResultSetProcessorRowPerGroupImpl.StopMethodCodegenBound(method, instance);
     method.Block.ExprDotMethod(Ref("groupReps"), "Destroy");
 }
コード例 #7
0
 public void StopMethodCodegen(
     CodegenClassScope classScope,
     CodegenMethod method,
     CodegenInstanceAux instance)
 {
     if (unboundedProcessor) {
         ResultSetProcessorRowPerGroupUnbound.StopMethodCodegenUnbound(this, classScope, method, instance);
     }
     else {
         ResultSetProcessorRowPerGroupImpl.StopMethodCodegenBound(method, instance);
     }
 }
コード例 #8
0
 public void ApplyViewResultCodegen(
     CodegenClassScope classScope,
     CodegenMethod method,
     CodegenInstanceAux instance)
 {
     if (unboundedProcessor) {
         ResultSetProcessorRowPerGroupUnbound.ApplyViewResultCodegen(this, classScope, method, instance);
     }
     else {
         ResultSetProcessorRowPerGroupImpl.ApplyViewResultCodegen(this, classScope, method, instance);
     }
 }
コード例 #9
0
 public void GetEnumeratorViewCodegen(
     CodegenClassScope classScope,
     CodegenMethod method,
     CodegenInstanceAux instance)
 {
     if (unboundedProcessor) {
         ResultSetProcessorRowPerGroupUnbound.GetEnumeratorViewUnboundedCodegen(
             this,
             classScope,
             method,
             instance);
     }
     else {
         ResultSetProcessorRowPerGroupImpl.GetEnumeratorViewCodegen(this, classScope, method, instance);
     }
 }
コード例 #10
0
        protected internal static CodegenMethod ProcessViewResultNewDepthOneUnboundCodegen(
            ResultSetProcessorRowPerGroupForge forge,
            CodegenClassScope classScope,
            CodegenInstanceAux instance)
        {
            CodegenMethod shortcutEvalGivenKey =
                ResultSetProcessorRowPerGroupImpl.ShortcutEvalGivenKeyCodegen(
                    forge.OptionalHavingNode,
                    classScope,
                    instance);

            Consumer<CodegenMethod> code = methodNode => {
                methodNode.Block.DeclareVar<object>(
                    "groupKey",
                    LocalMethod(forge.GenerateGroupKeySingle, REF_NEWDATA, ConstantTrue()));
                if (forge.IsSelectRStream) {
                    methodNode.Block.DeclareVar<EventBean>(
                        "rstream",
                        LocalMethod(
                            shortcutEvalGivenKey,
                            REF_NEWDATA,
                            Ref("groupKey"),
                            ConstantFalse(),
                            REF_ISSYNTHESIZE));
                }

                methodNode.Block.ExprDotMethod(
                        MEMBER_AGGREGATIONSVC,
                        "ApplyEnter",
                        REF_NEWDATA,
                        Ref("groupKey"),
                        MEMBER_AGENTINSTANCECONTEXT)
                    .ExprDotMethod(Ref("groupReps"), "Put", Ref("groupKey"), ArrayAtIndex(REF_NEWDATA, Constant(0)))
                    .DeclareVar<EventBean>(
                        "istream",
                        LocalMethod(
                            shortcutEvalGivenKey,
                            REF_NEWDATA,
                            Ref("groupKey"),
                            ConstantTrue(),
                            REF_ISSYNTHESIZE));
                if (forge.IsSelectRStream) {
                    methodNode.Block.MethodReturn(
                        StaticMethod(
                            typeof(ResultSetProcessorUtil),
                            "ToPairNullIfAllNullSingle",
                            Ref("istream"),
                            Ref("rstream")));
                }
                else {
                    methodNode.Block.MethodReturn(
                        StaticMethod(typeof(ResultSetProcessorUtil), "ToPairNullIfNullIStream", Ref("istream")));
                }
            };

            return instance.Methods.AddMethod(
                typeof(UniformPair<EventBean[]>),
                "ProcessViewResultNewDepthOneUnboundCodegen",
                CodegenNamedParam.From(typeof(EventBean[]), NAME_NEWDATA, typeof(bool), NAME_ISSYNTHESIZE),
                typeof(ResultSetProcessorRowPerGroupImpl),
                classScope,
                code);
        }
コード例 #11
0
 public void ClearMethodCodegen(
     CodegenClassScope classScope,
     CodegenMethod method)
 {
     ResultSetProcessorRowPerGroupImpl.ClearMethodCodegen(method);
 }
コード例 #12
0
        public void InstanceCodegen(
            CodegenInstanceAux instance,
            CodegenClassScope classScope,
            CodegenCtor factoryCtor,
            IList<CodegenTypedParam> factoryMembers)
        {
            instance.Properties.AddProperty(
                typeof(SelectExprProcessor),
                "SelectExprProcessor",
                GetType(),
                classScope,
                propertyNode => propertyNode.GetterBlock.BlockReturn(MEMBER_SELECTEXPRPROCESSOR));
            instance.Properties.AddProperty(
                typeof(AggregationService),
                "AggregationService",
                GetType(),
                classScope,
                propertyNode => propertyNode.GetterBlock.BlockReturn(MEMBER_AGGREGATIONSVC));
            instance.Methods.AddMethod(
                typeof(ExprEvaluatorContext),
                "GetAgentInstanceContext",
                EmptyList<CodegenNamedParam>.Instance,
                GetType(),
                classScope,
                node => node.Block.ReturnMethodOrBlock(MEMBER_AGENTINSTANCECONTEXT));
            instance.Properties.AddProperty(
                typeof(bool),
                "HasHavingClause",
                GetType(),
                classScope,
                propertyNode => propertyNode.GetterBlock.BlockReturn(Constant(OptionalHavingNode != null)));
            instance.Properties.AddProperty(
                typeof(bool),
                "IsSelectRStream",
                typeof(ResultSetProcessorRowForAll),
                classScope,
                propertyNode => propertyNode.GetterBlock.BlockReturn(Constant(IsSelectRStream)));
            ResultSetProcessorUtil.EvaluateHavingClauseCodegen(OptionalHavingNode, classScope, instance);
            GenerateGroupKeySingle = ResultSetProcessorGroupedUtil.GenerateGroupKeySingleCodegen(GroupKeyNodeExpressions, multiKeyClassRef, classScope, instance);
            GenerateGroupKeyArrayView = ResultSetProcessorGroupedUtil.GenerateGroupKeyArrayViewCodegen(GenerateGroupKeySingle, classScope, instance);
            GenerateGroupKeyArrayJoin = ResultSetProcessorGroupedUtil.GenerateGroupKeyArrayJoinCodegen(GenerateGroupKeySingle, classScope, instance);

            ResultSetProcessorRowPerGroupImpl.GenerateOutputBatchedNoSortWMapCodegen(this, classScope, instance);
            ResultSetProcessorRowPerGroupImpl.GenerateOutputBatchedArrFromEnumeratorCodegen(this, classScope, instance);
            ResultSetProcessorRowPerGroupImpl.RemovedAggregationGroupKeyCodegen(classScope, instance);

            if (unboundedProcessor) {
                var factory = classScope.AddOrGetDefaultFieldSharable(ResultSetProcessorHelperFactoryField.INSTANCE);
                instance.AddMember(NAME_GROUPREPS, typeof(ResultSetProcessorRowPerGroupUnboundHelper));
                CodegenExpression groupKeySerde = MultiKeyClassRef.GetExprMKSerde(classScope.NamespaceScope.InitMethod, classScope);

                var eventType = classScope.AddDefaultFieldUnshared(
                    true,
                    typeof(EventType),
                    EventTypeUtility.ResolveTypeCodegen(typesPerStream[0], EPStatementInitServicesConstants.REF));

                instance.ServiceCtor.Block
                    .AssignRef(
                        NAME_GROUPREPS,
                        ExprDotMethod(
                            factory,
                            "MakeRSRowPerGroupUnboundGroupRep",
                            Constant(groupKeyTypes),
                            groupKeySerde,
                            eventType,
                            MEMBER_AGENTINSTANCECONTEXT))
                    .ExprDotMethod(MEMBER_AGGREGATIONSVC, "SetRemovedCallback", Member(NAME_GROUPREPS));
            }
            else {
                instance.ServiceCtor.Block
                    .ExprDotMethod(MEMBER_AGGREGATIONSVC, "SetRemovedCallback", Ref("this"));
            }
        }