mariofusco commented on code in PR #6584: URL: https://github.com/apache/incubator-kie-drools/pull/6584#discussion_r2964829144
########## drools-core/src/main/java/org/drools/core/reteoo/BiLinearJoinNode.java: ########## @@ -0,0 +1,170 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.drools.core.reteoo; + +import org.drools.base.reteoo.NodeTypeEnums; +import org.drools.core.common.BetaConstraints; +import org.drools.core.common.BiLinearBetaConstraints; +import org.drools.core.reteoo.builder.BiLinearLeftInputWrapper; +import org.drools.core.reteoo.builder.BuildContext; +import org.drools.core.util.FastIterator; +import org.kie.api.definition.rule.Rule; + +public class BiLinearJoinNode extends JoinNode { + + private static final long serialVersionUID = 510l; + + public BiLinearJoinNode() { + } + + public BiLinearJoinNode(final int id, + final LeftTupleSource leftInput, + final BetaConstraints constraints, + final BuildContext context) { + super(id, leftInput, new BiLinearLeftInputWrapper(), createBiLinearConstraints(constraints), context); + } + + /** + * Override setPartitionId to handle LeftTupleSource as second input instead of ObjectSource. + * BiLinear has LeftTupleSource as second input, not ObjectSource, so we need special handling. + */ + @Override + public void setPartitionId(BuildContext context, org.drools.base.common.RuleBasePartitionId partitionId) { + LeftTupleSource secondInput = getSecondLeftInput(); + if (secondInput != null) { Review Comment: Is there really is a situation when this `secondInput` is `null`? I believe this should never happens and if it does it is a bug that we should catch otherwise, am I missing something? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
