Package org.drools.core.common

Examples of org.drools.core.common.LeftTupleSetsImpl


        private long          nodePosMaskBit;

        public QueryElementNodeMemory(QueryElementNode node) {
            this.node = node;
            // @FIXME I don't think this is thread safe
            this.resultLeftTuples = new LeftTupleSetsImpl();
        }
View Full Code Here


            for (NetworkNode node = sm.getRootNode(); node != sink; node = ((LeftTupleSource)node).getSinkPropagator().getFirstLeftTupleSink() ) {
                //update the bit to the correct node position.
                bit = bit << 1;
            }

            LeftTupleSets trgLeftTuples = new LeftTupleSetsImpl();
            doPropagateChildLeftTuples(null, tm, sink, wm,
                                       null, trgLeftTuples, sm.getStagedLeftTuples());

            RuleNetworkEvaluator rne = new RuleNetworkEvaluator();
            LinkedList<StackEntry> outerStack = new LinkedList<StackEntry>();
View Full Code Here

            }

            stagedLeftTuples = getTargetStagedLeftTuples(node, wm, smem);
            LeftTupleSinkNode sink = ((LeftTupleSource) node).getSinkPropagator().getFirstLeftTupleSink();

            trgTuples = new LeftTupleSetsImpl();


            if (NodeTypeEnums.isBetaNode(node)) {
                boolean exitInnerEval = evalBetaNode(liaNode, pmem, node, nodeMem, smems, smemIndex, trgTuples, wm, stack, outerStack, visitedRules, processRian, executor, srcTuples, stagedLeftTuples, sink);
                if ( exitInnerEval ) {
View Full Code Here

        this.rootNode = rootNode;
        this.linkedNodeMask = new AtomicBitwiseLong();
        this.dirtyNodeMask = new AtomicBitwiseLong();
        this.pathMemories = new ArrayList<PathMemory>(1);
        this.nodeMemories = new LinkedList<Memory>();
        this.stagedLeftTuples = new LeftTupleSetsImpl();
        this.queue = queue;
    }
View Full Code Here

            for (NetworkNode node = sm.getRootNode(); node != sink; node = ((LeftTupleSource)node).getSinkPropagator().getFirstLeftTupleSink() ) {
                //update the bit to the correct node position.
                bit = bit << 1;
            }

            LeftTupleSets trgLeftTuples = new LeftTupleSetsImpl();
            doPropagateChildLeftTuples(null, tm, sink, wm,
                                       null, trgLeftTuples, sm.getStagedLeftTuples());

            RuleNetworkEvaluator rne = new RuleNetworkEvaluator();
            LinkedList<StackEntry> outerStack = new LinkedList<StackEntry>();
View Full Code Here

            for (NetworkNode node = sm.getRootNode(); node != sink; node = ((LeftTupleSource)node).getSinkPropagator().getFirstLeftTupleSink() ) {
                //update the bit to the correct node position.
                bit = bit << 1;
            }

            LeftTupleSets trgLeftTuples = new LeftTupleSetsImpl();
            doPropagateChildLeftTuples(null, tm, sink, wm,
                                       null, trgLeftTuples, sm.getStagedLeftTuples());

            RuleNetworkEvaluator rne = new RuleNetworkEvaluator();
            LinkedList<StackEntry> outerStack = new LinkedList<StackEntry>();
View Full Code Here

        } else {
            sink = (LeftTupleSink) sm.getRootNode();
            mem = sm.getNodeMemories().get(0);
        }

        LeftTupleSets leftTupleSets = new LeftTupleSetsImpl();
        if (leftTuple != null) {
            leftTupleSets.addInsert(leftTuple);
        }

        new RuleNetworkEvaluator().outerEval( ( LeftInputAdapterNode ) smems[0].getRootNode(),
                                              pmem, sink, bit, mem, smems, smemIndex, leftTupleSets, wm,
                                              new LinkedList<StackEntry>(), new LinkedList<StackEntry>(), new HashSet<String>(),
View Full Code Here

        this.rootNode = rootNode;
        this.linkedNodeMask = new AtomicBitwiseLong();
        this.dirtyNodeMask = new AtomicBitwiseLong();
        this.pathMemories = new ArrayList<PathMemory>(1);
        this.nodeMemories = new LinkedList<Memory>();
        this.stagedLeftTuples = new LeftTupleSetsImpl();
        this.queue = queue;
    }
View Full Code Here

        private long          nodePosMaskBit;

        public QueryElementNodeMemory(QueryElementNode node) {
            this.node = node;
            // @FIXME I don't think this is thread safe
            this.resultLeftTuples = new LeftTupleSetsImpl();
        }
View Full Code Here

        // order of left and right operations is to minimise wasted of innefficient joins.

        // We need to collect which leftTuple where updated, so that we can
        // add their result tuple to the real target tuples later
        LeftTupleSets tempLeftTuples = new LeftTupleSetsImpl();

        if (srcLeftTuples.getDeleteFirst() != null) {
            // use the real target here, as dealing direct with left tuples
            doLeftDeletes(accNode, am, wm, srcLeftTuples, trgLeftTuples);
        }

        if (srcRightTuples.getDeleteFirst() != null) {
            doRightDeletes(accNode, am, wm, srcRightTuples, tempLeftTuples);
        }

        if (srcLeftTuples.getUpdateFirst() != null ) {
            RuleNetworkEvaluator.doUpdatesReorderLeftMemory(am.getBetaMemory(),
                                                            srcLeftTuples);
        }

        if (srcRightTuples.getUpdateFirst() != null) {
            RuleNetworkEvaluator.doUpdatesReorderRightMemory(am.getBetaMemory(),
                                                             srcRightTuples);
        }

        if (srcRightTuples.getUpdateFirst() != null) {
            doRightUpdates(accNode, sink, am, wm, srcRightTuples, tempLeftTuples);
        }

        if (srcLeftTuples.getUpdateFirst() != null) {
            doLeftUpdates(accNode, sink, am, wm, srcLeftTuples, tempLeftTuples);
        }

        if (srcRightTuples.getInsertFirst() != null) {
            doRightInserts(accNode, sink, am, wm, srcRightTuples, tempLeftTuples);
        }

        if (srcLeftTuples.getInsertFirst() != null) {
            doLeftInserts(accNode, sink, am, wm, srcLeftTuples, tempLeftTuples);
        }

        Accumulate accumulate = accNode.getAccumulate();
        // we do not need collect retracts. RightTuple retracts end up as updates for lefttuples.
        // LeftTuple retracts are already on the trgLeftTuples
        for (LeftTuple leftTuple = tempLeftTuples.getInsertFirst(); leftTuple != null; ) {
            LeftTuple next = leftTuple.getStagedNext();
            evaluateResultConstraints(accNode, sink, accumulate, leftTuple, leftTuple.getPropagationContext(),
                                      wm, am, (AccumulateContext) leftTuple.getObject(), useLeftMemory,
                                      trgLeftTuples, stagedLeftTuples);
            leftTuple.clearStaged();
            leftTuple = next;
        }

        for (LeftTuple leftTuple = tempLeftTuples.getUpdateFirst(); leftTuple != null; ) {
            LeftTuple next = leftTuple.getStagedNext();
            evaluateResultConstraints(accNode, sink, accumulate, leftTuple, leftTuple.getPropagationContext(),
                                      wm, am, (AccumulateContext) leftTuple.getObject(), useLeftMemory,
                                      trgLeftTuples, stagedLeftTuples);
            leftTuple.clearStaged();
View Full Code Here

TOP

Related Classes of org.drools.core.common.LeftTupleSetsImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.