OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HeavyDBParserOptions.java
Go to the documentation of this file.
1 /*
2  * Copyright 2022 HEAVY.AI, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.mapd.calcite.parser;
18 
19 import org.slf4j.Logger;
20 import org.slf4j.LoggerFactory;
21 
22 import java.util.ArrayList;
23 import java.util.List;
24 
25 public final class HeavyDBParserOptions {
26  final static Logger HEAVYDBLOGGER = LoggerFactory.getLogger(HeavyDBParserOptions.class);
27 
28  private List<FilterPushDownInfo> filterPushDownInfo;
29  private boolean legacySyntax;
30  private boolean isExplain;
31  private boolean isExplainDetail;
32  private boolean isViewOptimizeEnabled;
33  private boolean isWatchdogEnabled;
34  private boolean distributedMode;
35 
36  public HeavyDBParserOptions(List<FilterPushDownInfo> inFilterPushDownInfo,
37  boolean inLegacySyntax,
38  boolean inIsExplain,
39  boolean inIsExplainDetail,
40  boolean inIsViewOptimzeEnabled,
41  boolean inWatchdogEnabled,
42  boolean inDistributedMode) {
43  filterPushDownInfo = inFilterPushDownInfo;
44  legacySyntax = inLegacySyntax;
45  isExplain = inIsExplain;
46  isExplainDetail = inIsExplainDetail;
47  isViewOptimizeEnabled = inIsViewOptimzeEnabled;
48  isWatchdogEnabled = inWatchdogEnabled;
49  distributedMode = inDistributedMode;
50  }
51 
53  filterPushDownInfo = new ArrayList<>();
54  legacySyntax = true;
55  isExplain = false;
56  isExplainDetail = false;
57  isViewOptimizeEnabled = false;
58  isWatchdogEnabled = false;
59  distributedMode = false;
60  }
61 
65  public List<FilterPushDownInfo> getFilterPushDownInfo() {
66  return filterPushDownInfo;
67  }
68 
72  public void setFilterPushDownInfo(List<FilterPushDownInfo> filterPushDownInfo) {
73  this.filterPushDownInfo = filterPushDownInfo;
74  }
75 
79  public boolean isLegacySyntax() {
80  return legacySyntax;
81  }
82 
86  public void setLegacySyntax(boolean legacySyntax) {
87  this.legacySyntax = legacySyntax;
88  }
89 
93  public boolean isExplain() {
94  return isExplain;
95  }
96 
97  public boolean isExplainDetail() {
98  return isExplainDetail;
99  }
100 
104  public void setExplain(boolean isExplain) {
105  this.isExplain = isExplain;
106  }
107 
108  public static class FilterPushDownInfo {
110  final int input_prev, final int input_start, final int input_next) {
111  this.input_prev = input_prev;
112  this.input_start = input_start;
113  this.input_next = input_next;
114  }
115 
116  public int input_prev;
117  public int input_start;
118  public int input_next;
119  }
120 
124  public boolean isViewOptimizeEnabled() {
125  return isViewOptimizeEnabled;
126  }
127 
132  this.isViewOptimizeEnabled = isViewOptimizeEnabled;
133  }
134 
135  public boolean isWatchdogEnabled() {
136  return isWatchdogEnabled;
137  }
138 
139  public void setWatchdogEnabled(boolean isWatchdogEnabled) {
140  this.isWatchdogEnabled = isWatchdogEnabled;
141  }
142 
143  public boolean isDistributedMode() {
144  return distributedMode;
145  }
146 
147  public void setDistributedMode(boolean distributedMode) {
148  this.distributedMode = distributedMode;
149  }
150 }
FilterPushDownInfo(final int input_prev, final int input_start, final int input_next)
void setWatchdogEnabled(boolean isWatchdogEnabled)
void setFilterPushDownInfo(List< FilterPushDownInfo > filterPushDownInfo)
HeavyDBParserOptions(List< FilterPushDownInfo > inFilterPushDownInfo, boolean inLegacySyntax, boolean inIsExplain, boolean inIsExplainDetail, boolean inIsViewOptimzeEnabled, boolean inWatchdogEnabled, boolean inDistributedMode)
void setViewOptimizeEnabled(boolean isViewOptimizeEnabled)