1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.ldap.server.db;
18
19
20 import org.apache.ldap.common.filter.ExprNode;
21
22 import javax.naming.NamingException;
23
24
25 /***
26 * An optimizer applies heuristics to determine best execution path to a search
27 * filter based on scan counts within database indices. It annotates the nodes
28 * of an expression subtree by setting a "count" key in the node. Its goal is
29 * to annotate nodes with counts to indicate which nodes to iterate over thereby
30 * minimizing the number cycles in a search. The SearchEngine relies on these
31 * count markers to determine the appropriate path.
32 *
33 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
34 * @version $Rev: 159259 $
35 */
36 public interface Optimizer
37 {
38 /***
39 * Annotates the expression node tree for optimized traversal metrics.
40 *
41 * @param node the root of the expression node tree
42 * @throws NamingException if there are failures while optimizing
43 */
44 void annotate( ExprNode node ) throws NamingException;
45 }