public CodegenExpression MakeProvider( CodegenMethodScope parent, SAIFFInitializeSymbol symbols, CodegenClassScope classScope) { CodegenMethod method = parent.MakeChild(typeof(AggregationServiceFactoryTable), this.GetType(), classScope); method.Block .DeclareVar<AggregationServiceFactoryTable>( "factory", NewInstance(typeof(AggregationServiceFactoryTable))) .SetProperty( Ref("factory"), "Table", TableDeployTimeResolver.MakeResolveTable(metadata, symbols.GetAddInitSvc(method))) .SetProperty( Ref("factory"), "MethodPairs", TableColumnMethodPairForge.MakeArray(methodPairs, method, symbols, classScope)) .SetProperty(Ref("factory"), "AccessColumnsZeroOffset", Constant(accessColumnsZeroOffset)) .SetProperty( Ref("factory"), "AccessAgents", AggregationAgentUtil.MakeArray(accessAgents, method, symbols, classScope)) .SetProperty( Ref("factory"), "GroupByRollupDesc", groupByRollupDesc == null ? ConstantNull() : groupByRollupDesc.Codegen()) .MethodReturn(Ref("factory")); return LocalMethod(method); }
public void ProviderCodegen( CodegenMethod method, CodegenClassScope classScope, AggregationClassNames classNames) { Type[] groupByTypes = ExprNodeUtilityQuery.GetExprResultTypes(groupByNodes); method.Block .DeclareVar<AggregationServiceFactory>( "svcFactory", NewInstance(classNames.ServiceFactory, Ref("this"))) .DeclareVar<AggregationRowFactory>( "rowFactory", NewInstance(classNames.RowFactoryTop, Ref("this"))) .DeclareVar<DataInputOutputSerdeWCollation<AggregationRow>>( "rowSerde", NewInstance(classNames.RowSerdeTop, Ref("this"))) .MethodReturn( ExprDotMethodChain(EPStatementInitServicesConstants.REF) .Get(EPStatementInitServicesConstants.AGGREGATIONSERVICEFACTORYSERVICE) .Add( "GroupByRollup", Ref("svcFactory"), rollupDesc.Codegen(), Ref("rowFactory"), rowStateForgeDesc.UseFlags.ToExpression(), Ref("rowSerde"), Constant(groupByTypes))); }