OmniSciDB  4201147b46
 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 isViewOptimizeEnabled;
32  private boolean isWatchdogEnabled;
33 
34  public HeavyDBParserOptions(List<FilterPushDownInfo> inFilterPushDownInfo,
35  boolean inLegacySyntax,
36  boolean inIsExplain,
37  boolean inIsViewOptimzeEnabled,
38  boolean inWatchdogEnabled) {
39  filterPushDownInfo = inFilterPushDownInfo;
40  legacySyntax = inLegacySyntax;
41  isExplain = inIsExplain;
42  isViewOptimizeEnabled = inIsViewOptimzeEnabled;
43  isWatchdogEnabled = inWatchdogEnabled;
44  }
45 
47  filterPushDownInfo = new ArrayList<>();
48  legacySyntax = true;
49  isExplain = false;
50  isViewOptimizeEnabled = false;
51  isWatchdogEnabled = false;
52  }
53 
57  public List<FilterPushDownInfo> getFilterPushDownInfo() {
58  return filterPushDownInfo;
59  }
60 
64  public void setFilterPushDownInfo(List<FilterPushDownInfo> filterPushDownInfo) {
65  this.filterPushDownInfo = filterPushDownInfo;
66  }
67 
71  public boolean isLegacySyntax() {
72  return legacySyntax;
73  }
74 
78  public void setLegacySyntax(boolean legacySyntax) {
79  this.legacySyntax = legacySyntax;
80  }
81 
85  public boolean isExplain() {
86  return isExplain;
87  }
88 
92  public void setExplain(boolean isExplain) {
93  this.isExplain = isExplain;
94  }
95 
96  public static class FilterPushDownInfo {
98  final int input_prev, final int input_start, final int input_next) {
99  this.input_prev = input_prev;
100  this.input_start = input_start;
101  this.input_next = input_next;
102  }
103 
104  public int input_prev;
105  public int input_start;
106  public int input_next;
107  }
108 
112  public boolean isViewOptimizeEnabled() {
113  return isViewOptimizeEnabled;
114  }
115 
120  this.isViewOptimizeEnabled = isViewOptimizeEnabled;
121  }
122 
123  public boolean isWatchdogEnabled() {
124  return isWatchdogEnabled;
125  }
126 
127  public void setWatchdogEnabled(boolean isWatchdogEnabled) {
128  this.isWatchdogEnabled = isWatchdogEnabled;
129  }
130 }
FilterPushDownInfo(final int input_prev, final int input_start, final int input_next)
HeavyDBParserOptions(List< FilterPushDownInfo > inFilterPushDownInfo, boolean inLegacySyntax, boolean inIsExplain, boolean inIsViewOptimzeEnabled, boolean inWatchdogEnabled)
void setWatchdogEnabled(boolean isWatchdogEnabled)
void setFilterPushDownInfo(List< FilterPushDownInfo > filterPushDownInfo)
void setViewOptimizeEnabled(boolean isViewOptimizeEnabled)