use of org.drools.core.reteoo.ObjectSinkPropagator in project drools by kiegroup.
the class KnowledgeBaseImpl method disableMultithreadEvaluation.
private void disableMultithreadEvaluation(String warningMessage) {
config.enforceSingleThreadEvaluation();
logger.warn(warningMessage);
for (EntryPointNode entryPointNode : rete.getEntryPointNodes().values()) {
entryPointNode.setPartitionsEnabled(false);
for (ObjectTypeNode otn : entryPointNode.getObjectTypeNodes().values()) {
ObjectSinkPropagator sink = otn.getObjectSinkPropagator();
if (sink instanceof CompositePartitionAwareObjectSinkAdapter) {
otn.setObjectSinkPropagator(((CompositePartitionAwareObjectSinkAdapter) sink).asNonPartitionedSinkPropagator(config.getAlphaNodeHashingThreshold()));
}
}
}
}
use of org.drools.core.reteoo.ObjectSinkPropagator in project drools by kiegroup.
the class NodesPartitioningTest method checkPartitionedSinks.
private void checkPartitionedSinks(ObjectTypeNode otn) {
if (InitialFact.class.isAssignableFrom(((ClassObjectType) otn.getObjectType()).getClassType())) {
return;
}
ObjectSinkPropagator sinkPropagator = otn.getObjectSinkPropagator();
ObjectSinkPropagator[] propagators = sinkPropagator instanceof CompositePartitionAwareObjectSinkAdapter ? ((CompositePartitionAwareObjectSinkAdapter) sinkPropagator).getPartitionedPropagators() : new ObjectSinkPropagator[] { sinkPropagator };
for (int i = 0; i < propagators.length; i++) {
for (ObjectSink sink : propagators[i].getSinks()) {
assertEquals(sink + " on " + sink.getPartitionId() + " is expcted to be on propagator " + i, i, sink.getPartitionId().getId() % propagators.length);
}
}
}
Aggregations