OmniSciDB  c1a53651b2
 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  private boolean distributedMode;
34 
35  public HeavyDBParserOptions(List<FilterPushDownInfo> inFilterPushDownInfo,
36  boolean inLegacySyntax,
37  boolean inIsExplain,
38  boolean inIsViewOptimzeEnabled,
39  boolean inWatchdogEnabled,
40  boolean inDistributedMode) {
41  filterPushDownInfo = inFilterPushDownInfo;
42  legacySyntax = inLegacySyntax;
43  isExplain = inIsExplain;
44  isViewOptimizeEnabled = inIsViewOptimzeEnabled;
45  isWatchdogEnabled = inWatchdogEnabled;
46  distributedMode = inDistributedMode;
47  }
48 
50  filterPushDownInfo = new ArrayList<>();
51  legacySyntax = true;
52  isExplain = false;
53  isViewOptimizeEnabled = false;
54  isWatchdogEnabled = false;
55  distributedMode = false;
56  }
57 
61  public List<FilterPushDownInfo> getFilterPushDownInfo() {
62  return filterPushDownInfo;
63  }
64 
68  public void setFilterPushDownInfo(List<FilterPushDownInfo> filterPushDownInfo) {
69  this.filterPushDownInfo = filterPushDownInfo;
70  }
71 
75  public boolean isLegacySyntax() {
76  return legacySyntax;
77  }
78 
82  public void setLegacySyntax(boolean legacySyntax) {
83  this.legacySyntax = legacySyntax;
84  }
85 
89  public boolean isExplain() {
90  return isExplain;
91  }
92 
96  public void setExplain(boolean isExplain) {
97  this.isExplain = isExplain;
98  }
99 
100  public static class FilterPushDownInfo {
102  final int input_prev, final int input_start, final int input_next) {
103  this.input_prev = input_prev;
104  this.input_start = input_start;
105  this.input_next = input_next;
106  }
107 
108  public int input_prev;
109  public int input_start;
110  public int input_next;
111  }
112 
116  public boolean isViewOptimizeEnabled() {
117  return isViewOptimizeEnabled;
118  }
119 
124  this.isViewOptimizeEnabled = isViewOptimizeEnabled;
125  }
126 
127  public boolean isWatchdogEnabled() {
128  return isWatchdogEnabled;
129  }
130 
131  public void setWatchdogEnabled(boolean isWatchdogEnabled) {
132  this.isWatchdogEnabled = isWatchdogEnabled;
133  }
134 
135  public boolean isDistributedMode() {
136  return distributedMode;
137  }
138 
139  public void setDistributedMode(boolean distributedMode) {
140  this.distributedMode = distributedMode;
141  }
142 }
FilterPushDownInfo(final int input_prev, final int input_start, final int input_next)
void setWatchdogEnabled(boolean isWatchdogEnabled)
HeavyDBParserOptions(List< FilterPushDownInfo > inFilterPushDownInfo, boolean inLegacySyntax, boolean inIsExplain, boolean inIsViewOptimzeEnabled, boolean inWatchdogEnabled, boolean inDistributedMode)
void setFilterPushDownInfo(List< FilterPushDownInfo > filterPushDownInfo)
void setViewOptimizeEnabled(boolean isViewOptimizeEnabled)