KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > impl > sql > compile > Level2OptimizerFactoryImpl


1 /*
2
3    Derby - Class org.apache.derby.impl.sql.compile.Level2OptimizerFactoryImpl
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.impl.sql.compile;
23
24 import org.apache.derby.iapi.sql.compile.CostEstimate;
25 import org.apache.derby.iapi.sql.compile.JoinStrategy;
26 import org.apache.derby.iapi.sql.compile.OptimizableList;
27 import org.apache.derby.iapi.sql.compile.OptimizablePredicateList;
28 import org.apache.derby.iapi.sql.compile.Optimizer;
29 import org.apache.derby.iapi.sql.compile.OptimizerFactory;
30 import org.apache.derby.iapi.sql.compile.RequiredRowOrdering;
31
32 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
33
34 import org.apache.derby.iapi.store.access.TransactionController;
35
36 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
37
38 import org.apache.derby.iapi.services.monitor.ModuleControl;
39 import org.apache.derby.iapi.services.context.ContextManager;
40 import org.apache.derby.iapi.services.property.PropertyUtil;
41
42 import org.apache.derby.iapi.services.sanity.SanityManager;
43
44 import org.apache.derby.iapi.error.StandardException;
45
46 import org.apache.derby.iapi.reference.Property;
47
48 import org.apache.derby.impl.sql.compile.OptimizerFactoryImpl;
49
50 import java.util.Properties JavaDoc;
51
52 /**
53     This is simply the factory for creating an optimizer.
54  */

55
56 public class Level2OptimizerFactoryImpl
57     extends OptimizerFactoryImpl
58 {
59
60     //
61
// ModuleControl interface
62
//
63

64     public void boot(boolean create, Properties JavaDoc startParams)
65             throws StandardException
66     {
67         super.boot(create, startParams);
68     }
69
70     //
71
// OptimizerFactory interface
72
//
73

74     /**
75      * @see OptimizerFactory#supportsOptimizerTrace
76      */

77     public boolean supportsOptimizerTrace()
78     {
79         return true;
80     }
81
82     //
83
// class interface
84
//
85
public Level2OptimizerFactoryImpl()
86     {
87     }
88
89     protected Optimizer getOptimizerImpl(
90                                   OptimizableList optimizableList,
91                                   OptimizablePredicateList predList,
92                                   DataDictionary dDictionary,
93                                   RequiredRowOrdering requiredRowOrdering,
94                                   int numTablesInQuery,
95                                   LanguageConnectionContext lcc)
96                 throws StandardException
97     {
98
99         return new Level2OptimizerImpl(
100                             optimizableList,
101                             predList,
102                             dDictionary,
103                             ruleBasedOptimization,
104                             noTimeout,
105                             useStatistics,
106                             maxMemoryPerTable,
107                             joinStrategySet,
108                             lcc.getLockEscalationThreshold(),
109                             requiredRowOrdering,
110                             numTablesInQuery,
111                             lcc);
112     }
113
114     /**
115      * @see OptimizerFactory#getCostEstimate
116      *
117      * @exception StandardException Thrown on error
118      */

119     public CostEstimate getCostEstimate()
120         throws StandardException
121     {
122         return new Level2CostEstimateImpl();
123     }
124 }
125
126
Popular Tags