|
| 1 | +/* |
| 2 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | + * you may not use this file except in compliance with the License. |
| 4 | + * You may obtain a copy of the License at |
| 5 | + * |
| 6 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | + * |
| 8 | + * Unless required by applicable law or agreed to in writing, software |
| 9 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | + * See the License for the specific language governing permissions and |
| 12 | + * limitations under the License. |
| 13 | + */ |
| 14 | +package com.facebook.presto.spi.sql.planner; |
| 15 | + |
| 16 | +import com.facebook.presto.spi.NodeManager; |
| 17 | +import com.facebook.presto.spi.function.FunctionMetadataManager; |
| 18 | +import com.facebook.presto.spi.function.StandardFunctionResolution; |
| 19 | + |
| 20 | +import static java.util.Objects.requireNonNull; |
| 21 | + |
| 22 | +public class ExpressionOptimizerContext |
| 23 | +{ |
| 24 | + private final NodeManager nodeManager; |
| 25 | + private final FunctionMetadataManager functionMetadataManager; |
| 26 | + private final StandardFunctionResolution functionResolution; |
| 27 | + |
| 28 | + public ExpressionOptimizerContext(NodeManager nodeManager, FunctionMetadataManager functionMetadataManager, StandardFunctionResolution functionResolution) |
| 29 | + { |
| 30 | + this.nodeManager = requireNonNull(nodeManager, "nodeManager is null"); |
| 31 | + this.functionMetadataManager = requireNonNull(functionMetadataManager, "functionMetadataManager is null"); |
| 32 | + this.functionResolution = requireNonNull(functionResolution, "functionResolution is null"); |
| 33 | + } |
| 34 | + |
| 35 | + public NodeManager getNodeManager() |
| 36 | + { |
| 37 | + return nodeManager; |
| 38 | + } |
| 39 | + |
| 40 | + public FunctionMetadataManager getFunctionMetadataManager() |
| 41 | + { |
| 42 | + return functionMetadataManager; |
| 43 | + } |
| 44 | + |
| 45 | + public StandardFunctionResolution getFunctionResolution() |
| 46 | + { |
| 47 | + return functionResolution; |
| 48 | + } |
| 49 | +} |
0 commit comments