pibizza commented on code in PR #6510: URL: https://github.com/apache/incubator-kie-drools/pull/6510#discussion_r2502904411
########## drools-core/src/main/java/org/drools/core/phreak/SegmentCursor.java: ########## @@ -0,0 +1,475 @@ +/* + * 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.phreak; + +import org.drools.base.common.NetworkNode; +import org.drools.base.reteoo.NodeTypeEnums; +import org.drools.core.common.Memory; +import org.drools.core.common.TupleSets; +import org.drools.core.reteoo.BetaMemory; +import org.drools.core.reteoo.BetaNode; +import org.drools.core.reteoo.LeftTupleNode; +import org.drools.core.reteoo.LeftTupleSink; +import org.drools.core.reteoo.LeftTupleSinkNode; +import org.drools.core.reteoo.PathMemory; +import org.drools.core.reteoo.SegmentMemory; +import org.drools.core.reteoo.SegmentNodeMemory; +import org.drools.core.reteoo.TerminalNode; +import org.drools.core.reteoo.TupleToObjectNode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import static org.drools.core.phreak.BuildtimeSegmentUtilities.nextNodePosMask; + +public class SegmentCursor { + private static final Logger log = LoggerFactory.getLogger(SegmentCursor.class); + + private PathMemory pmem; + private SegmentMemory[] smems; + private int smemIndex; + private long bit; + private Memory nodeMem; + private NetworkNode node; + private TupleSets srcTuples; + private TupleSets stagedLeftTuples; + + public SegmentCursor(PathMemory pmem, + SegmentMemory[] smems, + int smemIndex, + long bit, + Memory nodeMem, + NetworkNode node, + TupleSets srcTuples) { + this.pmem = pmem; + this.smems = smems; + this.smemIndex = smemIndex; + this.bit = bit; + this.nodeMem = nodeMem; + this.node = node; + this.srcTuples = srcTuples; + } + + public PathMemory getPathMemory() { Review Comment: See comment above. I plan to extend the use of the SegmentCursor to other prheak nodes, so probably it's better to keep the getters. Eventually we can decide to throw them away - I really hope we can encapsulate most of their usage anyway. -- 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]
