[jboss-svn-commits] JBL Code SVN: r36027 - labs/jbossrules/branches/lr_unlinking_20101116/drools-api/src/main/java/org/drools/builder/conf.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Nov 22 23:39:44 EST 2010


Author: leo_gomes
Date: 2010-11-22 23:39:43 -0500 (Mon, 22 Nov 2010)
New Revision: 36027

Added:
   labs/jbossrules/branches/lr_unlinking_20101116/drools-api/src/main/java/org/drools/builder/conf/LRUnlinkingOption.java
Log:
JBRULES-2776: Left & Right Unlinking config option.

Added: labs/jbossrules/branches/lr_unlinking_20101116/drools-api/src/main/java/org/drools/builder/conf/LRUnlinkingOption.java
===================================================================
--- labs/jbossrules/branches/lr_unlinking_20101116/drools-api/src/main/java/org/drools/builder/conf/LRUnlinkingOption.java	                        (rev 0)
+++ labs/jbossrules/branches/lr_unlinking_20101116/drools-api/src/main/java/org/drools/builder/conf/LRUnlinkingOption.java	2010-11-23 04:39:43 UTC (rev 36027)
@@ -0,0 +1,82 @@
+/**
+ * Copyright 2010 JBoss Inc
+ *
+ * Licensed 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.builder.conf;
+
+import org.drools.conf.SequentialOption;
+import org.drools.conf.SingleValueKnowledgeBaseOption;
+
+/**
+ * <p>
+ * An Enum for Left & Right Unlinking option.
+ * </p>
+ * 
+ * <pre>
+ * drools.lrUnlinkingEnabled = &lt;true|false&gt;
+ * </pre>
+ * 
+ * <b>DEFAULT = false.</b>
+ * 
+ * <p>
+ * Left & Right unlinking is a RETE optimization that leads to improvements in
+ * performance and memory consumption, mainly for large rule bases. It is still
+ * an experimental feature in Drools and not active by default. For further
+ * details, have look at <a href=
+ * "http://blog.athico.com/2010/08/left-and-right-unlinking-community.html">this
+ * blog entry</a>.
+ * </p>
+ * 
+ * <p>
+ * <b>Note:</b> It won't work when:
+ * <ul>
+ * 
+ * <li>
+ * {@link SequentialOption} is used, because in sequential mode we disable node
+ * memory, which is mandatory for L&R Unlinking to work;</li>
+ * 
+ * <li>Multiple entry points are used.</li>
+ * </ul>
+ * </p>
+ * 
+ * @author lgomes
+ * 
+ */
+public enum LRUnlinkingOption implements SingleValueKnowledgeBaseOption {
+
+    ENABLED(true), DISABLED(false);
+
+    /**
+     * The property name for the L&R Unlinking option
+     */
+    public static final String PROPERTY_NAME = "drools.lrUnlinkingEnabled";
+
+    private boolean value;
+
+    LRUnlinkingOption(final boolean value) {
+        this.value = value;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getPropertyName() {
+        return PROPERTY_NAME;
+    }
+
+    public boolean isLRUnlinkingEnabled() {
+        return this.value;
+    }
+
+}



More information about the jboss-svn-commits mailing list