From 8b553ea0cd893e84f5370b1d908d993a9498fd85 Mon Sep 17 00:00:00 2001 From: Ivan Bella <347158+ivakegg@users.noreply.github.com> Date: Tue, 5 Aug 2025 18:00:41 +0000 Subject: [PATCH 1/3] Updated Visitor function to avoid modifying config as it needs to remain thread safe --- .../PushdownLargeFieldedListsVisitor.java | 23 ++++-- .../tables/async/event/VisitorFunction.java | 75 ++++++++----------- 2 files changed, 48 insertions(+), 50 deletions(-) diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PushdownLargeFieldedListsVisitor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PushdownLargeFieldedListsVisitor.java index 3e113e0958d..1b381891077 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PushdownLargeFieldedListsVisitor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PushdownLargeFieldedListsVisitor.java @@ -132,6 +132,17 @@ public Object visit(ASTOrNode node, Object data) { SortedSet fields = new TreeSet<>(eqNodesByField.keySet()); fields.addAll(rangeNodesByField.keySet()); + // capture the thresholds + int maxOrExpansionFstThreshold = config.getMaxOrExpansionFstThreshold(); + int maxOrExpansionThreshold = config.getMaxOrExpansionThreshold(); + int maxOrRangeThreshold = config.getMaxOrRangeThreshold(); + + // if specific fields were requested, then reduce the thresholds + if (this.fields != null) { + maxOrExpansionThreshold = 2; + maxOrRangeThreshold = 2; + } + for (String field : fields) { // if fields is not specified or the current field is in fields it can be reduced boolean canReduce = (this.fields == null || this.fields.contains(field)); @@ -145,9 +156,9 @@ public Object visit(ASTOrNode node, Object data) { if (canReduce && !Constants.ANY_FIELD.equals(field) && !Constants.NO_FIELD.equals(field) && - (eqNodes.size() >= config.getMaxOrExpansionFstThreshold() || - eqNodes.size() >= config.getMaxOrExpansionThreshold() || - rangeNodes.size() >= config.getMaxOrRangeThreshold() + (eqNodes.size() >= maxOrExpansionFstThreshold || + eqNodes.size() >= maxOrExpansionThreshold || + rangeNodes.size() >= maxOrRangeThreshold ) && isIndexed(field)) { // @formatter:on @@ -164,17 +175,17 @@ public Object visit(ASTOrNode node, Object data) { try { // if we have an hdfs cache directory and if past the fst/list threshold, then create the fst/list and replace the list with an assignment - if (fstHdfsUri != null && (eqNodes.size() >= config.getMaxOrExpansionFstThreshold())) { + if (fstHdfsUri != null && (eqNodes.size() >= maxOrExpansionFstThreshold)) { URI fstPath = createFst(values); markers.add(QueryPropertyMarker.create(new ExceededOr(field, fstPath).getJexlNode(), EXCEEDED_OR)); eqNodes = null; - } else if (eqNodes.size() >= config.getMaxOrExpansionThreshold()) { + } else if (eqNodes.size() >= maxOrExpansionThreshold) { markers.add(QueryPropertyMarker.create(new ExceededOr(field, values).getJexlNode(), EXCEEDED_OR)); eqNodes = null; } // handle range nodes separately - if (rangeNodes.size() >= config.getMaxOrRangeThreshold()) { + if (rangeNodes.size() >= maxOrRangeThreshold) { TreeMap ranges = new TreeMap<>(); rangeNodes.forEach(rangeNode -> ranges.put(rangeNodeToRange(rangeNode), rangeNode)); diff --git a/warehouse/query-core/src/main/java/datawave/query/tables/async/event/VisitorFunction.java b/warehouse/query-core/src/main/java/datawave/query/tables/async/event/VisitorFunction.java index edbf0d9cb14..c68ef9e8008 100644 --- a/warehouse/query-core/src/main/java/datawave/query/tables/async/event/VisitorFunction.java +++ b/warehouse/query-core/src/main/java/datawave/query/tables/async/event/VisitorFunction.java @@ -649,53 +649,40 @@ protected ASTJexlScript pushdownLargeFieldedLists(ShardQueryConfiguration config } if (termCount - capacitySum <= config.getFinalMaxTermThreshold()) { - // preserve the original config and set minimum thresholds for creating Value and Range ivarators - int originalMaxOrExpansionThreshold = config.getMaxOrExpansionThreshold(); - int originalMaxOrRangeThreshold = config.getMaxOrRangeThreshold(); - - config.setMaxOrExpansionThreshold(2); - config.setMaxOrRangeThreshold(2); + // invert pushdownCapacity to get the largest payoffs first + SortedMap> sortedMap = new TreeMap<>(); + for (String fieldName : pushdownCapacity.keySet()) { + Integer reduction = pushdownCapacity.get(fieldName); + List fields = sortedMap.computeIfAbsent(reduction, k -> new ArrayList<>()); + fields.add(fieldName); + } - try { - // invert pushdownCapacity to get the largest payoffs first - SortedMap> sortedMap = new TreeMap<>(); - for (String fieldName : pushdownCapacity.keySet()) { - Integer reduction = pushdownCapacity.get(fieldName); - List fields = sortedMap.computeIfAbsent(reduction, k -> new ArrayList<>()); - fields.add(fieldName); - } - - // sort from largest to smallest reductions and make reductions until under the threshold - Set fieldsToReduce = new HashSet<>(); - int toReduce = termCount - config.getFinalMaxTermThreshold(); - while (toReduce > 0) { - // get the highest value field out of the map - Integer reduction = sortedMap.lastKey(); - List fields = sortedMap.get(reduction); - - // take the first field - String field = fields.remove(0); - fieldsToReduce.add(field); - toReduce -= reduction; - - // if there are no more reductions of this size remove the reduction from pushdown capacity - if (fields.size() == 0) { - sortedMap.remove(reduction); - } + // sort from largest to smallest reductions and make reductions until under the threshold + Set fieldsToReduce = new HashSet<>(); + int toReduce = termCount - config.getFinalMaxTermThreshold(); + while (toReduce > 0) { + // get the highest value field out of the map + Integer reduction = sortedMap.lastKey(); + List fields = sortedMap.get(reduction); + + // take the first field + String field = fields.remove(0); + fieldsToReduce.add(field); + toReduce -= reduction; + + // if there are no more reductions of this size remove the reduction from pushdown capacity + if (fields.size() == 0) { + sortedMap.remove(reduction); } + } - // execute the reduction - if (hdfsQueryCacheUri != null) { - FileSystem fs = VisitorFunction.fileSystemCache.getFileSystem(hdfsQueryCacheUri); - // Find large lists of values against the same field and push down into an Ivarator - script = PushdownLargeFieldedListsVisitor.pushdown(config, script, fs, hdfsQueryCacheUri.toString(), null, fieldsToReduce); - } else { - script = PushdownLargeFieldedListsVisitor.pushdown(config, script, null, null, null, fieldsToReduce); - } - } finally { - // reset config thresholds - config.setMaxOrExpansionThreshold(originalMaxOrExpansionThreshold); - config.setMaxOrRangeThreshold(originalMaxOrRangeThreshold); + // execute the reduction + if (hdfsQueryCacheUri != null) { + FileSystem fs = VisitorFunction.fileSystemCache.getFileSystem(hdfsQueryCacheUri); + // Find large lists of values against the same field and push down into an Ivarator + script = PushdownLargeFieldedListsVisitor.pushdown(config, script, fs, hdfsQueryCacheUri.toString(), null, fieldsToReduce); + } else { + script = PushdownLargeFieldedListsVisitor.pushdown(config, script, null, null, null, fieldsToReduce); } } } From d6aebbcbf7637ee3f88ecb12b2c6cb1b0133c4c1 Mon Sep 17 00:00:00 2001 From: Ivan Bella <347158+ivakegg@users.noreply.github.com> Date: Thu, 7 Aug 2025 21:12:16 +0000 Subject: [PATCH 2/3] Created ImmutableGenericQueryConfiguration and ImmutableShardQueryConfiguration interfaces and updated classes to use them where appropriate. --- .../GenericQueryConfiguration.java | 22 +- .../ImmutableGenericQueryConfiguration.java | 55 ++ ...DatawaveFieldIndexCachingIteratorJexl.java | 2 +- .../java/datawave/next/CountScheduler.java | 4 +- .../next/scanner/DocumentScheduler.java | 6 +- .../query/ancestor/AncestorRangeStream.java | 4 +- .../ImmutableShardQueryConfiguration.java | 499 ++++++++++++++++++ .../query/config/ShardQueryConfiguration.java | 228 +++++++- .../query/index/lookup/IndexInfo.java | 3 +- .../query/index/lookup/RangeStream.java | 12 +- .../query/index/lookup/ShardRangeStream.java | 6 +- .../query/index/lookup/TupleToRange.java | 6 +- .../datawave/query/jexl/JexlASTHelper.java | 8 +- .../functions/ContentFunctionsDescriptor.java | 5 +- ...luationPhaseFilterFunctionsDescriptor.java | 7 +- .../functions/GeoFunctionsDescriptor.java | 7 +- .../functions/GeoWaveFunctionsDescriptor.java | 19 +- ...pingRequiredFilterFunctionsDescriptor.java | 5 +- .../functions/QueryFunctionsDescriptor.java | 5 +- .../arguments/JexlArgumentDescriptor.java | 5 +- .../RebuildingJexlArgumentDescriptor.java | 4 +- .../query/jexl/lookups/AsyncIndexLookup.java | 6 +- .../jexl/lookups/BoundedRangeIndexLookup.java | 5 +- .../query/jexl/lookups/EmptyIndexLookup.java | 4 +- .../lookups/FieldExpansionIndexLookup.java | 4 +- .../jexl/lookups/FieldNameIndexLookup.java | 4 +- .../query/jexl/lookups/IndexLookup.java | 6 +- .../query/jexl/lookups/RegexIndexLookup.java | 10 +- .../ShardIndexQueryTableStaticMethods.java | 70 +-- .../jexl/visitors/AllTermsIndexedVisitor.java | 8 +- .../visitors/BaseIndexExpansionVisitor.java | 14 +- .../BoundedRangeDetectionVisitor.java | 8 +- .../BoundedRangeIndexExpansionVisitor.java | 8 +- .../jexl/visitors/CaseSensitivityVisitor.java | 8 +- .../jexl/visitors/EvaluationRendering.java | 10 +- .../ExecutableDeterminationVisitor.java | 35 +- .../visitors/ExecutableExpansionVisitor.java | 8 +- .../jexl/visitors/ExpandCompositeTerms.java | 8 +- .../visitors/ExpandMultiNormalizedTerms.java | 8 +- .../visitors/FixUnindexedNumericTerms.java | 8 +- .../FunctionIndexQueryExpansionVisitor.java | 10 +- .../PullupUnexecutableNodesVisitor.java | 12 +- .../PushdownLargeFieldedListsVisitor.java | 13 +- .../PushdownLowSelectivityNodesVisitor.java | 8 +- ...PushdownMissingIndexRangeNodesVisitor.java | 6 +- .../PushdownUnexecutableNodesVisitor.java | 10 +- .../jexl/visitors/RegexFunctionVisitor.java | 7 +- .../visitors/RegexIndexExpansionVisitor.java | 10 +- .../jexl/visitors/SetMembershipVisitor.java | 16 +- .../UnfieldedIndexExpansionVisitor.java | 8 +- .../jexl/visitors/whindex/WhindexVisitor.java | 6 +- .../query/planner/pushdown/CostEstimator.java | 6 +- .../query/scheduler/PushdownFunction.java | 10 +- .../query/scheduler/PushdownScheduler.java | 10 +- .../datawave/query/scheduler/Scheduler.java | 5 +- .../query/tables/BatchScannerSession.java | 6 +- .../datawave/query/tables/SessionOptions.java | 8 +- .../query/tables/ShardQueryLogic.java | 4 +- .../tables/async/event/VisitorFunction.java | 10 +- .../config/ShardQueryConfigurationTest.java | 74 ++- 60 files changed, 1128 insertions(+), 255 deletions(-) create mode 100644 core/query/src/main/java/datawave/core/query/configuration/ImmutableGenericQueryConfiguration.java create mode 100644 warehouse/query-core/src/main/java/datawave/query/config/ImmutableShardQueryConfiguration.java diff --git a/core/query/src/main/java/datawave/core/query/configuration/GenericQueryConfiguration.java b/core/query/src/main/java/datawave/core/query/configuration/GenericQueryConfiguration.java index 18945b1f88a..0047176d49d 100644 --- a/core/query/src/main/java/datawave/core/query/configuration/GenericQueryConfiguration.java +++ b/core/query/src/main/java/datawave/core/query/configuration/GenericQueryConfiguration.java @@ -35,7 +35,7 @@ *

* */ -public class GenericQueryConfiguration implements Serializable { +public class GenericQueryConfiguration implements Serializable, ImmutableGenericQueryConfiguration { // is this execution expected to be checkpointable (changes how we allocate ranges to scanners) private boolean checkpointable = false; @@ -132,6 +132,7 @@ public void copyFrom(GenericQueryConfiguration other) { this.setTableHints(other.getTableHints()); } + @Override public Collection getQueries() { return queries; } @@ -145,6 +146,7 @@ public void setQueries(Collection queries) { * * @return An iterator of query ranges */ + @Override public Iterator getQueriesIter() { if ((queriesIter == null || !queriesIter.hasNext()) && queries != null) { return Iterators.unmodifiableIterator(queries.iterator()); @@ -163,6 +165,7 @@ public void setQueriesIter(Iterator queriesIter) { this.queriesIter = queriesIter; } + @Override public boolean isCheckpointable() { return checkpointable; } @@ -171,6 +174,7 @@ public void setCheckpointable(boolean checkpointable) { this.checkpointable = checkpointable; } + @Override public AccumuloClient getClient() { return client; } @@ -179,6 +183,7 @@ public void setClient(AccumuloClient client) { this.client = client; } + @Override public Query getQuery() { return query; } @@ -191,10 +196,12 @@ public void setQueryString(String query) { this.queryString = query; } + @Override public String getQueryString() { return queryString; } + @Override public Set getAuths() { if (auths == null && authorizations != null) { auths = authorizations.stream().flatMap(a -> a.getAuthorizations().stream()).map(b -> new String(b, StandardCharsets.UTF_8)) @@ -209,6 +216,7 @@ public void setAuths(Set auths) { getAuthorizations(); } + @Override public Set getAuthorizations() { if (authorizations == null && auths != null) { authorizations = Collections @@ -223,6 +231,7 @@ public void setAuthorizations(Set authorizations) { getAuths(); } + @Override public int getBaseIteratorPriority() { return baseIteratorPriority; } @@ -231,6 +240,7 @@ public void setBaseIteratorPriority(final int baseIteratorPriority) { this.baseIteratorPriority = baseIteratorPriority; } + @Override public Date getBeginDate() { return beginDate; } @@ -239,6 +249,7 @@ public void setBeginDate(Date beginDate) { this.beginDate = beginDate; } + @Override public Date getEndDate() { return endDate; } @@ -247,6 +258,7 @@ public void setEndDate(Date endDate) { this.endDate = endDate; } + @Override public Long getMaxWork() { return maxWork; } @@ -255,6 +267,7 @@ public void setMaxWork(Long maxWork) { this.maxWork = maxWork; } + @Override public String getTableName() { return tableName; } @@ -263,6 +276,7 @@ public void setTableName(String tableName) { this.tableName = tableName; } + @Override public boolean getBypassAccumulo() { return bypassAccumulo; } @@ -274,10 +288,12 @@ public void setBypassAccumulo(boolean bypassAccumulo) { /** * @return - the accumulo password */ + @Override public String getAccumuloPassword() { return this.accumuloPassword; } + @Override public boolean isReduceResults() { return reduceResults; } @@ -296,6 +312,7 @@ public void setAccumuloPassword(String password) { this.accumuloPassword = EnvProvider.resolve(password); } + @Override public String getConnPoolName() { return connPoolName; } @@ -304,6 +321,7 @@ public void setConnPoolName(String connPoolName) { this.connPoolName = connPoolName; } + @Override public Map getTableConsistencyLevels() { return tableConsistencyLevels; } @@ -312,6 +330,7 @@ public void setTableConsistencyLevels(Map t this.tableConsistencyLevels = tableConsistencyLevels; } + @Override public Map> getTableHints() { return tableHints; } @@ -325,6 +344,7 @@ public void setTableHints(Map> tableHints) { * * @return True if all of the encapsulated values have legitimate values, otherwise false */ + @Override public boolean canRunQuery() { // Ensure we were given connector and authorizations if (null == this.getClient() || null == this.getAuthorizations()) { diff --git a/core/query/src/main/java/datawave/core/query/configuration/ImmutableGenericQueryConfiguration.java b/core/query/src/main/java/datawave/core/query/configuration/ImmutableGenericQueryConfiguration.java new file mode 100644 index 00000000000..eceed025bef --- /dev/null +++ b/core/query/src/main/java/datawave/core/query/configuration/ImmutableGenericQueryConfiguration.java @@ -0,0 +1,55 @@ +package datawave.core.query.configuration; + +import java.util.Collection; +import java.util.Date; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +import org.apache.accumulo.core.client.AccumuloClient; +import org.apache.accumulo.core.client.ScannerBase; +import org.apache.accumulo.core.security.Authorizations; + +import datawave.microservice.query.Query; + +public interface ImmutableGenericQueryConfiguration { + Collection getQueries(); + + Iterator getQueriesIter(); + + boolean isCheckpointable(); + + AccumuloClient getClient(); + + Query getQuery(); + + String getQueryString(); + + Set getAuths(); + + Set getAuthorizations(); + + int getBaseIteratorPriority(); + + Date getBeginDate(); + + Date getEndDate(); + + Long getMaxWork(); + + String getTableName(); + + boolean getBypassAccumulo(); + + String getAccumuloPassword(); + + boolean isReduceResults(); + + String getConnPoolName(); + + Map getTableConsistencyLevels(); + + Map> getTableHints(); + + boolean canRunQuery(); +} diff --git a/warehouse/query-core/src/main/java/datawave/core/iterators/DatawaveFieldIndexCachingIteratorJexl.java b/warehouse/query-core/src/main/java/datawave/core/iterators/DatawaveFieldIndexCachingIteratorJexl.java index 29180d22e2c..8c0fcc33d9a 100644 --- a/warehouse/query-core/src/main/java/datawave/core/iterators/DatawaveFieldIndexCachingIteratorJexl.java +++ b/warehouse/query-core/src/main/java/datawave/core/iterators/DatawaveFieldIndexCachingIteratorJexl.java @@ -457,7 +457,7 @@ protected DatawaveFieldIndexCachingIteratorJexl(Builder builder) { this.termNumber = builder.termNumber; // Note: We have already selected the control directory at random in the DefaultQueryPlanner - // @see DefaultQueryPlanner#getShuffledIvaratoCacheDirConfigs(ShardQueryConfiguration) + // @see DefaultQueryPlanner#getShuffledIvaratoCacheDirConfigs(ImmutableShardQueryConfiguration) if (ivaratorCacheDirs.size() > 0) { this.controlFs = ivaratorCacheDirs.get(0).getFs(); this.controlDir = new Path(ivaratorCacheDirs.get(0).getPathURI()); diff --git a/warehouse/query-core/src/main/java/datawave/next/CountScheduler.java b/warehouse/query-core/src/main/java/datawave/next/CountScheduler.java index b4cfafd5511..1adc6bd22e6 100644 --- a/warehouse/query-core/src/main/java/datawave/next/CountScheduler.java +++ b/warehouse/query-core/src/main/java/datawave/next/CountScheduler.java @@ -2,11 +2,11 @@ import datawave.next.scanner.DocumentScanner; import datawave.next.scanner.DocumentScheduler; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; public class CountScheduler extends DocumentScheduler { - public CountScheduler(ShardQueryConfiguration config) { + public CountScheduler(ImmutableShardQueryConfiguration config) { super(config); } diff --git a/warehouse/query-core/src/main/java/datawave/next/scanner/DocumentScheduler.java b/warehouse/query-core/src/main/java/datawave/next/scanner/DocumentScheduler.java index 5b8c2b4e810..db4da673376 100644 --- a/warehouse/query-core/src/main/java/datawave/next/scanner/DocumentScheduler.java +++ b/warehouse/query-core/src/main/java/datawave/next/scanner/DocumentScheduler.java @@ -15,7 +15,7 @@ import datawave.core.query.configuration.Result; import datawave.core.query.logic.QueryCheckpoint; import datawave.core.query.logic.QueryKey; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.scheduler.PushdownScheduler; import datawave.query.scheduler.Scheduler; import datawave.query.tables.ScannerFactory; @@ -38,7 +38,7 @@ public class DocumentScheduler extends Scheduler { protected DocumentScanner scanner; protected VisitorFunction visitorFunction; - public DocumentScheduler(ShardQueryConfiguration config) { + public DocumentScheduler(ImmutableShardQueryConfiguration config) { this.config = config.getDocumentScannerConfig(); this.config.setClient(config.getClient()); this.config.setAuthorizations(AuthorizationsMinimizer.minimize(config.getAuthorizations()).iterator().next()); @@ -52,7 +52,7 @@ public void setVisitorFunction(VisitorFunction visitorFunction) { } @Override - public BatchScanner createBatchScanner(ShardQueryConfiguration config, ScannerFactory scannerFactory, QueryData qd) throws TableNotFoundException { + public BatchScanner createBatchScanner(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, QueryData qd) throws TableNotFoundException { throw new RuntimeException("Not implemented"); } diff --git a/warehouse/query-core/src/main/java/datawave/query/ancestor/AncestorRangeStream.java b/warehouse/query-core/src/main/java/datawave/query/ancestor/AncestorRangeStream.java index 1d459b86313..ca31530b3c6 100644 --- a/warehouse/query-core/src/main/java/datawave/query/ancestor/AncestorRangeStream.java +++ b/warehouse/query-core/src/main/java/datawave/query/ancestor/AncestorRangeStream.java @@ -3,7 +3,7 @@ import org.apache.commons.jexl3.parser.ASTAndNode; import org.apache.commons.jexl3.parser.ASTOrNode; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.index.lookup.AncestorIndexStream; import datawave.query.index.lookup.IndexStream; import datawave.query.index.lookup.RangeStream; @@ -14,7 +14,7 @@ * Prevent ranges that are from the same document from both being returned, resulting in duplicate rows across the ancestor */ public class AncestorRangeStream extends RangeStream { - public AncestorRangeStream(ShardQueryConfiguration config, ScannerFactory scanners, MetadataHelper metadataHelper) { + public AncestorRangeStream(ImmutableShardQueryConfiguration config, ScannerFactory scanners, MetadataHelper metadataHelper) { super(config, scanners, metadataHelper); } diff --git a/warehouse/query-core/src/main/java/datawave/query/config/ImmutableShardQueryConfiguration.java b/warehouse/query-core/src/main/java/datawave/query/config/ImmutableShardQueryConfiguration.java new file mode 100644 index 00000000000..a57cd693d5c --- /dev/null +++ b/warehouse/query-core/src/main/java/datawave/query/config/ImmutableShardQueryConfiguration.java @@ -0,0 +1,499 @@ +package datawave.query.config; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; + +import org.apache.accumulo.core.data.Key; +import org.apache.accumulo.core.data.Value; +import org.apache.accumulo.core.iterators.SortedKeyValueIterator; +import org.apache.commons.jexl3.parser.ASTJexlScript; +import org.apache.commons.jexl3.parser.JexlNode; + +import com.google.common.collect.Multimap; +import com.google.common.hash.BloomFilter; + +import datawave.core.query.configuration.ImmutableGenericQueryConfiguration; +import datawave.data.type.DiscreteIndexType; +import datawave.data.type.Type; +import datawave.next.scanner.DocumentScannerConfig; +import datawave.query.DocumentSerialization; +import datawave.query.attributes.ExcerptFields; +import datawave.query.attributes.SummaryOptions; +import datawave.query.attributes.UniqueFields; +import datawave.query.common.grouping.GroupFields; +import datawave.query.iterator.ivarator.IvaratorCacheDirConfig; +import datawave.query.model.QueryModel; +import datawave.query.util.QueryStopwatch; + +public interface ImmutableShardQueryConfiguration extends ImmutableGenericQueryConfiguration { + String getShardTableName(); + + String getMetadataTableName(); + + String getDateIndexTableName(); + + String getDefaultDateTypeName(); + + String getIndexTableName(); + + String getReverseIndexTableName(); + + String getIndexStatsTableName(); + + Integer getNumQueryThreads(); + + Integer getNumIndexLookupThreads(); + + Integer getNumDateIndexThreads(); + + Integer getMaxDocScanTimeout(); + + float getCollapseDatePercentThreshold(); + + Boolean getFullTableScanEnabled(); + + String getShardDateFormat(); + + SimpleDateFormat getShardDateFormatter(); + + Set getDatatypeFilter(); + + String getDatatypeFilterAsString(); + + Set getProjectFields(); + + String getProjectFieldsAsString(); + + Set getRenameFields(); + + Set getDisallowlistedFields(); + + String getDisallowlistedFieldsAsString(); + + Boolean getUseEnrichers(); + + List getEnricherClassNames(); + + boolean isTldQuery(); + + boolean isDebugMultithreadedSources(); + + boolean isSortGeoWaveQueryRanges(); + + int getNumRangesToBuffer(); + + long getRangeBufferTimeoutMillis(); + + long getRangeBufferPollMillis(); + + int getGeometryMaxExpansion(); + + int getPointMaxExpansion(); + + int getGeoMaxExpansion(); + + int getGeoWaveRangeSplitThreshold(); + + double getGeoWaveMaxRangeOverlap(); + + boolean isOptimizeGeoWaveRanges(); + + int getGeoWaveMaxEnvelopes(); + + Boolean getUseFilters(); + + Map getFilterOptions(); + + List getFilterClassNames(); + + String getFieldRuleClassName(); + + List getIndexFilteringClassNames(); + + Class> getDefaultType(); + + Set getNonEventKeyPrefixes(); + + String getNonEventKeyPrefixesAsString(); + + Set getUnevaluatedFields(); + + @Deprecated(since = "7.1.0", forRemoval = true) + int getEventPerDayThreshold(); + + @Deprecated(since = "7.1.0", forRemoval = true) + int getShardsPerDayThreshold(); + + int getInitialMaxTermThreshold(); + + int getIntermediateMaxTermThreshold(); + + int getIndexedMaxTermThreshold(); + + int getFinalMaxTermThreshold(); + + int getMaxDepthThreshold(); + + boolean isExpandFields(); + + int getMaxUnfieldedExpansionThreshold(); + + boolean isExpandValues(); + + int getMaxValueExpansionThreshold(); + + int getMaxScannerBatchSize(); + + int getMaxIndexBatchSize(); + + int getMaxOrExpansionThreshold(); + + int getMaxOrRangeThreshold(); + + int getMaxOrRangeIvarators(); + + int getMaxRangesPerRangeIvarator(); + + int getMaxOrExpansionFstThreshold(); + + String getHdfsSiteConfigURLs(); + + String getHdfsFileCompressionCodec(); + + String getZookeeperConfig(); + + List getIvaratorCacheDirConfigs(); + + List getLocalIvaratorCacheDirConfigs(); + + String getIvaratorFstHdfsBaseURIs(); + + int getUniqueCacheBufferSize(); + + int getIvaratorCacheBufferSize(); + + long getIvaratorCacheScanPersistThreshold(); + + long getIvaratorCacheScanTimeout(); + + int getMaxFieldIndexRangeSplit(); + + int getIvaratorMaxOpenFiles(); + + int getIvaratorNumRetries(); + + boolean isIvaratorPersistVerify(); + + int getIvaratorPersistVerifyCount(); + + int getMaxIvaratorSources(); + + long getMaxIvaratorSourceWait(); + + long getMaxIvaratorResults(); + + int getMaxIvaratorTerms(); + + int getMaxEvaluationPipelines(); + + int getMaxPipelineCachedResults(); + + boolean isExpandAllTerms(); + + String getIndexedFieldDataTypesAsString(); + + String getNormalizedFieldNormalizersAsString(); + + Set getIndexedFields(); + + Set getReverseIndexedFields(); + + Set getNormalizedFields(); + + Multimap> getDataTypes(); + + Multimap> getQueryFieldsDatatypes(); + + Map> getFieldToDiscreteIndexTypes(); + + Multimap getCompositeToFieldMap(); + + Map getCompositeTransitionDates(); + + Map getCompositeFieldSeparators(); + + Map getWhindexCreationDates(); + + Multimap> getNormalizedFieldsDatatypes(); + + Set getLimitFields(); + + String getLimitFieldsAsString(); + + Set getMatchingFieldSets(); + + String getMatchingFieldSetsAsString(); + + boolean isLimitFieldsPreQueryEvaluation(); + + String getLimitFieldsField(); + + boolean isDateIndexTimeTravel(); + + boolean isDateIndexIterator(); + + boolean getIgnoreNonExistentFields(); + + long getBeginDateCap(); + + boolean isFailOutsideValidDateRange(); + + int getGroupFieldsBatchSize(); + + String getGroupFieldsBatchSizeAsString(); + + boolean isDisableIteratorUniqueFields(); + + UniqueFields getUniqueFields(); + + boolean isHitList(); + + boolean isRawTypes(); + + double getMinSelectivity(); + + boolean canRunQuery(); + + boolean getFilterMaskedValues(); + + boolean getIncludeDataTypeAsField(); + + boolean getIncludeRecordId(); + + boolean getIncludeHierarchyFields(); + + Map getHierarchyFieldOptions(); + + boolean getIncludeGroupingContext(); + + List getDocumentPermutations(); + + boolean isReducedResponse(); + + boolean isDisableEvaluation(); + + boolean isDisableIndexOnlyDocuments(); + + boolean isContainsIndexOnlyTerms(); + + boolean isContainsCompositeTerms(); + + boolean isAllowFieldIndexEvaluation(); + + boolean isAllowTermFrequencyLookup(); + + boolean isExpandUnfieldedNegations(); + + boolean isAllTermsIndexOnly(); + + QueryModel getQueryModel(); + + String getModelName(); + + String getModelTableName(); + + DocumentSerialization.ReturnType getReturnType(); + + QueryStopwatch getTimers(); + + ASTJexlScript getQueryTree(); + + String getQueryString(); + + boolean isCompressServerSideResults(); + + boolean isIndexOnlyFilterFunctionsEnabled(); + + boolean isCompositeFilterFunctionsEnabled(); + + List getRealmSuffixExclusionPatterns(); + + Set getQueryTermFrequencyFields(); + + boolean isTermFrequenciesRequired(); + + boolean isLimitTermExpansionToModel(); + + long getMaxIndexScanTimeMillis(); + + boolean getParseTldUids(); + + boolean getCollapseUids(); + + int getCollapseUidsThreshold(); + + boolean getEnforceUniqueTermsWithinExpressions(); + + boolean getPruneQueryByIngestTypes(); + + boolean getReduceQueryFields(); + + boolean getReduceQueryFieldsPerShard(); + + boolean getReduceTypeMetadata(); + + boolean getReduceTypeMetadataPerShard(); + + boolean getLimitAnyFieldLookups(); + + boolean getAllowShortcutEvaluation(); + + boolean getAccrueStats(); + + List getIndexValueHoles(); + + boolean getCollectTimingDetails(); + + boolean getLogTimingDetails(); + + String getStatsdHost(); + + int getStatsdPort(); + + int getStatsdMaxQueueSize(); + + boolean getSendTimingToStatsd(); + + boolean isCleanupShardsAndDaysQueryHints(); + + AtomicInteger getFstCount(); + + boolean getCacheModel(); + + boolean isBypassExecutabilityCheck(); + + boolean getBackoffEnabled(); + + boolean getUnsortedUIDsEnabled(); + + boolean getSpeculativeScanning(); + + boolean getSerializeQueryIterator(); + + boolean isSortedUIDs(); + + long getYieldThresholdMs(); + + boolean isTrackSizes(); + + List getContentFieldNames(); + + Set getEvaluationOnlyFields(); + + Set getDisallowedRegexPatterns(); + + String getActiveQueryLogNameSource(); + + String getActiveQueryLogName(); + + boolean isDisableWhindexFieldMappings(); + + Set getWhindexMappingFields(); + + Map> getWhindexFieldMappings(); + + boolean isGeneratePlanOnly(); + + boolean getEnforceUniqueConjunctionsWithinExpression(); + + boolean getEnforceUniqueDisjunctionsWithinExpression(); + + BloomFilter getBloom(); + + Set getNoExpansionFields(); + + Set getLenientFields(); + + Set getStrictFields(); + + ExcerptFields getExcerptFields(); + + Class> getExcerptIterator(); + + SummaryOptions getSummaryOptions(); + + Class> getSummaryIterator(); + + String getSummaryFieldName(); + + int getFiFieldSeek(); + + int getFiNextSeek(); + + int getEventFieldSeek(); + + int getEventNextSeek(); + + int getTfFieldSeek(); + + int getTfNextSeek(); + + boolean isSeekingEventAggregation(); + + long getVisitorFunctionMaxWeight(); + + long getQueryExecutionForPageTimeout(); + + boolean isLazySetMechanismEnabled(); + + int getDocAggregationThresholdMs(); + + int getTfAggregationThresholdMs(); + + GroupFields getGroupFields(); + + boolean getPruneQueryOptions(); + + boolean isRebuildDatatypeFilter(); + + boolean isRebuildDatatypeFilterPerShard(); + + double getIndexFieldHoleMinThreshold(); + + boolean getReduceIngestTypes(); + + boolean getReduceIngestTypesPerShard(); + + boolean isSortQueryPreIndexWithImpliedCounts(); + + boolean isSortQueryPreIndexWithFieldCounts(); + + boolean isSortQueryPostIndexWithFieldCounts(); + + boolean isSortQueryPostIndexWithTermCounts(); + + int getCardinalityThreshold(); + + boolean isUseQueryTreeScanHintRules(); + + List> getQueryTreeScanHintRules(); + + long getMaxAnyFieldScanTimeMillis(); + + Set getNoExpansionIfCurrentDateTypes(); + + DocumentScannerConfig getDocumentScannerConfig(); + + boolean isUseDocumentScheduler(); + + int getMaxLinesToPrint(); + + boolean canHandleExceededValueThreshold(); + + boolean canHandleExceededTermThreshold(); + +} diff --git a/warehouse/query-core/src/main/java/datawave/query/config/ShardQueryConfiguration.java b/warehouse/query-core/src/main/java/datawave/query/config/ShardQueryConfiguration.java index 3a149e6eec6..0e89463312f 100644 --- a/warehouse/query-core/src/main/java/datawave/query/config/ShardQueryConfiguration.java +++ b/warehouse/query-core/src/main/java/datawave/query/config/ShardQueryConfiguration.java @@ -80,7 +80,8 @@ * This class can be initialized with an instance of a ShardQueryLogic or ShardQueryTable which will grab the already configured parameters from the Accumulo * Webservice QueryTable and apply them to this configuration object */ -public class ShardQueryConfiguration extends GenericQueryConfiguration implements Serializable, CheckpointableQueryConfiguration { +public class ShardQueryConfiguration extends GenericQueryConfiguration + implements Serializable, CheckpointableQueryConfiguration, ImmutableShardQueryConfiguration { public static final String PARAM_VALUE_SEP_STR = new String(new char[] {Constants.PARAM_VALUE_SEP}); public static final String TABLE_NAME_SOURCE = "tableName"; @@ -982,6 +983,7 @@ public void setTableName(String tableName) { this.shardTableName = tableName; } + @Override public String getMetadataTableName() { return metadataTableName; } @@ -990,6 +992,7 @@ public void setMetadataTableName(String metadataTableName) { this.metadataTableName = metadataTableName; } + @Override public String getDateIndexTableName() { return dateIndexTableName; } @@ -998,6 +1001,7 @@ public void setDateIndexTableName(String dateIndexTableName) { this.dateIndexTableName = dateIndexTableName; } + @Override public String getDefaultDateTypeName() { return defaultDateTypeName; } @@ -1006,6 +1010,7 @@ public void setDefaultDateTypeName(String defaultDateTypeName) { this.defaultDateTypeName = defaultDateTypeName; } + @Override public String getIndexTableName() { return indexTableName; } @@ -1014,6 +1019,7 @@ public void setIndexTableName(String indexTableName) { this.indexTableName = indexTableName; } + @Override public String getReverseIndexTableName() { return reverseIndexTableName; } @@ -1022,6 +1028,7 @@ public void setReverseIndexTableName(String reverseIndexTableName) { this.reverseIndexTableName = reverseIndexTableName; } + @Override public String getIndexStatsTableName() { return indexStatsTableName; } @@ -1030,6 +1037,7 @@ public void setIndexStatsTableName(String statsTableName) { this.indexStatsTableName = statsTableName; } + @Override public Integer getNumQueryThreads() { return numQueryThreads; } @@ -1038,6 +1046,7 @@ public void setNumQueryThreads(Integer numQueryThreads) { this.numQueryThreads = numQueryThreads; } + @Override public Integer getNumIndexLookupThreads() { return numLookupThreads; } @@ -1046,6 +1055,7 @@ public void setNumIndexLookupThreads(Integer numIndexLookupThreads) { this.numLookupThreads = numIndexLookupThreads; } + @Override public Integer getNumDateIndexThreads() { return numDateIndexThreads; } @@ -1054,6 +1064,7 @@ public void setNumDateIndexThreads(Integer numDateIndexThreads) { this.numDateIndexThreads = numDateIndexThreads; } + @Override public Integer getMaxDocScanTimeout() { return maxDocScanTimeout; } @@ -1062,6 +1073,7 @@ public void setMaxDocScanTimeout(Integer maxDocScanTimeout) { this.maxDocScanTimeout = maxDocScanTimeout; } + @Override public float getCollapseDatePercentThreshold() { return collapseDatePercentThreshold; } @@ -1070,6 +1082,7 @@ public void setCollapseDatePercentThreshold(float collapseDatePercentThreshold) this.collapseDatePercentThreshold = collapseDatePercentThreshold; } + @Override public Boolean getFullTableScanEnabled() { return fullTableScanEnabled; } @@ -1078,6 +1091,7 @@ public void setFullTableScanEnabled(Boolean fullTableScanEnabled) { this.fullTableScanEnabled = fullTableScanEnabled; } + @Override public String getShardDateFormat() { return shardDateFormat; } @@ -1086,6 +1100,7 @@ public void setShardDateFormat(String shardDateFormat) { this.shardDateFormat = shardDateFormat; } + @Override public SimpleDateFormat getShardDateFormatter() { return shardDateFormatter; } @@ -1094,6 +1109,7 @@ public void setShardDateFormatter(SimpleDateFormat shardDateFormatter) { this.shardDateFormatter = shardDateFormatter; } + @Override public Set getDatatypeFilter() { return datatypeFilter; } @@ -1102,6 +1118,7 @@ public void setDatatypeFilter(Set typeFilter) { this.datatypeFilter = typeFilter; } + @Override public String getDatatypeFilterAsString() { return StringUtils.join(this.getDatatypeFilter(), Constants.PARAM_VALUE_SEP); } @@ -1110,6 +1127,7 @@ private Set deconstruct(Collection fields) { return fields == null ? null : fields.stream().map(JexlASTHelper::deconstructIdentifier).collect(Collectors.toSet()); } + @Override public Set getProjectFields() { return projectFields; } @@ -1118,10 +1136,12 @@ public void setProjectFields(Set projectFields) { this.projectFields = deconstruct(projectFields); } + @Override public String getProjectFieldsAsString() { return StringUtils.join(this.getProjectFields(), Constants.PARAM_VALUE_SEP); } + @Override public Set getRenameFields() { return renameFields; } @@ -1130,6 +1150,7 @@ public void setRenameFields(Set renameFields) { this.renameFields = renameFields; } + @Override public Set getDisallowlistedFields() { return disallowlistedFields; } @@ -1138,10 +1159,12 @@ public void setDisallowlistedFields(Set disallowlistedFields) { this.disallowlistedFields = deconstruct(disallowlistedFields); } + @Override public String getDisallowlistedFieldsAsString() { return StringUtils.join(this.getDisallowlistedFields(), Constants.PARAM_VALUE_SEP); } + @Override public Boolean getUseEnrichers() { return useEnrichers; } @@ -1150,6 +1173,7 @@ public void setUseEnrichers(Boolean useEnrichers) { this.useEnrichers = useEnrichers; } + @Override public List getEnricherClassNames() { return enricherClassNames; } @@ -1158,6 +1182,7 @@ public void setEnricherClassNames(List enricherClassNames) { this.enricherClassNames = enricherClassNames; } + @Override public boolean isTldQuery() { return tldQuery; } @@ -1166,6 +1191,7 @@ public void setTldQuery(boolean tldQuery) { this.tldQuery = tldQuery; } + @Override public boolean isDebugMultithreadedSources() { return debugMultithreadedSources; } @@ -1174,6 +1200,7 @@ public void setDebugMultithreadedSources(boolean debugMultithreadedSources) { this.debugMultithreadedSources = debugMultithreadedSources; } + @Override public boolean isSortGeoWaveQueryRanges() { return sortGeoWaveQueryRanges; } @@ -1182,6 +1209,7 @@ public void setSortGeoWaveQueryRanges(boolean sortGeoWaveQueryRanges) { this.sortGeoWaveQueryRanges = sortGeoWaveQueryRanges; } + @Override public int getNumRangesToBuffer() { return numRangesToBuffer; } @@ -1190,6 +1218,7 @@ public void setNumRangesToBuffer(int numRangesToBuffer) { this.numRangesToBuffer = numRangesToBuffer; } + @Override public long getRangeBufferTimeoutMillis() { return rangeBufferTimeoutMillis; } @@ -1198,6 +1227,7 @@ public void setRangeBufferTimeoutMillis(long rangeBufferTimeoutMillis) { this.rangeBufferTimeoutMillis = rangeBufferTimeoutMillis; } + @Override public long getRangeBufferPollMillis() { return rangeBufferPollMillis; } @@ -1206,6 +1236,7 @@ public void setRangeBufferPollMillis(long rangeBufferPollMillis) { this.rangeBufferPollMillis = rangeBufferPollMillis; } + @Override public int getGeometryMaxExpansion() { return geometryMaxExpansion; } @@ -1214,6 +1245,7 @@ public void setGeometryMaxExpansion(int geometryMaxExpansion) { this.geometryMaxExpansion = geometryMaxExpansion; } + @Override public int getPointMaxExpansion() { return pointMaxExpansion; } @@ -1222,6 +1254,7 @@ public void setPointMaxExpansion(int pointMaxExpansion) { this.pointMaxExpansion = pointMaxExpansion; } + @Override public int getGeoMaxExpansion() { return geoMaxExpansion; } @@ -1230,6 +1263,7 @@ public void setGeoMaxExpansion(int geoMaxExpansion) { this.geoMaxExpansion = geoMaxExpansion; } + @Override public int getGeoWaveRangeSplitThreshold() { return geoWaveRangeSplitThreshold; } @@ -1238,6 +1272,7 @@ public void setGeoWaveRangeSplitThreshold(int geoWaveRangeSplitThreshold) { this.geoWaveRangeSplitThreshold = geoWaveRangeSplitThreshold; } + @Override public double getGeoWaveMaxRangeOverlap() { return geoWaveMaxRangeOverlap; } @@ -1246,6 +1281,7 @@ public void setGeoWaveMaxRangeOverlap(double geoWaveMaxRangeOverlap) { this.geoWaveMaxRangeOverlap = geoWaveMaxRangeOverlap; } + @Override public boolean isOptimizeGeoWaveRanges() { return optimizeGeoWaveRanges; } @@ -1254,6 +1290,7 @@ public void setOptimizeGeoWaveRanges(boolean optimizeGeoWaveRanges) { this.optimizeGeoWaveRanges = optimizeGeoWaveRanges; } + @Override public int getGeoWaveMaxEnvelopes() { return geoWaveMaxEnvelopes; } @@ -1262,6 +1299,7 @@ public void setGeoWaveMaxEnvelopes(int geoWaveMaxEnvelopes) { this.geoWaveMaxEnvelopes = geoWaveMaxEnvelopes; } + @Override public Boolean getUseFilters() { return useFilters; } @@ -1298,6 +1336,7 @@ public void putFilterOptions(final Map options) { } } + @Override public Map getFilterOptions() { return Collections.unmodifiableMap(filterOptions); } @@ -1307,6 +1346,7 @@ public void setFilterOptions(Map options) { this.filterOptions.putAll(options); } + @Override public List getFilterClassNames() { return filterClassNames; } @@ -1316,6 +1356,7 @@ public void setFilterClassNames(List filterClassNames) { this.filterClassNames = new ArrayList<>((filterClassNames != null ? filterClassNames : Collections.EMPTY_LIST)); } + @Override public String getFieldRuleClassName() { return fieldRuleClassName; } @@ -1332,6 +1373,7 @@ public void setFieldRuleClassName(String fieldRuleClassName) { * @see QueryIterator * @see TLDQueryIterator */ + @Override public List getIndexFilteringClassNames() { return indexFilteringClassNames; } @@ -1348,6 +1390,7 @@ public void setIndexFilteringClassNames(List classNames) { this.indexFilteringClassNames = new ArrayList<>((classNames != null ? classNames : Collections.EMPTY_LIST)); } + @Override public Class> getDefaultType() { return defaultType; } @@ -1365,6 +1408,7 @@ public void setDefaultType(String className) { } } + @Override public Set getNonEventKeyPrefixes() { return nonEventKeyPrefixes; } @@ -1377,10 +1421,12 @@ public void setNonEventKeyPrefixes(Collection nonEventKeyPrefixes) { } } + @Override public String getNonEventKeyPrefixesAsString() { return StringUtils.join(this.getNonEventKeyPrefixes(), Constants.PARAM_VALUE_SEP); } + @Override public Set getUnevaluatedFields() { return unevaluatedFields; } @@ -1394,6 +1440,7 @@ public void setUnevaluatedFields(Collection unevaluatedFields) { } @Deprecated(since = "7.1.0", forRemoval = true) + @Override public int getEventPerDayThreshold() { return eventPerDayThreshold; } @@ -1404,6 +1451,7 @@ public void setEventPerDayThreshold(int eventPerDayThreshold) { } @Deprecated(since = "7.1.0", forRemoval = true) + @Override public int getShardsPerDayThreshold() { return shardsPerDayThreshold; } @@ -1413,6 +1461,7 @@ public void setShardsPerDayThreshold(int shardsPerDayThreshold) { this.shardsPerDayThreshold = shardsPerDayThreshold; } + @Override public int getInitialMaxTermThreshold() { return initialMaxTermThreshold; } @@ -1421,6 +1470,7 @@ public void setInitialMaxTermThreshold(int initialMaxTermThreshold) { this.initialMaxTermThreshold = initialMaxTermThreshold; } + @Override public int getIntermediateMaxTermThreshold() { return intermediateMaxTermThreshold; } @@ -1429,6 +1479,7 @@ public void setIntermediateMaxTermThreshold(int intermediateMaxTermThreshold) { this.intermediateMaxTermThreshold = intermediateMaxTermThreshold; } + @Override public int getIndexedMaxTermThreshold() { return indexedMaxTermThreshold; } @@ -1437,6 +1488,7 @@ public void setIndexedMaxTermThreshold(int indexedMaxTermThreshold) { this.indexedMaxTermThreshold = indexedMaxTermThreshold; } + @Override public int getFinalMaxTermThreshold() { return finalMaxTermThreshold; } @@ -1445,6 +1497,7 @@ public void setFinalMaxTermThreshold(int finalMaxTermThreshold) { this.finalMaxTermThreshold = finalMaxTermThreshold; } + @Override public int getMaxDepthThreshold() { return maxDepthThreshold; } @@ -1453,6 +1506,7 @@ public void setMaxDepthThreshold(int maxDepthThreshold) { this.maxDepthThreshold = maxDepthThreshold; } + @Override public boolean isExpandFields() { return expandFields; } @@ -1461,6 +1515,7 @@ public void setExpandFields(boolean expandFields) { this.expandFields = expandFields; } + @Override public int getMaxUnfieldedExpansionThreshold() { return maxUnfieldedExpansionThreshold; } @@ -1469,6 +1524,7 @@ public void setMaxUnfieldedExpansionThreshold(int maxUnfieldedExpansionThreshold this.maxUnfieldedExpansionThreshold = maxUnfieldedExpansionThreshold; } + @Override public boolean isExpandValues() { return expandValues; } @@ -1477,6 +1533,7 @@ public void setExpandValues(boolean expandValues) { this.expandValues = expandValues; } + @Override public int getMaxValueExpansionThreshold() { return maxValueExpansionThreshold; } @@ -1485,6 +1542,7 @@ public void setMaxValueExpansionThreshold(int maxValueExpansionThreshold) { this.maxValueExpansionThreshold = maxValueExpansionThreshold; } + @Override public int getMaxScannerBatchSize() { return this.maxScannerBatchSize; } @@ -1493,6 +1551,7 @@ public void setMaxScannerBatchSize(final int size) { this.maxScannerBatchSize = size; } + @Override public int getMaxIndexBatchSize() { return this.maxIndexBatchSize; } @@ -1503,6 +1562,7 @@ public void setMaxIndexBatchSize(final int size) { } } + @Override public int getMaxOrExpansionThreshold() { return maxOrExpansionThreshold; } @@ -1511,6 +1571,7 @@ public void setMaxOrExpansionThreshold(int maxOrExpansionThreshold) { this.maxOrExpansionThreshold = maxOrExpansionThreshold; } + @Override public int getMaxOrRangeThreshold() { return maxOrRangeThreshold; } @@ -1519,6 +1580,7 @@ public void setMaxOrRangeThreshold(int maxOrRangeThreshold) { this.maxOrRangeThreshold = maxOrRangeThreshold; } + @Override public int getMaxOrRangeIvarators() { return maxOrRangeIvarators; } @@ -1527,6 +1589,7 @@ public void setMaxOrRangeIvarators(int maxOrRangeIvarators) { this.maxOrRangeIvarators = maxOrRangeIvarators; } + @Override public int getMaxRangesPerRangeIvarator() { return maxRangesPerRangeIvarator; } @@ -1535,6 +1598,7 @@ public void setMaxRangesPerRangeIvarator(int maxRangesPerRangeIvarator) { this.maxRangesPerRangeIvarator = maxRangesPerRangeIvarator; } + @Override public int getMaxOrExpansionFstThreshold() { return maxOrExpansionFstThreshold; } @@ -1543,6 +1607,7 @@ public void setMaxOrExpansionFstThreshold(int maxOrExpansionFstThreshold) { this.maxOrExpansionFstThreshold = maxOrExpansionFstThreshold; } + @Override public String getHdfsSiteConfigURLs() { return hdfsSiteConfigURLs; } @@ -1551,6 +1616,7 @@ public void setHdfsSiteConfigURLs(String hadoopConfigURLs) { this.hdfsSiteConfigURLs = hadoopConfigURLs; } + @Override public String getHdfsFileCompressionCodec() { return hdfsFileCompressionCodec; } @@ -1559,6 +1625,7 @@ public void setHdfsFileCompressionCodec(String hdfsFileCompressionCodec) { this.hdfsFileCompressionCodec = hdfsFileCompressionCodec; } + @Override public String getZookeeperConfig() { return zookeeperConfig; } @@ -1567,6 +1634,7 @@ public void setZookeeperConfig(String zookeeperConfig) { this.zookeeperConfig = zookeeperConfig; } + @Override public List getIvaratorCacheDirConfigs() { return ivaratorCacheDirConfigs; } @@ -1579,10 +1647,12 @@ public void setLocalIvaratorCacheDirConfigs(List localIv this.localIvaratorCacheDirConfigs = localIvaratorCacheDirConfigs; } + @Override public List getLocalIvaratorCacheDirConfigs() { return localIvaratorCacheDirConfigs; } + @Override public String getIvaratorFstHdfsBaseURIs() { return ivaratorFstHdfsBaseURIs; } @@ -1591,6 +1661,7 @@ public void setIvaratorFstHdfsBaseURIs(String ivaratorFstHdfsBaseURIs) { this.ivaratorFstHdfsBaseURIs = ivaratorFstHdfsBaseURIs; } + @Override public int getUniqueCacheBufferSize() { return uniqueCacheBufferSize; } @@ -1599,6 +1670,7 @@ public void setUniqueCacheBufferSize(int uniqueCacheBufferSize) { this.uniqueCacheBufferSize = uniqueCacheBufferSize; } + @Override public int getIvaratorCacheBufferSize() { return ivaratorCacheBufferSize; } @@ -1607,6 +1679,7 @@ public void setIvaratorCacheBufferSize(int ivaratorCacheBufferSize) { this.ivaratorCacheBufferSize = ivaratorCacheBufferSize; } + @Override public long getIvaratorCacheScanPersistThreshold() { return ivaratorCacheScanPersistThreshold; } @@ -1615,6 +1688,7 @@ public void setIvaratorCacheScanPersistThreshold(long ivaratorCacheScanPersistTh this.ivaratorCacheScanPersistThreshold = ivaratorCacheScanPersistThreshold; } + @Override public long getIvaratorCacheScanTimeout() { return ivaratorCacheScanTimeout; } @@ -1623,6 +1697,7 @@ public void setIvaratorCacheScanTimeout(long ivaratorCacheScanTimeout) { this.ivaratorCacheScanTimeout = ivaratorCacheScanTimeout; } + @Override public int getMaxFieldIndexRangeSplit() { return maxFieldIndexRangeSplit; } @@ -1631,6 +1706,7 @@ public void setMaxFieldIndexRangeSplit(int maxFieldIndexRangeSplit) { this.maxFieldIndexRangeSplit = maxFieldIndexRangeSplit; } + @Override public int getIvaratorMaxOpenFiles() { return ivaratorMaxOpenFiles; } @@ -1639,6 +1715,7 @@ public void setIvaratorMaxOpenFiles(int ivaratorMaxOpenFiles) { this.ivaratorMaxOpenFiles = ivaratorMaxOpenFiles; } + @Override public int getIvaratorNumRetries() { return ivaratorNumRetries; } @@ -1655,6 +1732,7 @@ public void setIvaratorPersistVerify(boolean ivaratorPersistVerify) { this.ivaratorPersistVerify = ivaratorPersistVerify; } + @Override public int getIvaratorPersistVerifyCount() { return ivaratorPersistVerifyCount; } @@ -1663,6 +1741,7 @@ public void setIvaratorPersistVerifyCount(int ivaratorPersistVerifyCount) { this.ivaratorPersistVerifyCount = ivaratorPersistVerifyCount; } + @Override public int getMaxIvaratorSources() { return maxIvaratorSources; } @@ -1671,6 +1750,7 @@ public void setMaxIvaratorSources(int maxIvaratorSources) { this.maxIvaratorSources = maxIvaratorSources; } + @Override public long getMaxIvaratorSourceWait() { return maxIvaratorSourceWait; } @@ -1679,6 +1759,7 @@ public void setMaxIvaratorSourceWait(long maxIvaratorSourceWait) { this.maxIvaratorSourceWait = maxIvaratorSourceWait; } + @Override public long getMaxIvaratorResults() { return maxIvaratorResults; } @@ -1687,6 +1768,7 @@ public void setMaxIvaratorResults(long maxIvaratorResults) { this.maxIvaratorResults = maxIvaratorResults; } + @Override public int getMaxIvaratorTerms() { return maxIvaratorTerms; } @@ -1695,6 +1777,7 @@ public void setMaxIvaratorTerms(int maxIvaratorTerms) { this.maxIvaratorTerms = maxIvaratorTerms; } + @Override public int getMaxEvaluationPipelines() { return maxEvaluationPipelines; } @@ -1703,6 +1786,7 @@ public void setMaxEvaluationPipelines(int maxEvaluationPipelines) { this.maxEvaluationPipelines = maxEvaluationPipelines; } + @Override public int getMaxPipelineCachedResults() { return maxPipelineCachedResults; } @@ -1711,6 +1795,7 @@ public void setMaxPipelineCachedResults(int maxCachedResults) { this.maxPipelineCachedResults = maxCachedResults; } + @Override public boolean isExpandAllTerms() { return expandAllTerms; } @@ -1724,6 +1809,7 @@ public void setExpandAllTerms(boolean expandAllTerms) { * * @return FIELDNAME1:normalizer.class;FIELDNAME2:normalizer.class; */ + @Override public String getIndexedFieldDataTypesAsString() { if (null == this.getIndexedFields() || this.getIndexedFields().isEmpty()) { @@ -1760,6 +1846,7 @@ public String getNormalizedFieldNormalizersAsString() { return sb.toString(); } + @Override public Set getIndexedFields() { return indexedFields; } @@ -1772,6 +1859,7 @@ public void setIndexedFields(Set indexedFields) { this.indexedFields = (null == indexedFields) ? Collections.emptySet() : Sets.newHashSet(indexedFields); } + @Override public Set getReverseIndexedFields() { return reverseIndexedFields; } @@ -1784,6 +1872,7 @@ public void setReverseIndexedFields(Set reverseIndexedFields) { this.reverseIndexedFields = reverseIndexedFields == null ? new HashSet<>() : Sets.newHashSet(reverseIndexedFields); } + @Override public Set getNormalizedFields() { return normalizedFields; } @@ -1792,6 +1881,7 @@ public void setNormalizedFields(Set normalizedFields) { this.normalizedFields = normalizedFields; } + @Override public Multimap> getDataTypes() { if (dataTypes == null) { dataTypes = HashMultimap.create(); @@ -1808,6 +1898,7 @@ public void setDataTypes(Multimap> dataTypes) { this.dataTypes = dataTypes; } + @Override public Multimap> getQueryFieldsDatatypes() { return queryFieldsDatatypes; } @@ -1816,6 +1907,7 @@ public void setQueryFieldsDatatypes(Multimap> queryFieldsDatatype this.queryFieldsDatatypes = queryFieldsDatatypes; } + @Override public Map> getFieldToDiscreteIndexTypes() { return fieldToDiscreteIndexTypes; } @@ -1824,6 +1916,7 @@ public void setFieldToDiscreteIndexTypes(Map> fieldT this.fieldToDiscreteIndexTypes = fieldToDiscreteIndexTypes; } + @Override public Multimap getCompositeToFieldMap() { return compositeToFieldMap; } @@ -1832,6 +1925,7 @@ public void setCompositeToFieldMap(Multimap compositeToFieldMap) this.compositeToFieldMap = compositeToFieldMap; } + @Override public Map getCompositeTransitionDates() { return compositeTransitionDates; } @@ -1840,6 +1934,7 @@ public void setCompositeTransitionDates(Map compositeTransitionDate this.compositeTransitionDates = compositeTransitionDates; } + @Override public Map getCompositeFieldSeparators() { return compositeFieldSeparators; } @@ -1848,6 +1943,7 @@ public void setCompositeFieldSeparators(Map compositeFieldSeparat this.compositeFieldSeparators = compositeFieldSeparators; } + @Override public Map getWhindexCreationDates() { return whindexCreationDates; } @@ -1856,6 +1952,7 @@ public void setWhindexCreationDates(Map whindexCreationDates) { this.whindexCreationDates = whindexCreationDates; } + @Override public Multimap> getNormalizedFieldsDatatypes() { return normalizedFieldsDatatypes; } @@ -1865,6 +1962,7 @@ public void setNormalizedFieldsDatatypes(Multimap> normalizedFiel this.normalizedFields = Sets.newHashSet(this.normalizedFieldsDatatypes.keySet()); } + @Override public Set getLimitFields() { return limitFields; } @@ -1873,10 +1971,12 @@ public void setLimitFields(Set limitFields) { this.limitFields = deconstruct(limitFields); } + @Override public String getLimitFieldsAsString() { return StringUtils.join(this.getLimitFields(), Constants.PARAM_VALUE_SEP); } + @Override public Set getMatchingFieldSets() { return matchingFieldSets; } @@ -1885,10 +1985,12 @@ public void setMatchingFieldSets(Set matchingFieldSets) { this.matchingFieldSets = matchingFieldSets; } + @Override public String getMatchingFieldSetsAsString() { return StringUtils.join(this.getMatchingFieldSets(), Constants.PARAM_VALUE_SEP); } + @Override public boolean isLimitFieldsPreQueryEvaluation() { return limitFieldsPreQueryEvaluation; } @@ -1897,6 +1999,7 @@ public void setLimitFieldsPreQueryEvaluation(boolean limitFieldsPreQueryEvaluati this.limitFieldsPreQueryEvaluation = limitFieldsPreQueryEvaluation; } + @Override public String getLimitFieldsField() { return limitFieldsField; } @@ -1905,6 +2008,7 @@ public void setLimitFieldsField(String limitFieldsField) { this.limitFieldsField = limitFieldsField; } + @Override public boolean isDateIndexTimeTravel() { return dateIndexTimeTravel; } @@ -1913,6 +2017,7 @@ public void setDateIndexTimeTravel(boolean dateIndexTimeTravel) { this.dateIndexTimeTravel = dateIndexTimeTravel; } + @Override public boolean isDateIndexIterator() { return dateIndexIterator; } @@ -1921,6 +2026,7 @@ public void setDateIndexIterator(boolean dateIndexIterator) { this.dateIndexIterator = dateIndexIterator; } + @Override public boolean getIgnoreNonExistentFields() { return ignoreNonExistentFields; } @@ -1929,6 +2035,7 @@ public void setIgnoreNonExistentFields(boolean ignoreNonExistentFields) { this.ignoreNonExistentFields = ignoreNonExistentFields; } + @Override public long getBeginDateCap() { return beginDateCap; } @@ -1937,6 +2044,7 @@ public void setBeginDateCap(long beginDateCap) { this.beginDateCap = beginDateCap; } + @Override public boolean isFailOutsideValidDateRange() { return failOutsideValidDateRange; } @@ -1945,6 +2053,7 @@ public void setFailOutsideValidDateRange(boolean failOutsideValidDateRange) { this.failOutsideValidDateRange = failOutsideValidDateRange; } + @Override public int getGroupFieldsBatchSize() { return groupFieldsBatchSize; } @@ -1953,10 +2062,12 @@ public void setGroupFieldsBatchSize(int groupFieldsBatchSize) { this.groupFieldsBatchSize = groupFieldsBatchSize; } + @Override public String getGroupFieldsBatchSizeAsString() { return "" + groupFieldsBatchSize; } + @Override public boolean isDisableIteratorUniqueFields() { return disableIteratorUniqueFields; } @@ -1965,6 +2076,7 @@ public void setDisableIteratorUniqueFields(boolean disableIteratorUniqueFields) this.disableIteratorUniqueFields = disableIteratorUniqueFields; } + @Override public UniqueFields getUniqueFields() { return uniqueFields; } @@ -1973,6 +2085,7 @@ public void setUniqueFields(UniqueFields uniqueFields) { this.uniqueFields = uniqueFields.clone(); } + @Override public boolean isHitList() { return this.hitList; } @@ -1981,6 +2094,7 @@ public void setHitList(boolean hitList) { this.hitList = hitList; } + @Override public boolean isRawTypes() { return this.rawTypes; } @@ -1989,6 +2103,7 @@ public void setRawTypes(boolean rawTypes) { this.rawTypes = rawTypes; } + @Override public double getMinSelectivity() { return minSelectivity; } @@ -2012,6 +2127,7 @@ public boolean canRunQuery() { return true; } + @Override public boolean getFilterMaskedValues() { return filterMaskedValues; } @@ -2020,6 +2136,7 @@ public void setFilterMaskedValues(boolean filterMaskedValues) { this.filterMaskedValues = filterMaskedValues; } + @Override public boolean getIncludeDataTypeAsField() { return includeDataTypeAsField; } @@ -2028,6 +2145,7 @@ public void setIncludeDataTypeAsField(boolean includeDataTypeAsField) { this.includeDataTypeAsField = includeDataTypeAsField; } + @Override public boolean getIncludeRecordId() { return includeRecordId; } @@ -2036,6 +2154,7 @@ public void setIncludeRecordId(boolean includeRecordId) { this.includeRecordId = includeRecordId; } + @Override public boolean getIncludeHierarchyFields() { return includeHierarchyFields; } @@ -2044,6 +2163,7 @@ public void setIncludeHierarchyFields(boolean includeHierarchyFields) { this.includeHierarchyFields = includeHierarchyFields; } + @Override public Map getHierarchyFieldOptions() { return this.hierarchyFieldOptions; } @@ -2053,6 +2173,7 @@ public void setHierarchyFieldOptions(final Map options) { this.hierarchyFieldOptions = (null != options) ? options : emptyOptions; } + @Override public boolean getIncludeGroupingContext() { return includeGroupingContext; } @@ -2061,6 +2182,7 @@ public void setIncludeGroupingContext(boolean withContextOption) { this.includeGroupingContext = withContextOption; } + @Override public List getDocumentPermutations() { return documentPermutations; } @@ -2081,6 +2203,7 @@ public void setDocumentPermutations(List documentPermutations) { this.documentPermutations = permutations; } + @Override public boolean isReducedResponse() { return reducedResponse; } @@ -2089,6 +2212,7 @@ public void setReducedResponse(boolean reducedResponse) { this.reducedResponse = reducedResponse; } + @Override public boolean isDisableEvaluation() { return disableEvaluation; } @@ -2097,6 +2221,7 @@ public void setDisableEvaluation(boolean disableEvaluation) { this.disableEvaluation = disableEvaluation; } + @Override public boolean isDisableIndexOnlyDocuments() { return disableIndexOnlyDocuments; } @@ -2105,6 +2230,7 @@ public void setDisableIndexOnlyDocuments(boolean disableIndexOnlyDocuments) { this.disableIndexOnlyDocuments = disableIndexOnlyDocuments; } + @Override public boolean isContainsIndexOnlyTerms() { return containsIndexOnlyTerms; } @@ -2113,6 +2239,7 @@ public void setContainsIndexOnlyTerms(boolean containsIndexOnlyTerms) { this.containsIndexOnlyTerms = containsIndexOnlyTerms; } + @Override public boolean isContainsCompositeTerms() { return containsCompositeTerms; } @@ -2121,6 +2248,7 @@ public void setContainsCompositeTerms(boolean containsCompositeTerms) { this.containsCompositeTerms = containsCompositeTerms; } + @Override public boolean isAllowFieldIndexEvaluation() { return allowFieldIndexEvaluation; } @@ -2129,6 +2257,7 @@ public void setAllowFieldIndexEvaluation(boolean allowFieldIndexEvaluation) { this.allowFieldIndexEvaluation = allowFieldIndexEvaluation; } + @Override public boolean isAllowTermFrequencyLookup() { return allowTermFrequencyLookup; } @@ -2137,6 +2266,7 @@ public void setAllowTermFrequencyLookup(boolean allowTermFrequencyLookup) { this.allowTermFrequencyLookup = allowTermFrequencyLookup; } + @Override public boolean isExpandUnfieldedNegations() { return expandUnfieldedNegations; } @@ -2145,6 +2275,7 @@ public void setExpandUnfieldedNegations(boolean expandUnfieldedNegations) { this.expandUnfieldedNegations = expandUnfieldedNegations; } + @Override public boolean isAllTermsIndexOnly() { return allTermsIndexOnly; } @@ -2153,6 +2284,7 @@ public void setAllTermsIndexOnly(boolean allTermsIndexOnly) { this.allTermsIndexOnly = allTermsIndexOnly; } + @Override public QueryModel getQueryModel() { return queryModel; } @@ -2161,6 +2293,7 @@ public void setQueryModel(QueryModel queryModel) { this.queryModel = queryModel; } + @Override public String getModelName() { return modelName; } @@ -2169,6 +2302,7 @@ public void setModelName(String modelName) { this.modelName = modelName; } + @Override public String getModelTableName() { return modelTableName; } @@ -2177,6 +2311,7 @@ public void setModelTableName(String modelTableName) { this.modelTableName = modelTableName; } + @Override public ReturnType getReturnType() { return returnType; } @@ -2185,6 +2320,7 @@ public void setReturnType(ReturnType returnType) { this.returnType = returnType; } + @Override public QueryStopwatch getTimers() { return timers; } @@ -2197,6 +2333,7 @@ public void appendTimers(QueryStopwatch timers) { this.timers.appendTimers(timers); } + @Override public ASTJexlScript getQueryTree() { return queryTree; } @@ -2220,6 +2357,7 @@ public String getQueryString() { return super.getQueryString(); } + @Override public boolean isCompressServerSideResults() { return compressServerSideResults; } @@ -2234,6 +2372,7 @@ public void setCompressServerSideResults(boolean compressServerSideResults) { * * @return true, if index-only filter functions should be enabled. */ + @Override public boolean isIndexOnlyFilterFunctionsEnabled() { return this.indexOnlyFilterFunctionsEnabled; } @@ -2249,6 +2388,7 @@ public void setIndexOnlyFilterFunctionsEnabled(boolean enabled) { this.indexOnlyFilterFunctionsEnabled = enabled; } + @Override public boolean isCompositeFilterFunctionsEnabled() { return compositeFilterFunctionsEnabled; } @@ -2257,6 +2397,7 @@ public void setCompositeFilterFunctionsEnabled(boolean compositeFilterFunctionsE this.compositeFilterFunctionsEnabled = compositeFilterFunctionsEnabled; } + @Override public List getRealmSuffixExclusionPatterns() { return realmSuffixExclusionPatterns; } @@ -2265,6 +2406,7 @@ public void setRealmSuffixExclusionPatterns(List realmSuffixExclusionPat this.realmSuffixExclusionPatterns = realmSuffixExclusionPatterns; } + @Override public Set getQueryTermFrequencyFields() { return queryTermFrequencyFields; } @@ -2273,6 +2415,7 @@ public void setQueryTermFrequencyFields(Set queryTermFrequencyFields) { this.queryTermFrequencyFields = deconstruct(queryTermFrequencyFields); } + @Override public boolean isTermFrequenciesRequired() { return termFrequenciesRequired; } @@ -2285,10 +2428,12 @@ public void setLimitTermExpansionToModel(boolean shouldLimitTermExpansionToModel this.shouldLimitTermExpansionToModel = shouldLimitTermExpansionToModel; } + @Override public boolean isLimitTermExpansionToModel() { return shouldLimitTermExpansionToModel; } + @Override public long getMaxIndexScanTimeMillis() { return maxIndexScanTimeMillis; } @@ -2297,6 +2442,7 @@ public void setMaxIndexScanTimeMillis(long maxTime) { this.maxIndexScanTimeMillis = maxTime; } + @Override public boolean getParseTldUids() { return parseTldUids; } @@ -2305,6 +2451,7 @@ public void setParseTldUids(boolean parseTldUids) { this.parseTldUids = parseTldUids; } + @Override public boolean getCollapseUids() { return collapseUids; } @@ -2313,6 +2460,7 @@ public void setCollapseUids(boolean collapseUids) { this.collapseUids = collapseUids; } + @Override public int getCollapseUidsThreshold() { return collapseUidsThreshold; } @@ -2321,6 +2469,7 @@ public void setCollapseUidsThreshold(int collapseUidsThreshold) { this.collapseUidsThreshold = collapseUidsThreshold; } + @Override public boolean getEnforceUniqueTermsWithinExpressions() { return enforceUniqueTermsWithinExpressions; } @@ -2329,6 +2478,7 @@ public void setEnforceUniqueTermsWithinExpressions(boolean enforceUniqueTermsWit this.enforceUniqueTermsWithinExpressions = enforceUniqueTermsWithinExpressions; } + @Override public boolean getPruneQueryByIngestTypes() { return pruneQueryByIngestTypes; } @@ -2337,6 +2487,7 @@ public void setPruneQueryByIngestTypes(boolean pruneQueryByIngestTypes) { this.pruneQueryByIngestTypes = pruneQueryByIngestTypes; } + @Override public boolean getReduceQueryFields() { return reduceQueryFields; } @@ -2345,6 +2496,7 @@ public void setReduceQueryFields(boolean reduceQueryFields) { this.reduceQueryFields = reduceQueryFields; } + @Override public boolean getReduceQueryFieldsPerShard() { return reduceQueryFieldsPerShard; } @@ -2353,6 +2505,7 @@ public void setReduceQueryFieldsPerShard(boolean reduceQueryFieldsPerShard) { this.reduceQueryFieldsPerShard = reduceQueryFieldsPerShard; } + @Override public boolean getReduceTypeMetadata() { return reduceTypeMetadata; } @@ -2361,6 +2514,7 @@ public void setReduceTypeMetadata(boolean reduceTypeMetadata) { this.reduceTypeMetadata = reduceTypeMetadata; } + @Override public boolean getReduceTypeMetadataPerShard() { return reduceTypeMetadataPerShard; } @@ -2369,6 +2523,7 @@ public void setReduceTypeMetadataPerShard(boolean reduceTypeMetadataPerShard) { this.reduceTypeMetadataPerShard = reduceTypeMetadataPerShard; } + @Override public boolean getLimitAnyFieldLookups() { return limitAnyFieldLookups; } @@ -2377,6 +2532,7 @@ public void setLimitAnyFieldLookups(boolean limitAnyFieldLookups) { this.limitAnyFieldLookups = limitAnyFieldLookups; } + @Override public boolean getAllowShortcutEvaluation() { return allowShortcutEvaluation; } @@ -2385,6 +2541,7 @@ public void setAllowShortcutEvaluation(boolean allowShortcutEvaluation) { this.allowShortcutEvaluation = allowShortcutEvaluation; } + @Override public boolean getAccrueStats() { return accrueStats; } @@ -2394,6 +2551,7 @@ public void setAccrueStats(boolean accrueStats) { } + @Override public List getIndexValueHoles() { return indexValueHoles; } @@ -2402,6 +2560,7 @@ public void setIndexValueHoles(List indexValueHoles) { this.indexValueHoles = indexValueHoles; } + @Override public boolean getCollectTimingDetails() { return collectTimingDetails; } @@ -2411,6 +2570,7 @@ public void setCollectTimingDetails(boolean collectTimingDetails) { } + @Override public boolean getLogTimingDetails() { return logTimingDetails; } @@ -2419,6 +2579,7 @@ public void setLogTimingDetails(boolean logTimingDetails) { this.logTimingDetails = logTimingDetails; } + @Override public String getStatsdHost() { return statsdHost; } @@ -2427,6 +2588,7 @@ public void setStatsdHost(String statsdHost) { this.statsdHost = statsdHost; } + @Override public int getStatsdPort() { return statsdPort; } @@ -2435,6 +2597,7 @@ public void setStatsdPort(int statsdPort) { this.statsdPort = statsdPort; } + @Override public int getStatsdMaxQueueSize() { return statsdMaxQueueSize; } @@ -2443,6 +2606,7 @@ public void setStatsdMaxQueueSize(int statsdMaxQueueSize) { this.statsdMaxQueueSize = statsdMaxQueueSize; } + @Override public boolean getSendTimingToStatsd() { return sendTimingToStatsd; } @@ -2451,6 +2615,7 @@ public void setSendTimingToStatsd(boolean sendTimingToStatsd) { this.sendTimingToStatsd = sendTimingToStatsd; } + @Override public boolean isCleanupShardsAndDaysQueryHints() { return cleanupShardsAndDaysQueryHints; } @@ -2459,6 +2624,7 @@ public void setCleanupShardsAndDaysQueryHints(boolean cleanupShardsAndDaysQueryH this.cleanupShardsAndDaysQueryHints = cleanupShardsAndDaysQueryHints; } + @Override public AtomicInteger getFstCount() { return fstCount; } @@ -2467,6 +2633,7 @@ public void setFstCount(AtomicInteger fstCount) { this.fstCount = fstCount; } + @Override public boolean getCacheModel() { return cacheModel; } @@ -2475,6 +2642,7 @@ public void setCacheModel(boolean cacheModel) { this.cacheModel = cacheModel; } + @Override public boolean isBypassExecutabilityCheck() { return bypassExecutabilityCheck; } @@ -2487,6 +2655,7 @@ public void setBypassExecutabilityCheck(boolean bypassExecutabilityCheck) { this.bypassExecutabilityCheck = bypassExecutabilityCheck; } + @Override public boolean getBackoffEnabled() { return backoffEnabled; } @@ -2495,6 +2664,7 @@ public void setBackoffEnabled(boolean backoffEnabled) { this.backoffEnabled = backoffEnabled; } + @Override public boolean getUnsortedUIDsEnabled() { return unsortedUIDsEnabled; } @@ -2503,6 +2673,7 @@ public void setUnsortedUIDsEnabled(boolean unsortedUIDsEnabled) { this.unsortedUIDsEnabled = unsortedUIDsEnabled; } + @Override public boolean getSpeculativeScanning() { return speculativeScanning; } @@ -2511,6 +2682,7 @@ public void setSpeculativeScanning(boolean speculativeScanning) { this.speculativeScanning = speculativeScanning; } + @Override public boolean getSerializeQueryIterator() { return serializeQueryIterator; } @@ -2519,6 +2691,7 @@ public void setSerializeQueryIterator(boolean serializeQueryIterator) { this.serializeQueryIterator = serializeQueryIterator; } + @Override public boolean isSortedUIDs() { return sortedUIDs; } @@ -2527,6 +2700,7 @@ public void setSortedUIDs(boolean sortedUIDs) { this.sortedUIDs = sortedUIDs; } + @Override public long getYieldThresholdMs() { return yieldThresholdMs; } @@ -2535,6 +2709,7 @@ public void setYieldThresholdMs(long yieldThresholdMs) { this.yieldThresholdMs = yieldThresholdMs; } + @Override public boolean isTrackSizes() { return trackSizes; } @@ -2543,6 +2718,7 @@ public void setTrackSizes(boolean trackSizes) { this.trackSizes = trackSizes; } + @Override public List getContentFieldNames() { return contentFieldNames; } @@ -2555,10 +2731,12 @@ public void setEvaluationOnlyFields(Set evaluationOnlyFields) { this.evaluationOnlyFields = evaluationOnlyFields; } + @Override public Set getEvaluationOnlyFields() { return this.evaluationOnlyFields; } + @Override public Set getDisallowedRegexPatterns() { return disallowedRegexPatterns; } @@ -2567,6 +2745,7 @@ public void setDisallowedRegexPatterns(Set disallowedRegexPatterns) { this.disallowedRegexPatterns = disallowedRegexPatterns; } + @Override public String getActiveQueryLogNameSource() { return activeQueryLogNameSource; } @@ -2585,6 +2764,7 @@ public void setActiveQueryLogNameSource(String activeQueryLogNameSource) { * * @return the custom active query name to use, or a blank value if the default active query log should be used */ + @Override public String getActiveQueryLogName() { if (activeQueryLogNameSource == null) { return ""; @@ -2599,6 +2779,7 @@ public String getActiveQueryLogName() { } } + @Override public boolean isDisableWhindexFieldMappings() { return disableWhindexFieldMappings; } @@ -2607,6 +2788,7 @@ public void setDisableWhindexFieldMappings(boolean disableWhindexFieldMappings) this.disableWhindexFieldMappings = disableWhindexFieldMappings; } + @Override public Set getWhindexMappingFields() { return whindexMappingFields; } @@ -2615,6 +2797,7 @@ public void setWhindexMappingFields(Set whindexMappingFields) { this.whindexMappingFields = whindexMappingFields; } + @Override public Map> getWhindexFieldMappings() { return whindexFieldMappings; } @@ -2623,6 +2806,7 @@ public void setWhindexFieldMappings(Map> whindexFieldM this.whindexFieldMappings = whindexFieldMappings; } + @Override public boolean isGeneratePlanOnly() { return generatePlanOnly; } @@ -2631,6 +2815,7 @@ public void setGeneratePlanOnly(boolean generatePlanOnly) { this.generatePlanOnly = generatePlanOnly; } + @Override public boolean getEnforceUniqueConjunctionsWithinExpression() { return enforceUniqueConjunctionsWithinExpression; } @@ -2639,6 +2824,7 @@ public void setEnforceUniqueConjunctionsWithinExpression(boolean enforceUniqueCo this.enforceUniqueConjunctionsWithinExpression = enforceUniqueConjunctionsWithinExpression; } + @Override public boolean getEnforceUniqueDisjunctionsWithinExpression() { return enforceUniqueDisjunctionsWithinExpression; } @@ -2647,6 +2833,7 @@ public void setEnforceUniqueDisjunctionsWithinExpression(boolean enforceUniqueDi this.enforceUniqueDisjunctionsWithinExpression = enforceUniqueDisjunctionsWithinExpression; } + @Override public BloomFilter getBloom() { return bloom; } @@ -2655,6 +2842,7 @@ public void setBloom(BloomFilter bloom) { this.bloom = bloom; } + @Override public Set getNoExpansionFields() { return this.noExpansionFields; } @@ -2663,6 +2851,7 @@ public void setNoExpansionFields(Set noExpansionFields) { this.noExpansionFields = noExpansionFields; } + @Override public Set getLenientFields() { return lenientFields; } @@ -2671,6 +2860,7 @@ public void setLenientFields(Set lenientFields) { this.lenientFields = lenientFields; } + @Override public Set getStrictFields() { return strictFields; } @@ -2679,6 +2869,7 @@ public void setStrictFields(Set strictFields) { this.strictFields = strictFields; } + @Override public ExcerptFields getExcerptFields() { return excerptFields; } @@ -2690,6 +2881,7 @@ public void setExcerptFields(ExcerptFields excerptFields) { this.excerptFields = excerptFields; } + @Override public Class> getExcerptIterator() { return excerptIterator; } @@ -2698,6 +2890,7 @@ public void setExcerptIterator(Class this.excerptIterator = excerptIterator; } + @Override public SummaryOptions getSummaryOptions() { return summaryOptions; } @@ -2708,6 +2901,7 @@ public void setSummaryOptions(SummaryOptions summaryOptions) { } } + @Override public Class> getSummaryIterator() { return summaryIterator; } @@ -2716,6 +2910,7 @@ public void setSummaryIterator(Class this.summaryIterator = summaryIterator; } + @Override public String getSummaryFieldName() { return summaryFieldName; } @@ -2724,6 +2919,7 @@ public void setSummaryFieldName(String summaryFieldName) { this.summaryFieldName = summaryFieldName; } + @Override public int getFiFieldSeek() { return fiFieldSeek; } @@ -2732,6 +2928,7 @@ public void setFiFieldSeek(int fiFieldSeek) { this.fiFieldSeek = fiFieldSeek; } + @Override public int getFiNextSeek() { return fiNextSeek; } @@ -2740,6 +2937,7 @@ public void setFiNextSeek(int fiNextSeek) { this.fiNextSeek = fiNextSeek; } + @Override public int getEventFieldSeek() { return eventFieldSeek; } @@ -2748,6 +2946,7 @@ public void setEventFieldSeek(int eventFieldSeek) { this.eventFieldSeek = eventFieldSeek; } + @Override public int getEventNextSeek() { return eventNextSeek; } @@ -2756,6 +2955,7 @@ public void setEventNextSeek(int eventNextSeek) { this.eventNextSeek = eventNextSeek; } + @Override public int getTfFieldSeek() { return tfFieldSeek; } @@ -2764,6 +2964,7 @@ public void setTfFieldSeek(int tfFieldSeek) { this.tfFieldSeek = tfFieldSeek; } + @Override public int getTfNextSeek() { return tfNextSeek; } @@ -2772,6 +2973,7 @@ public void setTfNextSeek(int tfNextSeek) { this.tfNextSeek = tfNextSeek; } + @Override public boolean isSeekingEventAggregation() { return seekingEventAggregation; } @@ -2780,6 +2982,7 @@ public void setSeekingEventAggregation(boolean seekingEventAggregation) { this.seekingEventAggregation = seekingEventAggregation; } + @Override public long getVisitorFunctionMaxWeight() { return visitorFunctionMaxWeight; } @@ -2792,10 +2995,12 @@ public void setQueryExecutionForPageTimeout(long queryExecutionForPageTimeout) { this.queryExecutionForPageTimeout = queryExecutionForPageTimeout; } + @Override public long getQueryExecutionForPageTimeout() { return this.queryExecutionForPageTimeout; } + @Override public boolean isLazySetMechanismEnabled() { return lazySetMechanismEnabled; } @@ -2804,6 +3009,7 @@ public void setLazySetMechanismEnabled(boolean lazySetMechanismEnabled) { this.lazySetMechanismEnabled = lazySetMechanismEnabled; } + @Override public int getDocAggregationThresholdMs() { return docAggregationThresholdMs; } @@ -2812,6 +3018,7 @@ public void setDocAggregationThresholdMs(int docAggregationThresholdMs) { this.docAggregationThresholdMs = docAggregationThresholdMs; } + @Override public int getTfAggregationThresholdMs() { return tfAggregationThresholdMs; } @@ -2820,6 +3027,7 @@ public void setTfAggregationThresholdMs(int tfAggregationThresholdMs) { this.tfAggregationThresholdMs = tfAggregationThresholdMs; } + @Override public GroupFields getGroupFields() { return groupFields; } @@ -2832,6 +3040,7 @@ public void setGroupFields(GroupFields groupFields) { } } + @Override public boolean getPruneQueryOptions() { return pruneQueryOptions; } @@ -2840,6 +3049,7 @@ public void setPruneQueryOptions(boolean pruneQueryOptions) { this.pruneQueryOptions = pruneQueryOptions; } + @Override public boolean isRebuildDatatypeFilter() { return rebuildDatatypeFilter; } @@ -2848,6 +3058,7 @@ public void setRebuildDatatypeFilter(boolean rebuildDatatypeFilter) { this.rebuildDatatypeFilter = rebuildDatatypeFilter; } + @Override public boolean isRebuildDatatypeFilterPerShard() { return rebuildDatatypeFilterPerShard; } @@ -2856,6 +3067,7 @@ public void setRebuildDatatypeFilterPerShard(boolean rebuildDatatypeFilterPerSha this.rebuildDatatypeFilterPerShard = rebuildDatatypeFilterPerShard; } + @Override public double getIndexFieldHoleMinThreshold() { return indexFieldHoleMinThreshold; } @@ -2864,6 +3076,7 @@ public void setIndexFieldHoleMinThreshold(double indexFieldHoleMinThreshold) { this.indexFieldHoleMinThreshold = indexFieldHoleMinThreshold; } + @Override public boolean getReduceIngestTypes() { return reduceIngestTypes; } @@ -2872,6 +3085,7 @@ public void setReduceIngestTypes(boolean reduceIngestTypes) { this.reduceIngestTypes = reduceIngestTypes; } + @Override public boolean getReduceIngestTypesPerShard() { return reduceIngestTypesPerShard; } @@ -2880,6 +3094,7 @@ public void setReduceIngestTypesPerShard(boolean reduceIngestTypesPerShard) { this.reduceIngestTypesPerShard = reduceIngestTypesPerShard; } + @Override public boolean isSortQueryPreIndexWithImpliedCounts() { return sortQueryPreIndexWithImpliedCounts; } @@ -2888,6 +3103,7 @@ public void setSortQueryPreIndexWithImpliedCounts(boolean sortQueryPreIndexWithI this.sortQueryPreIndexWithImpliedCounts = sortQueryPreIndexWithImpliedCounts; } + @Override public boolean isSortQueryPreIndexWithFieldCounts() { return sortQueryPreIndexWithFieldCounts; } @@ -2896,6 +3112,7 @@ public void setSortQueryPreIndexWithFieldCounts(boolean sortQueryPreIndexWithFie this.sortQueryPreIndexWithFieldCounts = sortQueryPreIndexWithFieldCounts; } + @Override public boolean isSortQueryPostIndexWithFieldCounts() { return sortQueryPostIndexWithFieldCounts; } @@ -2904,6 +3121,7 @@ public void setSortQueryPostIndexWithFieldCounts(boolean sortQueryPostIndexWithF this.sortQueryPostIndexWithFieldCounts = sortQueryPostIndexWithFieldCounts; } + @Override public boolean isSortQueryPostIndexWithTermCounts() { return sortQueryPostIndexWithTermCounts; } @@ -2912,6 +3130,7 @@ public void setSortQueryPostIndexWithTermCounts(boolean sortQueryPostIndexWithTe this.sortQueryPostIndexWithTermCounts = sortQueryPostIndexWithTermCounts; } + @Override public int getCardinalityThreshold() { return cardinalityThreshold; } @@ -3357,6 +3576,7 @@ protected Object readResolve() throws ObjectStreamException { return this; } + @Override public boolean isUseQueryTreeScanHintRules() { return useQueryTreeScanHintRules; } @@ -3365,6 +3585,7 @@ public void setUseQueryTreeScanHintRules(boolean useQueryTreeScanHintRules) { this.useQueryTreeScanHintRules = useQueryTreeScanHintRules; } + @Override public List> getQueryTreeScanHintRules() { return queryTreeScanHintRules; } @@ -3373,6 +3594,7 @@ public void setQueryTreeScanHintRules(List> queryTreeScan this.queryTreeScanHintRules = queryTreeScanHintRules; } + @Override public long getMaxAnyFieldScanTimeMillis() { return maxAnyFieldScanTimeMillis; } @@ -3381,6 +3603,7 @@ public void setMaxAnyFieldScanTimeMillis(long maxAnyFieldScanTimeMillis) { this.maxAnyFieldScanTimeMillis = maxAnyFieldScanTimeMillis; } + @Override public Set getNoExpansionIfCurrentDateTypes() { return noExpansionIfCurrentDateTypes; } @@ -3389,6 +3612,7 @@ public void setNoExpansionIfCurrentDateTypes(Set noExpansionIfCurrentDat this.noExpansionIfCurrentDateTypes = noExpansionIfCurrentDateTypes; } + @Override public DocumentScannerConfig getDocumentScannerConfig() { return documentScannerConfig; } @@ -3397,6 +3621,7 @@ public void setDocumentScannerConfig(DocumentScannerConfig documentScannerConfig this.documentScannerConfig = documentScannerConfig; } + @Override public boolean isUseDocumentScheduler() { return useDocumentScheduler; } @@ -3405,6 +3630,7 @@ public void setUseDocumentScheduler(boolean useDocumentScheduler) { this.useDocumentScheduler = useDocumentScheduler; } + @Override public int getMaxLinesToPrint() { return maxLinesToPrint; } diff --git a/warehouse/query-core/src/main/java/datawave/query/index/lookup/IndexInfo.java b/warehouse/query-core/src/main/java/datawave/query/index/lookup/IndexInfo.java index 24fb7b0631b..544485b45bc 100644 --- a/warehouse/query-core/src/main/java/datawave/query/index/lookup/IndexInfo.java +++ b/warehouse/query-core/src/main/java/datawave/query/index/lookup/IndexInfo.java @@ -34,7 +34,6 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Sets; -import datawave.query.config.ShardQueryConfiguration; import datawave.query.jexl.JexlNodeFactory; import datawave.query.jexl.nodes.QueryPropertyMarker; import datawave.query.jexl.visitors.RebuildingVisitor; @@ -565,7 +564,7 @@ public String toString() { /** * An infinite range is one that datawave created. This can happen several ways *
    - *
  1. {@link RangeStream#createFullFieldIndexScanList(ShardQueryConfiguration, JexlNode)}
  2. + *
  3. {@link RangeStream#createFullFieldIndexScanList(ImmutableShardQueryConfiguration, JexlNode)}
  4. *
  5. {@link RangeStream#createIndexScanList(String[])}
  6. *
  7. {@link ShardLimitingIterator#next()}
  8. *
  9. {@link Union} of all delayed terms
  10. diff --git a/warehouse/query-core/src/main/java/datawave/query/index/lookup/RangeStream.java b/warehouse/query-core/src/main/java/datawave/query/index/lookup/RangeStream.java index c0ef46cc987..594a0e17f03 100644 --- a/warehouse/query-core/src/main/java/datawave/query/index/lookup/RangeStream.java +++ b/warehouse/query-core/src/main/java/datawave/query/index/lookup/RangeStream.java @@ -78,7 +78,7 @@ import datawave.ingest.mapreduce.handler.shard.NumShards; import datawave.query.CloseableIterable; import datawave.query.Constants; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.exceptions.DatawaveFatalQueryException; import datawave.query.index.lookup.IndexStream.StreamContext; import datawave.query.iterator.QueryOptions; @@ -117,7 +117,7 @@ public class RangeStream extends BaseVisitor implements CloseableIterable itr; @@ -155,7 +155,7 @@ public class RangeStream extends BaseVisitor implements CloseableIterable ctx) { * @return The list of index info ranges */ @Deprecated(forRemoval = true) - public static List> createFullFieldIndexScanList(ShardQueryConfiguration config, JexlNode node) { + public static List> createFullFieldIndexScanList(ImmutableShardQueryConfiguration config, JexlNode node) { List> list = new ArrayList<>(); Calendar start = getCalendarStartOfDay(config.getBeginDate()); diff --git a/warehouse/query-core/src/main/java/datawave/query/index/lookup/ShardRangeStream.java b/warehouse/query-core/src/main/java/datawave/query/index/lookup/ShardRangeStream.java index 24372e784c7..2a4dd02d47c 100644 --- a/warehouse/query-core/src/main/java/datawave/query/index/lookup/ShardRangeStream.java +++ b/warehouse/query-core/src/main/java/datawave/query/index/lookup/ShardRangeStream.java @@ -23,7 +23,7 @@ import datawave.data.type.Type; import datawave.query.CloseableIterable; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.index.lookup.IndexStream.StreamContext; import datawave.query.iterator.FieldIndexOnlyQueryIterator; import datawave.query.iterator.QueryOptions; @@ -37,7 +37,7 @@ public class ShardRangeStream extends RangeStream { - public ShardRangeStream(ShardQueryConfiguration config, ScannerFactory scanners, MetadataHelper helper) { + public ShardRangeStream(ImmutableShardQueryConfiguration config, ScannerFactory scanners, MetadataHelper helper) { super(config, scanners, helper); } @@ -135,7 +135,7 @@ public QueryPlan apply(Entry entry) { /** * Lift and shift from DefaultQueryPlanner to avoid reliance on static methods */ - private void configureTypeMappings(ShardQueryConfiguration config, IteratorSetting cfg, MetadataHelper metadataHelper) { + private void configureTypeMappings(ImmutableShardQueryConfiguration config, IteratorSetting cfg, MetadataHelper metadataHelper) { DefaultQueryPlanner.addOption(cfg, QueryOptions.QUERY_MAPPING_COMPRESS, Boolean.toString(true), false); Multimap> nonIndexedQueryFieldsDatatypes = HashMultimap.create(config.getQueryFieldsDatatypes()); diff --git a/warehouse/query-core/src/main/java/datawave/query/index/lookup/TupleToRange.java b/warehouse/query-core/src/main/java/datawave/query/index/lookup/TupleToRange.java index 5b3cf11e144..3ddd6dd66e2 100644 --- a/warehouse/query-core/src/main/java/datawave/query/index/lookup/TupleToRange.java +++ b/warehouse/query-core/src/main/java/datawave/query/index/lookup/TupleToRange.java @@ -11,7 +11,7 @@ import com.google.common.base.Function; import com.google.common.collect.Lists; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.jexl.visitors.JexlStringBuildingVisitor; import datawave.query.planner.QueryPlan; import datawave.query.ranges.RangeFactory; @@ -27,7 +27,7 @@ public class TupleToRange implements Function,Iterator< protected String tableName; protected JexlNode currentScript; protected JexlNode tree = null; - protected ShardQueryConfiguration config; + protected ImmutableShardQueryConfiguration config; /** * The constructor @@ -39,7 +39,7 @@ public class TupleToRange implements Function,Iterator< * @param config * a configuration */ - public TupleToRange(String tableName, JexlNode currentNode, ShardQueryConfiguration config) { + public TupleToRange(String tableName, JexlNode currentNode, ImmutableShardQueryConfiguration config) { this.tableName = tableName; this.currentScript = currentNode; this.config = config; diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/JexlASTHelper.java b/warehouse/query-core/src/main/java/datawave/query/jexl/JexlASTHelper.java index 5963b8840eb..ee402deaa0b 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/JexlASTHelper.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/JexlASTHelper.java @@ -68,7 +68,7 @@ import datawave.data.type.Type; import datawave.query.Constants; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.exceptions.DatawaveFatalQueryException; import datawave.query.index.lookup.RangeStream; import datawave.query.index.stats.IndexStatsClient; @@ -1830,7 +1830,7 @@ public static boolean isLiteralEquality(JexlNode node) { * query configuration * @return if it is indexed */ - public static boolean isIndexed(JexlNode node, ShardQueryConfiguration config) { + public static boolean isIndexed(JexlNode node, ImmutableShardQueryConfiguration config) { Preconditions.checkNotNull(config); final Multimap> indexedFieldsDatatypes = config.getQueryFieldsDatatypes(); @@ -1861,7 +1861,7 @@ public static boolean isIndexed(JexlNode node, ShardQueryConfiguration config) { * index stats client * @return the selectivity of the node's identifier */ - public static Double getNodeSelectivity(JexlNode node, ShardQueryConfiguration config, IndexStatsClient stats) { + public static Double getNodeSelectivity(JexlNode node, ImmutableShardQueryConfiguration config, IndexStatsClient stats) { List idents = getIdentifiers(node); // If there isn't one identifier you don't need to check the selectivity @@ -1883,7 +1883,7 @@ public static Double getNodeSelectivity(JexlNode node, ShardQueryConfiguration c * the IndexStatsClient * @return the selectivity of the node's identifier */ - public static Double getNodeSelectivity(Set fieldNames, ShardQueryConfiguration config, IndexStatsClient stats) { + public static Double getNodeSelectivity(Set fieldNames, ImmutableShardQueryConfiguration config, IndexStatsClient stats) { boolean foundSelectivity = false; diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/functions/ContentFunctionsDescriptor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/functions/ContentFunctionsDescriptor.java index a7c2e04b1fb..d4c011906ea 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/functions/ContentFunctionsDescriptor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/functions/ContentFunctionsDescriptor.java @@ -41,7 +41,7 @@ import com.google.common.collect.Streams; import datawave.query.attributes.AttributeFactory; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.exceptions.DatawaveFatalQueryException; import datawave.query.jexl.ArithmeticJexlEngines; import datawave.query.jexl.JexlASTHelper; @@ -79,7 +79,8 @@ public ContentJexlArgumentDescriptor(ASTFunctionNode node, String namespace, Str } @Override - public JexlNode getIndexQuery(ShardQueryConfiguration config, MetadataHelper helper, DateIndexHelper dateIndexHelper, Set datatypeFilter) { + public JexlNode getIndexQuery(ImmutableShardQueryConfiguration config, MetadataHelper helper, DateIndexHelper dateIndexHelper, + Set datatypeFilter) { try { Set tfFields = new HashSet<>(helper.getTermFrequencyFields(datatypeFilter)); Set indexedFields = new HashSet<>(helper.getIndexedFields(datatypeFilter)); diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/functions/EvaluationPhaseFilterFunctionsDescriptor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/functions/EvaluationPhaseFilterFunctionsDescriptor.java index 24e4445fc05..5519a670249 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/functions/EvaluationPhaseFilterFunctionsDescriptor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/functions/EvaluationPhaseFilterFunctionsDescriptor.java @@ -24,7 +24,7 @@ import datawave.query.Constants; import datawave.query.attributes.AttributeFactory; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.jexl.JexlASTHelper; import datawave.query.jexl.JexlNodeFactory; import datawave.query.jexl.functions.arguments.JexlArgumentDescriptor; @@ -75,7 +75,8 @@ public EvaluationPhaseFilterJexlArgumentDescriptor(ASTFunctionNode node) { * indexed values */ @Override - public JexlNode getIndexQuery(ShardQueryConfiguration config, MetadataHelper helper, DateIndexHelper dateIndexHelper, Set datatypeFilter) { + public JexlNode getIndexQuery(ImmutableShardQueryConfiguration config, MetadataHelper helper, DateIndexHelper dateIndexHelper, + Set datatypeFilter) { FunctionJexlNodeVisitor functionMetadata = new FunctionJexlNodeVisitor(); node.jjtAccept(functionMetadata, null); // in the special case of date functions and then only with the between methods, @@ -88,7 +89,7 @@ public JexlNode getIndexQuery(ShardQueryConfiguration config, MetadataHelper hel return TRUE_NODE; } - private JexlNode getShardsAndDaysQuery(FunctionJexlNodeVisitor functionMetadata, ShardQueryConfiguration config, MetadataHelper helper, + private JexlNode getShardsAndDaysQuery(FunctionJexlNodeVisitor functionMetadata, ImmutableShardQueryConfiguration config, MetadataHelper helper, DateIndexHelper dateIndexHelper, Set datatypeFilter) { try { List arguments = functionMetadata.args(); diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/functions/GeoFunctionsDescriptor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/functions/GeoFunctionsDescriptor.java index c49da90ac7f..43436873622 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/functions/GeoFunctionsDescriptor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/functions/GeoFunctionsDescriptor.java @@ -38,7 +38,7 @@ import datawave.data.type.GeoType; import datawave.data.type.Type; import datawave.query.attributes.AttributeFactory; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.jexl.ArithmeticJexlEngines; import datawave.query.jexl.JexlASTHelper; import datawave.query.jexl.JexlNodeFactory; @@ -85,7 +85,8 @@ public GeoJexlArgumentDescriptor(ASTFunctionNode node, String namespace, String } @Override - public JexlNode getIndexQuery(ShardQueryConfiguration config, MetadataHelper helper, DateIndexHelper dateIndexHelper, Set datatypeFilter) { + public JexlNode getIndexQuery(ImmutableShardQueryConfiguration config, MetadataHelper helper, DateIndexHelper dateIndexHelper, + Set datatypeFilter) { // return the true node if unable to parse arguments JexlNode returnNode = TRUE_NODE; @@ -377,7 +378,7 @@ public String getWkt() { } @Override - public JexlNode rebuildNode(ShardQueryConfiguration settings, MetadataHelper metadataHelper, DateIndexHelper dateIndexHelper, + public JexlNode rebuildNode(ImmutableShardQueryConfiguration settings, MetadataHelper metadataHelper, DateIndexHelper dateIndexHelper, Set datatypeFilter, ASTFunctionNode node) { try { diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/functions/GeoWaveFunctionsDescriptor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/functions/GeoWaveFunctionsDescriptor.java index 2238318c75d..d653bef6c43 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/functions/GeoWaveFunctionsDescriptor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/functions/GeoWaveFunctionsDescriptor.java @@ -42,7 +42,7 @@ import datawave.data.type.PointType; import datawave.data.type.Type; import datawave.query.attributes.AttributeFactory; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.jexl.ArithmeticJexlEngines; import datawave.query.jexl.JexlASTHelper; import datawave.query.jexl.JexlNodeFactory; @@ -85,7 +85,8 @@ public GeoWaveJexlArgumentDescriptor(ASTFunctionNode node, String name, List datatypeFilter) { + public JexlNode getIndexQuery(ImmutableShardQueryConfiguration config, MetadataHelper helper, DateIndexHelper dateIndexHelper, + Set datatypeFilter) { int maxEnvelopes = Math.max(1, config.getGeoWaveMaxEnvelopes()); if (isSpatialRelationship(name)) { Geometry geom = AbstractGeometryNormalizer.parseGeometry(JexlNodes.getIdentifierOrLiteralAsString(args.get(1))); @@ -130,7 +131,7 @@ private static IndexType typeToIndexType(Type type) { return indexType; } - protected static JexlNode getIndexNode(JexlNode node, Geometry geometry, Envelope env, ShardQueryConfiguration config, MetadataHelper helper) { + protected static JexlNode getIndexNode(JexlNode node, Geometry geometry, Envelope env, ImmutableShardQueryConfiguration config, MetadataHelper helper) { if (node.jjtGetNumChildren() > 0) { List list = Lists.newArrayList(); for (int i = 0; i < node.jjtGetNumChildren(); i++) { @@ -148,7 +149,8 @@ protected static JexlNode getIndexNode(JexlNode node, Geometry geometry, Envelop return node; } - protected static JexlNode getIndexNode(JexlNode node, Geometry geometry, List envs, ShardQueryConfiguration config, MetadataHelper helper) { + protected static JexlNode getIndexNode(JexlNode node, Geometry geometry, List envs, ImmutableShardQueryConfiguration config, + MetadataHelper helper) { if (node.jjtGetNumChildren() > 0) { List list = Lists.newArrayList(); for (int i = 0; i < node.jjtGetNumChildren(); i++) { @@ -166,13 +168,14 @@ protected static JexlNode getIndexNode(JexlNode node, Geometry geometry, List envs = new ArrayList<>(); envs.add(env); return getIndexNode(fieldName, geometry, envs, config, helper); } - protected static JexlNode getIndexNode(String fieldName, Geometry geometry, List envs, ShardQueryConfiguration config, + protected static JexlNode getIndexNode(String fieldName, Geometry geometry, List envs, ImmutableShardQueryConfiguration config, MetadataHelper helper) { List indexNodes = new ArrayList<>(); Set indexTypes = getIndexTypes(fieldName, helper); @@ -208,8 +211,8 @@ else if (indexTypes.remove(IndexType.GEO_POINT)) { return indexNode; } - protected static JexlNode generateGeoWaveRanges(String fieldName, Geometry geometry, List envs, ShardQueryConfiguration config, Index index, - int maxExpansion) { + protected static JexlNode generateGeoWaveRanges(String fieldName, Geometry geometry, List envs, ImmutableShardQueryConfiguration config, + Index index, int maxExpansion) { Collection allRanges = new ArrayList<>(); int maxRanges = maxExpansion / envs.size(); for (Envelope env : envs) { diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/functions/GroupingRequiredFilterFunctionsDescriptor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/functions/GroupingRequiredFilterFunctionsDescriptor.java index 3ab25fec08e..13f83925a7c 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/functions/GroupingRequiredFilterFunctionsDescriptor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/functions/GroupingRequiredFilterFunctionsDescriptor.java @@ -13,7 +13,7 @@ import com.google.common.collect.Sets; import datawave.query.attributes.AttributeFactory; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.jexl.JexlASTHelper; import datawave.query.jexl.functions.arguments.JexlArgumentDescriptor; import datawave.query.jexl.visitors.EventDataQueryExpressionVisitor; @@ -44,7 +44,8 @@ public GroupingRequiredFilterJexlArgumentDescriptor(ASTFunctionNode node) { * Returns 'true' because none of these functions should influence the index query. */ @Override - public JexlNode getIndexQuery(ShardQueryConfiguration config, MetadataHelper helper, DateIndexHelper dateIndexHelper, Set datatypeFilter) { + public JexlNode getIndexQuery(ImmutableShardQueryConfiguration config, MetadataHelper helper, DateIndexHelper dateIndexHelper, + Set datatypeFilter) { FunctionJexlNodeVisitor functionMetadata = new FunctionJexlNodeVisitor(); node.jjtAccept(functionMetadata, null); diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/functions/QueryFunctionsDescriptor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/functions/QueryFunctionsDescriptor.java index 753db43b92d..6fb2fb3967e 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/functions/QueryFunctionsDescriptor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/functions/QueryFunctionsDescriptor.java @@ -27,7 +27,7 @@ import datawave.query.attributes.AttributeFactory; import datawave.query.attributes.UniqueFields; import datawave.query.common.grouping.GroupFields; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.jexl.ArithmeticJexlEngines; import datawave.query.jexl.JexlASTHelper; import datawave.query.jexl.JexlNodeFactory; @@ -63,7 +63,8 @@ public QueryJexlArgumentDescriptor(ASTFunctionNode node, String namespace, Strin } @Override - public JexlNode getIndexQuery(ShardQueryConfiguration config, MetadataHelper helper, DateIndexHelper dateIndexHelper, Set datatypeFilter) { + public JexlNode getIndexQuery(ImmutableShardQueryConfiguration config, MetadataHelper helper, DateIndexHelper dateIndexHelper, + Set datatypeFilter) { switch (name) { case BETWEEN: JexlNode geNode = JexlNodeFactory.buildNode(new ASTGENode(ParserTreeConstants.JJTGENODE), args.get(0), diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/functions/arguments/JexlArgumentDescriptor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/functions/arguments/JexlArgumentDescriptor.java index f586d46c951..56981e311a1 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/functions/arguments/JexlArgumentDescriptor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/functions/arguments/JexlArgumentDescriptor.java @@ -10,7 +10,7 @@ import datawave.core.iterators.DatawaveFieldIndexFilterIteratorJexl; import datawave.query.attributes.AttributeFactory; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.jexl.JexlASTHelper; import datawave.query.jexl.visitors.EventDataQueryExpressionVisitor; import datawave.query.util.DateIndexHelper; @@ -37,7 +37,8 @@ public interface JexlArgumentDescriptor { * the config settings * @return The query which will be used against the global index */ - JexlNode getIndexQuery(ShardQueryConfiguration settings, MetadataHelper metadataHelper, DateIndexHelper dateIndexHelper, Set datatypeFilter); + JexlNode getIndexQuery(ImmutableShardQueryConfiguration settings, MetadataHelper metadataHelper, DateIndexHelper dateIndexHelper, + Set datatypeFilter); /** * Get the expression filters for this function. NOTE NOTE NOTE: This only needs to add expression filters IFF the getIndexQuery does not add appropriate diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/functions/arguments/RebuildingJexlArgumentDescriptor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/functions/arguments/RebuildingJexlArgumentDescriptor.java index 0550097fbbe..056e3b352d8 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/functions/arguments/RebuildingJexlArgumentDescriptor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/functions/arguments/RebuildingJexlArgumentDescriptor.java @@ -5,7 +5,7 @@ import org.apache.commons.jexl3.parser.ASTFunctionNode; import org.apache.commons.jexl3.parser.JexlNode; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.util.DateIndexHelper; import datawave.query.util.MetadataHelper; @@ -32,6 +32,6 @@ public interface RebuildingJexlArgumentDescriptor extends JexlArgumentDescriptor * the function node * @return A new JexlNode representing the rebuilt ASTFunctionNode, or if no change is required, returns the original ASTFunctionNode */ - JexlNode rebuildNode(ShardQueryConfiguration settings, MetadataHelper metadataHelper, DateIndexHelper dateIndexHelper, Set datatypeFilter, + JexlNode rebuildNode(ImmutableShardQueryConfiguration settings, MetadataHelper metadataHelper, DateIndexHelper dateIndexHelper, Set datatypeFilter, ASTFunctionNode node); } diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/AsyncIndexLookup.java b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/AsyncIndexLookup.java index f15c4baa201..e999e066910 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/AsyncIndexLookup.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/AsyncIndexLookup.java @@ -12,13 +12,13 @@ import org.apache.log4j.Logger; import datawave.core.common.logging.ThreadConfigurableLogger; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.tables.ScannerFactory; /** * Abstract index lookup which provides a framework for creating and populating the {@link IndexLookupMap} asynchronously in a separate thread. Async index * lookups may perform some setup in {@link #submit()}, but should not block on any running threads until {@link #lookup()} is called, and even then they should - * only block for up to the specified timeout {@link ShardQueryConfiguration#getMaxIndexScanTimeMillis()} + * only block for up to the specified timeout {@link ImmutableShardQueryConfiguration#getMaxIndexScanTimeMillis()} */ public abstract class AsyncIndexLookup extends IndexLookup { private static final Logger log = ThreadConfigurableLogger.getLogger(AsyncIndexLookup.class); @@ -27,7 +27,7 @@ public abstract class AsyncIndexLookup extends IndexLookup { protected ExecutorService execService; - public AsyncIndexLookup(ShardQueryConfiguration config, ScannerFactory scannerFactory, boolean unfieldedLookup, ExecutorService execService) { + public AsyncIndexLookup(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, boolean unfieldedLookup, ExecutorService execService) { super(config, scannerFactory); this.unfieldedLookup = unfieldedLookup; this.execService = execService; diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/BoundedRangeIndexLookup.java b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/BoundedRangeIndexLookup.java index 810e15163a0..2c67062e44e 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/BoundedRangeIndexLookup.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/BoundedRangeIndexLookup.java @@ -32,7 +32,7 @@ import datawave.core.iterators.TimeoutIterator; import datawave.data.type.DiscreteIndexType; import datawave.query.Constants; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.exceptions.DatawaveFatalQueryException; import datawave.query.exceptions.IllegalRangeArgumentException; import datawave.query.jexl.LiteralRange; @@ -68,7 +68,8 @@ public class BoundedRangeIndexLookup extends AsyncIndexLookup { * @param execService * the executor service, not null */ - public BoundedRangeIndexLookup(ShardQueryConfiguration config, ScannerFactory scannerFactory, LiteralRange literalRange, ExecutorService execService) { + public BoundedRangeIndexLookup(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, LiteralRange literalRange, + ExecutorService execService) { super(config, scannerFactory, false, execService); this.literalRange = literalRange; this.fields = Collections.singleton(literalRange.getFieldName()); diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/EmptyIndexLookup.java b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/EmptyIndexLookup.java index 1946b55a4d5..fb24d075d57 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/EmptyIndexLookup.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/EmptyIndexLookup.java @@ -1,6 +1,6 @@ package datawave.query.jexl.lookups; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; /** * An index lookup which does no work and returns an empty IndexLookupMap @@ -12,7 +12,7 @@ public class EmptyIndexLookup extends IndexLookup { * @param config * the shard query configuration, not null */ - public EmptyIndexLookup(ShardQueryConfiguration config) { + public EmptyIndexLookup(ImmutableShardQueryConfiguration config) { super(config, null); } diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/FieldExpansionIndexLookup.java b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/FieldExpansionIndexLookup.java index 02cd93e0b05..354c7cac9ca 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/FieldExpansionIndexLookup.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/FieldExpansionIndexLookup.java @@ -23,7 +23,7 @@ import com.google.common.base.Preconditions; import datawave.core.iterators.FieldExpansionIterator; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.tables.ScannerFactory; import datawave.util.time.DateHelper; @@ -42,7 +42,7 @@ public class FieldExpansionIndexLookup extends AsyncIndexLookup { private Scanner scanner; - public FieldExpansionIndexLookup(ShardQueryConfiguration config, ScannerFactory scannerFactory, String term, Set fields, + public FieldExpansionIndexLookup(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, String term, Set fields, ExecutorService execService) { super(config, scannerFactory, true, execService); this.term = term; diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/FieldNameIndexLookup.java b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/FieldNameIndexLookup.java index c9992cc4be0..db201c294d1 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/FieldNameIndexLookup.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/FieldNameIndexLookup.java @@ -25,7 +25,7 @@ import datawave.core.query.configuration.Result; import datawave.query.Constants; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.tables.ScannerFactory; import datawave.query.tables.ScannerSession; @@ -58,7 +58,7 @@ public class FieldNameIndexLookup extends AsyncIndexLookup { * @param execService * the executor service, not null */ - public FieldNameIndexLookup(ShardQueryConfiguration config, ScannerFactory scannerFactory, Set fields, Set terms, + public FieldNameIndexLookup(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, Set fields, Set terms, ExecutorService execService) { super(config, scannerFactory, true, execService); diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/IndexLookup.java b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/IndexLookup.java index b755ed5b5c4..fd01524d744 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/IndexLookup.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/IndexLookup.java @@ -2,14 +2,14 @@ import java.util.Set; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.tables.ScannerFactory; /** * Abstract class which provides a framework for index lookups */ public abstract class IndexLookup { - protected ShardQueryConfiguration config; + protected ImmutableShardQueryConfiguration config; protected ScannerFactory scannerFactory; protected Set fields; @@ -23,7 +23,7 @@ public abstract class IndexLookup { * @param scannerFactory * the scanner factory, may be null */ - public IndexLookup(ShardQueryConfiguration config, ScannerFactory scannerFactory) { + public IndexLookup(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory) { this.config = config; this.scannerFactory = scannerFactory; } diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/RegexIndexLookup.java b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/RegexIndexLookup.java index 0b9bc4ac93d..b75f18cfd42 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/RegexIndexLookup.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/RegexIndexLookup.java @@ -31,7 +31,7 @@ import datawave.core.iterators.TimeoutIterator; import datawave.core.query.configuration.Result; import datawave.query.Constants; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.exceptions.DatawaveFatalQueryException; import datawave.query.exceptions.DoNotPerformOptimizedQueryException; import datawave.query.parser.JavaRegexAnalyzer.JavaRegexParseException; @@ -77,8 +77,8 @@ public class RegexIndexLookup extends AsyncIndexLookup { * @param execService * the executor service, not null */ - public RegexIndexLookup(ShardQueryConfiguration config, ScannerFactory scannerFactory, Set fields, Set reverseFields, Set patterns, - MetadataHelper helper, boolean unfieldedLookup, ExecutorService execService) { + public RegexIndexLookup(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, Set fields, Set reverseFields, + Set patterns, MetadataHelper helper, boolean unfieldedLookup, ExecutorService execService) { super(config, scannerFactory, unfieldedLookup, execService); this.fields = fields; this.reverseFields = reverseFields; @@ -101,8 +101,8 @@ public RegexIndexLookup(ShardQueryConfiguration config, ScannerFactory scannerFa * @param execService * the executor service, not null */ - public RegexIndexLookup(ShardQueryConfiguration config, ScannerFactory scannerFactory, String fieldName, Set patterns, MetadataHelper helper, - ExecutorService execService) { + public RegexIndexLookup(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, String fieldName, Set patterns, + MetadataHelper helper, ExecutorService execService) { this(config, scannerFactory, Collections.singleton(fieldName), Collections.singleton(fieldName), patterns, helper, false, execService); } diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/ShardIndexQueryTableStaticMethods.java b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/ShardIndexQueryTableStaticMethods.java index 8033f8fd01c..3d5e82bf9b2 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/ShardIndexQueryTableStaticMethods.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/ShardIndexQueryTableStaticMethods.java @@ -40,7 +40,7 @@ import datawave.core.iterators.filter.GlobalIndexDateRangeFilter; import datawave.core.iterators.filter.GlobalIndexTermMatchingFilter; import datawave.query.Constants; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.exceptions.DatawaveFatalQueryException; import datawave.query.exceptions.DoNotPerformOptimizedQueryException; import datawave.query.exceptions.IllegalRangeArgumentException; @@ -89,8 +89,8 @@ public class ShardIndexQueryTableStaticMethods { * @throws TableNotFoundException * if the table was not found */ - public static IndexLookup expandQueryTerms(JexlNode node, ShardQueryConfiguration config, ScannerFactory scannerFactory, Set expansionFields, - MetadataHelper helperRef, ExecutorService execService) throws TableNotFoundException { + public static IndexLookup expandQueryTerms(JexlNode node, ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, + Set expansionFields, MetadataHelper helperRef, ExecutorService execService) throws TableNotFoundException { if (node instanceof ASTEQNode) { return expandQueryTerms((ASTEQNode) node, config, scannerFactory, expansionFields, helperRef, execService); } else if (node instanceof ASTNENode) { @@ -112,8 +112,8 @@ public static IndexLookup expandQueryTerms(JexlNode node, ShardQueryConfiguratio } } - public static IndexLookup expandQueryTerms(String literal, ShardQueryConfiguration config, ScannerFactory scannerFactory, Set expansionFields, - MetadataHelper helperRef, ExecutorService execService) throws TableNotFoundException { + public static IndexLookup expandQueryTerms(String literal, ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, + Set expansionFields, MetadataHelper helperRef, ExecutorService execService) throws TableNotFoundException { Set terms = Sets.newHashSet(literal); return new FieldNameIndexLookup(config, scannerFactory, getIndexedExpansionFields(expansionFields, false, config.getDatatypeFilter(), helperRef), terms, execService); @@ -165,8 +165,8 @@ public static Set getIndexedExpansionFields(Set expansionFields, * @throws TableNotFoundException * if the table was not found */ - public static IndexLookup expandQueryTerms(ASTEQNode node, ShardQueryConfiguration config, ScannerFactory scannerFactory, Set expansionFields, - MetadataHelper helperRef, ExecutorService execService) throws TableNotFoundException { + public static IndexLookup expandQueryTerms(ASTEQNode node, ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, + Set expansionFields, MetadataHelper helperRef, ExecutorService execService) throws TableNotFoundException { return _expandQueryTerms(node, config, scannerFactory, expansionFields, helperRef, execService); } @@ -189,13 +189,13 @@ public static IndexLookup expandQueryTerms(ASTEQNode node, ShardQueryConfigurati * @throws TableNotFoundException * if the table was not found */ - public static IndexLookup expandQueryTerms(ASTNENode node, ShardQueryConfiguration config, ScannerFactory scannerFactory, Set expansionFields, - MetadataHelper helperRef, ExecutorService execService) throws TableNotFoundException { + public static IndexLookup expandQueryTerms(ASTNENode node, ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, + Set expansionFields, MetadataHelper helperRef, ExecutorService execService) throws TableNotFoundException { return _expandQueryTerms(node, config, scannerFactory, expansionFields, helperRef, execService); } - protected static IndexLookup _expandQueryTerms(JexlNode node, ShardQueryConfiguration config, ScannerFactory scannerFactory, Set expansionFields, - MetadataHelper helperRef, ExecutorService execService) throws TableNotFoundException { + protected static IndexLookup _expandQueryTerms(JexlNode node, ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, + Set expansionFields, MetadataHelper helperRef, ExecutorService execService) throws TableNotFoundException { Object literal = JexlASTHelper.getLiteralValue(node); if (literal instanceof String) { @@ -229,8 +229,8 @@ protected static IndexLookup _expandQueryTerms(JexlNode node, ShardQueryConfigur * @throws TableNotFoundException * if the table was not found */ - public static IndexLookup expandRegexFieldName(ASTERNode node, ShardQueryConfiguration config, ScannerFactory scannerFactory, Set expansionFields, - MetadataHelper helperRef, ExecutorService execService) throws TableNotFoundException { + public static IndexLookup expandRegexFieldName(ASTERNode node, ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, + Set expansionFields, MetadataHelper helperRef, ExecutorService execService) throws TableNotFoundException { return _expandRegexFieldName(node, config, scannerFactory, expansionFields, helperRef, execService); } @@ -253,8 +253,8 @@ public static IndexLookup expandRegexFieldName(ASTERNode node, ShardQueryConfigu * @throws TableNotFoundException * if the table was not found */ - public static IndexLookup expandRegexFieldName(ASTNRNode node, ShardQueryConfiguration config, ScannerFactory scannerFactory, Set expansionFields, - MetadataHelper helperRef, ExecutorService execService) throws TableNotFoundException { + public static IndexLookup expandRegexFieldName(ASTNRNode node, ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, + Set expansionFields, MetadataHelper helperRef, ExecutorService execService) throws TableNotFoundException { return _expandRegexFieldName(node, config, scannerFactory, expansionFields, helperRef, execService); } @@ -277,7 +277,7 @@ public static IndexLookup expandRegexFieldName(ASTNRNode node, ShardQueryConfigu * @throws TableNotFoundException * if the table was not found */ - protected static IndexLookup _expandRegexFieldName(JexlNode node, ShardQueryConfiguration config, ScannerFactory scannerFactory, + protected static IndexLookup _expandRegexFieldName(JexlNode node, ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, Set expansionFields, MetadataHelper helperRef, ExecutorService execService) throws TableNotFoundException { Set patterns = Sets.newHashSet(); @@ -311,7 +311,7 @@ protected static IndexLookup _expandRegexFieldName(JexlNode node, ShardQueryConf * the executor service * @return The index lookup instance */ - public static IndexLookup expandRegexTerms(ASTERNode node, ShardQueryConfiguration config, ScannerFactory scannerFactory, String fieldName, + public static IndexLookup expandRegexTerms(ASTERNode node, ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, String fieldName, MetadataHelper helperRef, ExecutorService execService) { Set patterns = Sets.newHashSet(); @@ -325,7 +325,8 @@ public static IndexLookup expandRegexTerms(ASTERNode node, ShardQueryConfigurati return new RegexIndexLookup(config, scannerFactory, fieldName, patterns, helperRef, execService); } - public static IndexLookup expandRange(ShardQueryConfiguration config, ScannerFactory scannerFactory, LiteralRange range, ExecutorService execService) { + public static IndexLookup expandRange(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, LiteralRange range, + ExecutorService execService) { return new BoundedRangeIndexLookup(config, scannerFactory, range, execService); } @@ -386,7 +387,7 @@ public static Range getLiteralRange(String fieldName, String normalizedQueryTerm * @throws IOException * dates can't be formatted */ - public static ScannerSession configureTermMatchOnly(ShardQueryConfiguration config, ScannerFactory scannerFactory, String tableName, + public static ScannerSession configureTermMatchOnly(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, String tableName, Collection ranges, Collection literals, Collection patterns, boolean reverseIndex, boolean limitToUniqueTerms) throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException, IOException { @@ -416,7 +417,7 @@ public static ScannerSession configureTermMatchOnly(ShardQueryConfiguration conf return bs; } - public static ScannerSession configureLimitedDiscovery(ShardQueryConfiguration config, ScannerFactory scannerFactory, String tableName, + public static ScannerSession configureLimitedDiscovery(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, String tableName, Collection ranges, Collection literals, Collection patterns, boolean reverseIndex, boolean limitToUniqueTerms) throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException, IOException { @@ -447,7 +448,7 @@ public static ScannerSession configureLimitedDiscovery(ShardQueryConfiguration c return bs; } - public static final void configureGlobalIndexDateRangeFilter(ShardQueryConfiguration config, ScannerBase bs, LongRange dateRange) { + public static final void configureGlobalIndexDateRangeFilter(ImmutableShardQueryConfiguration config, ScannerBase bs, LongRange dateRange) { // Setup the GlobalIndexDateRangeFilter if (log.isTraceEnabled()) { @@ -464,7 +465,7 @@ public static final void configureGlobalIndexDateRangeFilter(ShardQueryConfigura } } - public static final IteratorSetting configureGlobalIndexDateRangeFilter(ShardQueryConfiguration config, LongRange dateRange) { + public static final IteratorSetting configureGlobalIndexDateRangeFilter(ImmutableShardQueryConfiguration config, LongRange dateRange) { // Setup the GlobalIndexDateRangeFilter if (log.isTraceEnabled()) { log.trace("Configuring GlobalIndexDateRangeFilter with " + dateRange); @@ -475,7 +476,7 @@ public static final IteratorSetting configureGlobalIndexDateRangeFilter(ShardQue return cfg; } - public static final IteratorSetting configureDateRangeIterator(ShardQueryConfiguration config) throws IOException { + public static final IteratorSetting configureDateRangeIterator(ImmutableShardQueryConfiguration config) throws IOException { // Setup the GlobalIndexDateRangeFilter if (log.isTraceEnabled()) { log.trace("Configuring configureDateRangeIterator "); @@ -487,7 +488,7 @@ public static final IteratorSetting configureDateRangeIterator(ShardQueryConfigu return cfg; } - public static final void configureGlobalIndexDataTypeFilter(ShardQueryConfiguration config, ScannerBase bs, Collection dataTypes) { + public static final void configureGlobalIndexDataTypeFilter(ImmutableShardQueryConfiguration config, ScannerBase bs, Collection dataTypes) { if (dataTypes == null || dataTypes.isEmpty()) { return; } @@ -500,7 +501,7 @@ public static final void configureGlobalIndexDataTypeFilter(ShardQueryConfigurat bs.addScanIterator(cfg); } - public static IteratorSetting configureGlobalIndexDataTypeFilter(ShardQueryConfiguration config, Collection dataTypes) { + public static IteratorSetting configureGlobalIndexDataTypeFilter(ImmutableShardQueryConfiguration config, Collection dataTypes) { if (log.isTraceEnabled()) { log.trace("Configuring GlobalIndexDataTypeFilter with " + dataTypes); @@ -515,7 +516,7 @@ public static IteratorSetting configureGlobalIndexDataTypeFilter(ShardQueryConfi return cfg; } - public static final void configureGlobalIndexTermMatchingIterator(ShardQueryConfiguration config, ScannerBase bs, Collection literals, + public static final void configureGlobalIndexTermMatchingIterator(ImmutableShardQueryConfiguration config, ScannerBase bs, Collection literals, Collection patterns, boolean reverseIndex, boolean limitToUniqueTerms, Collection expansionFields) { if (CollectionUtils.isEmpty(literals) && CollectionUtils.isEmpty(patterns)) { return; @@ -541,13 +542,14 @@ public static final void configureGlobalIndexTermMatchingIterator(ShardQueryConf setExpansionFields(config, bs, reverseIndex, expansionFields); } - public static final void setExpansionFields(ShardQueryConfiguration config, ScannerBase bs, boolean reverseIndex, Collection expansionFields) { + public static final void setExpansionFields(ImmutableShardQueryConfiguration config, ScannerBase bs, boolean reverseIndex, + Collection expansionFields) { for (String field : getColumnFamilies(config, reverseIndex, expansionFields)) { bs.fetchColumnFamily(new Text(field)); } } - public static final List getColumnFamilies(ShardQueryConfiguration config, boolean reverseIndex, Collection expansionFields) { + public static final List getColumnFamilies(ImmutableShardQueryConfiguration config, boolean reverseIndex, Collection expansionFields) { List cfs = Lists.newLinkedList(); // Now restrict the fields returned to those that are specified and then only those that are indexed or reverse indexed if (expansionFields == null || expansionFields.isEmpty()) { @@ -564,7 +566,7 @@ public static final List getColumnFamilies(ShardQueryConfiguration confi return cfs; } - public static final IteratorSetting configureGlobalIndexTermMatchingIterator(ShardQueryConfiguration config, Collection literals, + public static final IteratorSetting configureGlobalIndexTermMatchingIterator(ImmutableShardQueryConfiguration config, Collection literals, Collection patterns, boolean reverseIndex, boolean limitToUniqueTerms) { if (CollectionUtils.isEmpty(literals) && CollectionUtils.isEmpty(patterns)) { return null; @@ -620,7 +622,7 @@ public static final IteratorSetting configureGlobalIndexTermMatchingIterator(Sha * for problems with threading execution */ public static RefactoredRangeDescription getRegexRange(String fieldName, String normalizedQueryTerm, boolean fullTableScanEnabled, - MetadataHelper metadataHelper, ShardQueryConfiguration config) + MetadataHelper metadataHelper, ImmutableShardQueryConfiguration config) throws JavaRegexAnalyzer.JavaRegexParseException, TableNotFoundException, ExecutionException { if (log.isDebugEnabled()) { log.debug("getRegexRange: " + normalizedQueryTerm); @@ -723,7 +725,7 @@ public String toString() { } public static RefactoredRangeDescription getRegexRange(Map.Entry entry, boolean fullTableScanEnabled, MetadataHelper metadataHelper, - ShardQueryConfiguration config) throws JavaRegexAnalyzer.JavaRegexParseException, TableNotFoundException, ExecutionException { + ImmutableShardQueryConfiguration config) throws JavaRegexAnalyzer.JavaRegexParseException, TableNotFoundException, ExecutionException { return getRegexRange(entry.getKey(), entry.getValue(), fullTableScanEnabled, metadataHelper, config); } @@ -744,8 +746,8 @@ public static RefactoredRangeDescription getRegexRange(Map.Entry * @throws ExecutionException * for issues with execution */ - public static boolean shouldUseReverseIndex(JavaRegexAnalyzer analyzer, String fieldName, MetadataHelper metadataHelper, ShardQueryConfiguration config) - throws TableNotFoundException, ExecutionException { + public static boolean shouldUseReverseIndex(JavaRegexAnalyzer analyzer, String fieldName, MetadataHelper metadataHelper, + ImmutableShardQueryConfiguration config) throws TableNotFoundException, ExecutionException { String leadingLiteral = analyzer.getLeadingLiteral(); String trailingLiteral = analyzer.getTrailingLiteral(); @@ -836,7 +838,7 @@ public static boolean reverseIndexedInDatatype(String fieldName, Set dat * the query configuration * @return A literal with the realm information removed. */ - private static String trimRealmFromLiteral(String literal, ShardQueryConfiguration config) { + private static String trimRealmFromLiteral(String literal, ImmutableShardQueryConfiguration config) { String retVal = null; List exclusions = config.getRealmSuffixExclusionPatterns(); diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/AllTermsIndexedVisitor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/AllTermsIndexedVisitor.java index 22954925114..5db827a3557 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/AllTermsIndexedVisitor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/AllTermsIndexedVisitor.java @@ -25,7 +25,7 @@ import com.google.common.base.Preconditions; import datawave.query.Constants; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.exceptions.DatawaveFatalQueryException; import datawave.query.exceptions.EmptyUnfieldedTermExpansionException; import datawave.query.exceptions.InvalidFieldIndexQueryFatalQueryException; @@ -50,12 +50,12 @@ public class AllTermsIndexedVisitor extends RebuildingVisitor { private static final Logger log = Logger.getLogger(AllTermsIndexedVisitor.class); - private final ShardQueryConfiguration config; + private final ImmutableShardQueryConfiguration config; private final MetadataHelper helper; private static final String NODE_PATTERN = "Node: {0}"; - public AllTermsIndexedVisitor(ShardQueryConfiguration config, MetadataHelper helper) { + public AllTermsIndexedVisitor(ImmutableShardQueryConfiguration config, MetadataHelper helper) { Preconditions.checkNotNull(config, "ShardQueryConfiguration must not be null"); Preconditions.checkNotNull(helper, "MetadataHelper must not be null"); @@ -64,7 +64,7 @@ public AllTermsIndexedVisitor(ShardQueryConfiguration config, MetadataHelper hel } @SuppressWarnings("unchecked") - public static T isIndexed(T script, ShardQueryConfiguration config, MetadataHelper helper) { + public static T isIndexed(T script, ImmutableShardQueryConfiguration config, MetadataHelper helper) { Preconditions.checkNotNull(script, "JEXL script must not be null"); AllTermsIndexedVisitor visitor = new AllTermsIndexedVisitor(config, helper); diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/BaseIndexExpansionVisitor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/BaseIndexExpansionVisitor.java index 85356af2999..605b5e3c16e 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/BaseIndexExpansionVisitor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/BaseIndexExpansionVisitor.java @@ -21,7 +21,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.exceptions.DatawaveFatalQueryException; import datawave.query.jexl.JexlASTHelper; import datawave.query.jexl.lookups.AsyncIndexLookup; @@ -42,7 +42,7 @@ public abstract class BaseIndexExpansionVisitor extends RebuildingVisitor { private static final Logger log = LoggerFactory.getLogger(BaseIndexExpansionVisitor.class); private static final int MIN_THREADS = 1; - protected ShardQueryConfiguration config; + protected ImmutableShardQueryConfiguration config; protected ScannerFactory scannerFactory; protected MetadataHelper helper; protected boolean expandFields; @@ -60,14 +60,14 @@ public abstract class BaseIndexExpansionVisitor extends RebuildingVisitor { protected String stage = "default"; - protected BaseIndexExpansionVisitor(ShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper, String threadName) + protected BaseIndexExpansionVisitor(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper, String threadName) throws TableNotFoundException { this(config, scannerFactory, helper, null, threadName); } // The constructor should not be made public so that we can ensure that the executor is set up and shutdown correctly - protected BaseIndexExpansionVisitor(ShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper, Map lookupMap, - String threadName) throws TableNotFoundException { + protected BaseIndexExpansionVisitor(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper, + Map lookupMap, String threadName) throws TableNotFoundException { this.config = config; this.scannerFactory = scannerFactory; this.helper = helper; @@ -314,13 +314,13 @@ protected void logResult(String stage, JexlNode node, IndexLookupMap lookupMap) * Serves as a means to associate index lookup threads with a particular Index Expansion Visitor */ protected static class IndexExpansionThreadFactory implements ThreadFactory { - private final ShardQueryConfiguration config; + private final ImmutableShardQueryConfiguration config; private final ThreadFactory dtf = Executors.defaultThreadFactory(); private int threadNum = 1; private final String threadIdentifier; protected String name; - public IndexExpansionThreadFactory(ShardQueryConfiguration config, String name) { + public IndexExpansionThreadFactory(ImmutableShardQueryConfiguration config, String name) { this.config = config; if (config.getQuery() == null || config.getQuery().getId() == null) { this.threadIdentifier = "(unknown)"; diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/BoundedRangeDetectionVisitor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/BoundedRangeDetectionVisitor.java index 1638573298c..3be9eb6b8b1 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/BoundedRangeDetectionVisitor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/BoundedRangeDetectionVisitor.java @@ -15,7 +15,7 @@ import org.apache.commons.jexl3.parser.ASTNRNode; import org.apache.commons.jexl3.parser.JexlNode; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.exceptions.DatawaveFatalQueryException; import datawave.query.jexl.JexlASTHelper; import datawave.query.jexl.LiteralRange; @@ -24,16 +24,16 @@ public class BoundedRangeDetectionVisitor extends ShortCircuitBaseVisitor { - ShardQueryConfiguration config; + ImmutableShardQueryConfiguration config; MetadataHelper helper; - public BoundedRangeDetectionVisitor(ShardQueryConfiguration config, MetadataHelper metadataHelper) { + public BoundedRangeDetectionVisitor(ImmutableShardQueryConfiguration config, MetadataHelper metadataHelper) { this.config = config; this.helper = metadataHelper; } @SuppressWarnings("unchecked") - public static boolean mustExpandBoundedRange(ShardQueryConfiguration config, MetadataHelper metadataHelper, JexlNode script) { + public static boolean mustExpandBoundedRange(ImmutableShardQueryConfiguration config, MetadataHelper metadataHelper, JexlNode script) { BoundedRangeDetectionVisitor visitor = new BoundedRangeDetectionVisitor(config, metadataHelper); AtomicBoolean hasBounded = new AtomicBoolean(false); diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/BoundedRangeIndexExpansionVisitor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/BoundedRangeIndexExpansionVisitor.java index 36061f05d7f..abb2746667a 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/BoundedRangeIndexExpansionVisitor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/BoundedRangeIndexExpansionVisitor.java @@ -14,7 +14,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.exceptions.IllegalRangeArgumentException; import datawave.query.jexl.JexlASTHelper; import datawave.query.jexl.JexlNodeFactory; @@ -35,7 +35,7 @@ public class BoundedRangeIndexExpansionVisitor extends BaseIndexExpansionVisitor private final JexlASTHelper.RangeFinder rangeFinder; // The constructor should not be made public so that we can ensure that the executor is setup and shutdown correctly - protected BoundedRangeIndexExpansionVisitor(ShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper) + protected BoundedRangeIndexExpansionVisitor(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper) throws TableNotFoundException { super(config, scannerFactory, helper, "BoundedRangeIndexExpansion"); @@ -60,8 +60,8 @@ protected BoundedRangeIndexExpansionVisitor(ShardQueryConfiguration config, Scan * @throws TableNotFoundException * if we fail to retrieve fields from the metadata helper */ - public static T expandBoundedRanges(ShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper, T script) - throws TableNotFoundException { + public static T expandBoundedRanges(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper, + T script) throws TableNotFoundException { // if not expanding fields or values, then this is a noop if (config.isExpandFields() || config.isExpandValues()) { BoundedRangeIndexExpansionVisitor visitor = new BoundedRangeIndexExpansionVisitor(config, scannerFactory, helper); diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/CaseSensitivityVisitor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/CaseSensitivityVisitor.java index 99d8e6f31cf..2bbbb0716ec 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/CaseSensitivityVisitor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/CaseSensitivityVisitor.java @@ -17,7 +17,7 @@ import org.apache.commons.jexl3.parser.JexlNode; import org.apache.commons.jexl3.parser.JexlNodes; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.jexl.functions.JexlFunctionArgumentDescriptorFactory; import datawave.query.jexl.functions.arguments.JexlArgumentDescriptor; import datawave.query.util.MetadataHelper; @@ -29,10 +29,10 @@ */ public class CaseSensitivityVisitor extends ShortCircuitBaseVisitor { - private ShardQueryConfiguration config; + private ImmutableShardQueryConfiguration config; private MetadataHelper helper; - public CaseSensitivityVisitor(ShardQueryConfiguration config, MetadataHelper helper) { + public CaseSensitivityVisitor(ImmutableShardQueryConfiguration config, MetadataHelper helper) { this.config = config; this.helper = helper; } @@ -50,7 +50,7 @@ public CaseSensitivityVisitor(ShardQueryConfiguration config, MetadataHelper hel * the metadata helper * @return the provided script */ - public static T upperCaseIdentifiers(ShardQueryConfiguration config, MetadataHelper helper, T script) { + public static T upperCaseIdentifiers(ImmutableShardQueryConfiguration config, MetadataHelper helper, T script) { CaseSensitivityVisitor visitor = new CaseSensitivityVisitor(config, helper); script.jjtAccept(visitor, null); diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/EvaluationRendering.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/EvaluationRendering.java index 60c24b3c6b6..ef12426afde 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/EvaluationRendering.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/EvaluationRendering.java @@ -15,7 +15,7 @@ import com.google.common.base.Preconditions; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.jexl.nodes.QueryPropertyMarker; import datawave.query.util.MetadataHelper; @@ -25,12 +25,12 @@ public class EvaluationRendering extends BaseVisitor { private static final Logger log = Logger.getLogger(EvaluationRendering.class); - protected final ShardQueryConfiguration config; + protected final ImmutableShardQueryConfiguration config; protected final MetadataHelper helper; protected boolean allowRange; - public EvaluationRendering(ShardQueryConfiguration config, MetadataHelper helper) { + public EvaluationRendering(ImmutableShardQueryConfiguration config, MetadataHelper helper) { Preconditions.checkNotNull(config); Preconditions.checkNotNull(helper); @@ -38,11 +38,11 @@ public EvaluationRendering(ShardQueryConfiguration config, MetadataHelper helper this.helper = helper; } - public static boolean canDisableEvaluation(JexlNode script, ShardQueryConfiguration config, MetadataHelper helper) { + public static boolean canDisableEvaluation(JexlNode script, ImmutableShardQueryConfiguration config, MetadataHelper helper) { return canDisableEvaluation(script, config, helper, false); } - public static boolean canDisableEvaluation(JexlNode script, ShardQueryConfiguration config, MetadataHelper helper, boolean allowRange) { + public static boolean canDisableEvaluation(JexlNode script, ImmutableShardQueryConfiguration config, MetadataHelper helper, boolean allowRange) { Preconditions.checkNotNull(script); AtomicBoolean res = new AtomicBoolean(true); diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/ExecutableDeterminationVisitor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/ExecutableDeterminationVisitor.java index 02941bb10df..1ffa44d78d4 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/ExecutableDeterminationVisitor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/ExecutableDeterminationVisitor.java @@ -74,7 +74,7 @@ import com.google.common.collect.Multimap; import datawave.query.Constants; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.jexl.JexlASTHelper; import datawave.query.jexl.nodes.QueryPropertyMarker; import datawave.query.util.MetadataHelper; @@ -369,13 +369,14 @@ private static StringListOutput newStringListOutput(LinkedList debugOutp protected Set indexedFields = null; protected Set indexOnlyFields = null; protected Set nonEventFields = null; - protected ShardQueryConfiguration config; + protected ImmutableShardQueryConfiguration config; - public ExecutableDeterminationVisitor(ShardQueryConfiguration conf, MetadataHelper metadata, boolean forFieldIndex) { + public ExecutableDeterminationVisitor(ImmutableShardQueryConfiguration conf, MetadataHelper metadata, boolean forFieldIndex) { this(conf, metadata, forFieldIndex, null); } - public ExecutableDeterminationVisitor(ShardQueryConfiguration conf, MetadataHelper metadata, boolean forFieldIndex, LinkedList debugOutput) { + public ExecutableDeterminationVisitor(ImmutableShardQueryConfiguration conf, MetadataHelper metadata, boolean forFieldIndex, + LinkedList debugOutput) { this.helper = metadata; this.config = conf; this.forFieldIndex = forFieldIndex; @@ -434,15 +435,16 @@ public static boolean isNegated(Object data) { } } - public static STATE getState(JexlNode node, ShardQueryConfiguration config, MetadataHelper helper) { + public static STATE getState(JexlNode node, ImmutableShardQueryConfiguration config, MetadataHelper helper) { return getState(node, config, helper, false); } - public static STATE getState(JexlNode node, ShardQueryConfiguration config, MetadataHelper helper, boolean forFieldIndex) { + public static STATE getState(JexlNode node, ImmutableShardQueryConfiguration config, MetadataHelper helper, boolean forFieldIndex) { return getState(node, config, helper, forFieldIndex, null); } - public static StateAndReason getStateAndReason(JexlNode node, ShardQueryConfiguration config, MetadataHelper helper, LinkedList debugOutput) { + public static StateAndReason getStateAndReason(JexlNode node, ImmutableShardQueryConfiguration config, MetadataHelper helper, + LinkedList debugOutput) { if (debugOutput == null) { debugOutput = new LinkedList<>(); } @@ -453,11 +455,12 @@ public static StateAndReason getStateAndReason(JexlNode node, ShardQueryConfigur return sAndR; } - public static STATE getState(JexlNode node, ShardQueryConfiguration config, MetadataHelper helper, LinkedList debugOutput) { + public static STATE getState(JexlNode node, ImmutableShardQueryConfiguration config, MetadataHelper helper, LinkedList debugOutput) { return getState(node, config, helper, false, debugOutput); } - public static STATE getState(JexlNode node, ShardQueryConfiguration config, MetadataHelper helper, boolean forFieldIndex, LinkedList debugOutput) { + public static STATE getState(JexlNode node, ImmutableShardQueryConfiguration config, MetadataHelper helper, boolean forFieldIndex, + LinkedList debugOutput) { ExecutableDeterminationVisitor visitor = new ExecutableDeterminationVisitor(config, helper, forFieldIndex, debugOutput); // push down any negations to ensure the state is accurate @@ -467,7 +470,7 @@ public static STATE getState(JexlNode node, ShardQueryConfiguration config, Meta return state; } - public static STATE getState(JexlNode node, ShardQueryConfiguration config, Set indexedFields, Set indexOnlyFields, + public static STATE getState(JexlNode node, ImmutableShardQueryConfiguration config, Set indexedFields, Set indexOnlyFields, Set nonEventFields, boolean forFieldIndex, LinkedList debugOutput, MetadataHelper metadataHelper) { ExecutableDeterminationVisitor visitor = new ExecutableDeterminationVisitor(config, metadataHelper, forFieldIndex, debugOutput) .setNonEventFields(nonEventFields).setIndexOnlyFields(indexOnlyFields).setIndexedFields(indexedFields); @@ -479,30 +482,30 @@ public static STATE getState(JexlNode node, ShardQueryConfiguration config, Set< return state; } - public static boolean isExecutable(JexlNode node, ShardQueryConfiguration config, MetadataHelper helper) { + public static boolean isExecutable(JexlNode node, ImmutableShardQueryConfiguration config, MetadataHelper helper) { return isExecutable(node, config, helper, false); } - public static boolean isExecutable(JexlNode node, ShardQueryConfiguration config, MetadataHelper helper, boolean forFieldIndex) { + public static boolean isExecutable(JexlNode node, ImmutableShardQueryConfiguration config, MetadataHelper helper, boolean forFieldIndex) { return isExecutable(node, config, helper, forFieldIndex, null); } - public static boolean isExecutable(JexlNode node, ShardQueryConfiguration config, MetadataHelper helper, LinkedList debugOutput) { + public static boolean isExecutable(JexlNode node, ImmutableShardQueryConfiguration config, MetadataHelper helper, LinkedList debugOutput) { return isExecutable(node, config, helper, false, debugOutput); } - public static boolean isExecutable(JexlNode node, ShardQueryConfiguration config, Set indexedFields, Set indexOnlyFields, + public static boolean isExecutable(JexlNode node, ImmutableShardQueryConfiguration config, Set indexedFields, Set indexOnlyFields, Set nonEventFields, LinkedList debugOutput, MetadataHelper metadataHelper) { return isExecutable(node, config, indexedFields, indexOnlyFields, nonEventFields, false, debugOutput, metadataHelper); } - public static boolean isExecutable(JexlNode node, ShardQueryConfiguration config, MetadataHelper helper, boolean forFieldIndex, + public static boolean isExecutable(JexlNode node, ImmutableShardQueryConfiguration config, MetadataHelper helper, boolean forFieldIndex, LinkedList debugOutput) { STATE state = getState(node, config, helper, forFieldIndex, debugOutput); return state == STATE.EXECUTABLE; } - public static boolean isExecutable(JexlNode node, ShardQueryConfiguration config, Set indexedFields, Set indexOnlyFields, + public static boolean isExecutable(JexlNode node, ImmutableShardQueryConfiguration config, Set indexedFields, Set indexOnlyFields, Set nonEventFields, boolean forFieldIndex, LinkedList debugOutput, MetadataHelper metadataHelper) { STATE state = getState(node, config, indexedFields, indexOnlyFields, nonEventFields, forFieldIndex, debugOutput, metadataHelper); return state == STATE.EXECUTABLE; diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/ExecutableExpansionVisitor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/ExecutableExpansionVisitor.java index 60b42988554..4404e94042a 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/ExecutableExpansionVisitor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/ExecutableExpansionVisitor.java @@ -13,7 +13,7 @@ import org.apache.commons.jexl3.parser.ParserTreeConstants; import org.apache.log4j.Logger; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.jexl.JexlASTHelper; import datawave.query.util.MetadataHelper; @@ -25,15 +25,15 @@ public class ExecutableExpansionVisitor extends BaseVisitor { private static final Logger log = Logger.getLogger(ExecutableExpansionVisitor.class); - private final ShardQueryConfiguration config; + private final ImmutableShardQueryConfiguration config; private final MetadataHelper helper; - public ExecutableExpansionVisitor(ShardQueryConfiguration config, MetadataHelper helper) { + public ExecutableExpansionVisitor(ImmutableShardQueryConfiguration config, MetadataHelper helper) { this.config = config; this.helper = helper; } - public static ASTJexlScript expand(ASTJexlScript script, ShardQueryConfiguration config, MetadataHelper helper) { + public static ASTJexlScript expand(ASTJexlScript script, ImmutableShardQueryConfiguration config, MetadataHelper helper) { ExecutableExpansionVisitor visitor = new ExecutableExpansionVisitor(config, helper); return (ASTJexlScript) script.jjtAccept(visitor, null); } diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/ExpandCompositeTerms.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/ExpandCompositeTerms.java index 931ad778bae..f10226243b3 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/ExpandCompositeTerms.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/ExpandCompositeTerms.java @@ -47,7 +47,7 @@ import datawave.query.composite.CompositeRange; import datawave.query.composite.CompositeTerm; import datawave.query.composite.CompositeUtils; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.exceptions.DatawaveFatalQueryException; import datawave.query.jexl.JexlASTHelper; import datawave.query.jexl.JexlNodeFactory; @@ -65,7 +65,7 @@ public class ExpandCompositeTerms extends RebuildingVisitor { private static final Logger log = ThreadConfigurableLogger.getLogger(ExpandCompositeTerms.class); - private final ShardQueryConfiguration config; + private final ImmutableShardQueryConfiguration config; private final HashMap jexlNodeToCompMap = new HashMap<>(); @@ -75,7 +75,7 @@ private static class ExpandData { public Multimap usedAndedNodes = LinkedHashMultimap.create(); } - private ExpandCompositeTerms(ShardQueryConfiguration config) { + private ExpandCompositeTerms(ImmutableShardQueryConfiguration config) { Preconditions.checkNotNull(config); this.config = config; } @@ -92,7 +92,7 @@ private ExpandCompositeTerms(ShardQueryConfiguration config) { * @return An expanded version of the passed-in script containing composite nodes */ @SuppressWarnings("unchecked") - public static T expandTerms(ShardQueryConfiguration config, T script) { + public static T expandTerms(ImmutableShardQueryConfiguration config, T script) { ExpandCompositeTerms visitor = new ExpandCompositeTerms(config); diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/ExpandMultiNormalizedTerms.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/ExpandMultiNormalizedTerms.java index ab5fa6195cc..d5f1c20803d 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/ExpandMultiNormalizedTerms.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/ExpandMultiNormalizedTerms.java @@ -47,7 +47,7 @@ import datawave.data.type.OneToManyNormalizerType; import datawave.data.type.Type; import datawave.query.Constants; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.exceptions.DatawaveFatalQueryException; import datawave.query.jexl.JexlASTHelper; import datawave.query.jexl.JexlASTHelper.IdentifierOpLiteral; @@ -69,11 +69,11 @@ public class ExpandMultiNormalizedTerms extends RebuildingVisitor { private static final Logger log = ThreadConfigurableLogger.getLogger(ExpandMultiNormalizedTerms.class); - private final ShardQueryConfiguration config; + private final ImmutableShardQueryConfiguration config; private final HashSet expandedNodes; private final MetadataHelper helper; - public ExpandMultiNormalizedTerms(ShardQueryConfiguration config, MetadataHelper helper) { + public ExpandMultiNormalizedTerms(ImmutableShardQueryConfiguration config, MetadataHelper helper) { Preconditions.checkNotNull(config); Preconditions.checkNotNull(helper); @@ -96,7 +96,7 @@ public ExpandMultiNormalizedTerms(ShardQueryConfiguration config, MetadataHelper * @return a reference to the node */ @SuppressWarnings("unchecked") - public static T expandTerms(ShardQueryConfiguration config, MetadataHelper helper, T script) { + public static T expandTerms(ImmutableShardQueryConfiguration config, MetadataHelper helper, T script) { ExpandMultiNormalizedTerms visitor = new ExpandMultiNormalizedTerms(config, helper); if (null == visitor.config.getQueryFieldsDatatypes()) { diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/FixUnindexedNumericTerms.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/FixUnindexedNumericTerms.java index 6a26d8194fc..b6cdb98b862 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/FixUnindexedNumericTerms.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/FixUnindexedNumericTerms.java @@ -16,7 +16,7 @@ import com.google.common.base.Preconditions; import datawave.data.type.Type; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.exceptions.DatawaveFatalQueryException; import datawave.query.jexl.JexlASTHelper; import datawave.query.jexl.JexlASTHelper.IdentifierOpLiteral; @@ -29,9 +29,9 @@ */ public class FixUnindexedNumericTerms extends RebuildingVisitor { - private final ShardQueryConfiguration config; + private final ImmutableShardQueryConfiguration config; - public FixUnindexedNumericTerms(ShardQueryConfiguration config) { + public FixUnindexedNumericTerms(ImmutableShardQueryConfiguration config) { Preconditions.checkNotNull(config); this.config = config; @@ -49,7 +49,7 @@ public FixUnindexedNumericTerms(ShardQueryConfiguration config) { * @return a jexl node */ @SuppressWarnings("unchecked") - public static T fixNumerics(ShardQueryConfiguration config, T script) { + public static T fixNumerics(ImmutableShardQueryConfiguration config, T script) { FixUnindexedNumericTerms visitor = new FixUnindexedNumericTerms(config); if (null == visitor.config.getQueryFieldsDatatypes()) { diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/FunctionIndexQueryExpansionVisitor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/FunctionIndexQueryExpansionVisitor.java index 4f49baae12e..fe97ece2a71 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/FunctionIndexQueryExpansionVisitor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/FunctionIndexQueryExpansionVisitor.java @@ -18,7 +18,7 @@ import org.apache.commons.jexl3.parser.ASTTrueNode; import org.apache.commons.jexl3.parser.JexlNode; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.jexl.JexlNodeFactory; import datawave.query.jexl.functions.ContentFunctionsDescriptor; import datawave.query.jexl.functions.JexlFunctionArgumentDescriptorFactory; @@ -35,11 +35,11 @@ */ public class FunctionIndexQueryExpansionVisitor extends RebuildingVisitor { - protected ShardQueryConfiguration config; + protected ImmutableShardQueryConfiguration config; protected MetadataHelper metadataHelper; protected DateIndexHelper dateIndexHelper; - public FunctionIndexQueryExpansionVisitor(ShardQueryConfiguration config, MetadataHelper metadataHelper, DateIndexHelper dateIndexHelper) { + public FunctionIndexQueryExpansionVisitor(ImmutableShardQueryConfiguration config, MetadataHelper metadataHelper, DateIndexHelper dateIndexHelper) { this.config = config; this.metadataHelper = metadataHelper; this.dateIndexHelper = dateIndexHelper; @@ -61,8 +61,8 @@ public FunctionIndexQueryExpansionVisitor(ShardQueryConfiguration config, Metada * @return The tree with additional index query portions */ @SuppressWarnings("unchecked") - public static T expandFunctions(ShardQueryConfiguration config, MetadataHelper metadataHelper, DateIndexHelper dateIndexHelper, - T script) { + public static T expandFunctions(ImmutableShardQueryConfiguration config, MetadataHelper metadataHelper, + DateIndexHelper dateIndexHelper, T script) { JexlNode copy = copy(script); FunctionIndexQueryExpansionVisitor visitor = new FunctionIndexQueryExpansionVisitor(config, metadataHelper, dateIndexHelper); diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PullupUnexecutableNodesVisitor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PullupUnexecutableNodesVisitor.java index 1ddce0d31c2..d03161d00e8 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PullupUnexecutableNodesVisitor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PullupUnexecutableNodesVisitor.java @@ -57,7 +57,7 @@ import org.apache.commons.jexl3.parser.JexlNode; import org.apache.log4j.Logger; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.jexl.JexlASTHelper; import datawave.query.jexl.nodes.QueryPropertyMarker; import datawave.query.util.MetadataHelper; @@ -69,14 +69,14 @@ public class PullupUnexecutableNodesVisitor extends BaseVisitor { protected MetadataHelper helper; - protected ShardQueryConfiguration config; + protected ImmutableShardQueryConfiguration config; protected Set nonEventFields; protected Set indexOnlyFields; protected Set indexedFields; protected boolean forFieldIndex; - public PullupUnexecutableNodesVisitor(ShardQueryConfiguration config, boolean forFieldIndex, Set indexedFields, Set indexOnlyFields, - Set nonEventFields, MetadataHelper helper) { + public PullupUnexecutableNodesVisitor(ImmutableShardQueryConfiguration config, boolean forFieldIndex, Set indexedFields, + Set indexOnlyFields, Set nonEventFields, MetadataHelper helper) { this.helper = helper; this.config = config; this.forFieldIndex = forFieldIndex; @@ -115,8 +115,8 @@ public PullupUnexecutableNodesVisitor(ShardQueryConfiguration config, boolean fo private static final Logger log = Logger.getLogger(PullupUnexecutableNodesVisitor.class); - public static JexlNode pullupDelayedPredicates(JexlNode queryTree, boolean forFieldIndex, ShardQueryConfiguration config, Set indexedFields, - Set indexOnlyFields, Set nonEventFields, MetadataHelper helper) { + public static JexlNode pullupDelayedPredicates(JexlNode queryTree, boolean forFieldIndex, ImmutableShardQueryConfiguration config, + Set indexedFields, Set indexOnlyFields, Set nonEventFields, MetadataHelper helper) { PullupUnexecutableNodesVisitor visitor = new PullupUnexecutableNodesVisitor(config, forFieldIndex, indexedFields, indexOnlyFields, nonEventFields, helper); diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PushdownLargeFieldedListsVisitor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PushdownLargeFieldedListsVisitor.java index 1b381891077..3ad042816a6 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PushdownLargeFieldedListsVisitor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PushdownLargeFieldedListsVisitor.java @@ -45,7 +45,7 @@ import datawave.core.common.logging.ThreadConfigurableLogger; import datawave.core.iterators.DatawaveFieldIndexListIteratorJexl; import datawave.query.Constants; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.exceptions.DatawaveFatalQueryException; import datawave.query.jexl.JexlASTHelper; import datawave.query.jexl.LiteralRange; @@ -62,12 +62,12 @@ public class PushdownLargeFieldedListsVisitor extends RebuildingVisitor { private static final Logger log = ThreadConfigurableLogger.getLogger(PushdownLargeFieldedListsVisitor.class); - private ShardQueryConfiguration config; + private ImmutableShardQueryConfiguration config; private String fstHdfsUri; private FileSystem fs; private Set fields; - public PushdownLargeFieldedListsVisitor(ShardQueryConfiguration config, FileSystem fs, String fstHdfsUri, Set fields) { + public PushdownLargeFieldedListsVisitor(ImmutableShardQueryConfiguration config, FileSystem fs, String fstHdfsUri, Set fields) { this.config = config; this.fstHdfsUri = fstHdfsUri; this.fs = fs; @@ -90,16 +90,17 @@ public PushdownLargeFieldedListsVisitor(ShardQueryConfiguration config, FileSyst * @return The tree with additional index query portions */ @SuppressWarnings("unchecked") - public static T pushdown(ShardQueryConfiguration config, T script, FileSystem fs, String fstHdfsUri) { + public static T pushdown(ImmutableShardQueryConfiguration config, T script, FileSystem fs, String fstHdfsUri) { return pushdown(config, script, fs, fstHdfsUri, null, null); } - public static T pushdown(ShardQueryConfiguration config, T script, FileSystem fs, String fstHdfsUri, + public static T pushdown(ImmutableShardQueryConfiguration config, T script, FileSystem fs, String fstHdfsUri, Map pushdownCapacity) { return pushdown(config, script, fs, fstHdfsUri, pushdownCapacity, null); } - public static T pushdown(ShardQueryConfiguration config, T script, FileSystem fs, String fstHdfsUri, Object data, Set fields) { + public static T pushdown(ImmutableShardQueryConfiguration config, T script, FileSystem fs, String fstHdfsUri, Object data, + Set fields) { // flatten the tree script = TreeFlatteningRebuildingVisitor.flatten(script); diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PushdownLowSelectivityNodesVisitor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PushdownLowSelectivityNodesVisitor.java index 44c9d481406..315f124eed7 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PushdownLowSelectivityNodesVisitor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PushdownLowSelectivityNodesVisitor.java @@ -13,7 +13,7 @@ import org.apache.log4j.Logger; import datawave.data.MetadataCardinalityCounts; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.jexl.JexlASTHelper; import datawave.query.jexl.nodes.QueryPropertyMarker; import datawave.query.util.MetadataHelper; @@ -24,16 +24,16 @@ public class PushdownLowSelectivityNodesVisitor extends ShortCircuitBaseVisitor { protected MetadataHelper helper; - protected ShardQueryConfiguration config; + protected ImmutableShardQueryConfiguration config; - public PushdownLowSelectivityNodesVisitor(ShardQueryConfiguration config, MetadataHelper helper) { + public PushdownLowSelectivityNodesVisitor(ImmutableShardQueryConfiguration config, MetadataHelper helper) { this.helper = helper; this.config = config; } private static final Logger log = Logger.getLogger(PushdownLowSelectivityNodesVisitor.class); - public static T pushdownLowSelectiveTerms(T queryTree, ShardQueryConfiguration config, MetadataHelper helper) { + public static T pushdownLowSelectiveTerms(T queryTree, ImmutableShardQueryConfiguration config, MetadataHelper helper) { PushdownLowSelectivityNodesVisitor visitor = new PushdownLowSelectivityNodesVisitor(config, helper); queryTree.jjtAccept(visitor, null); return queryTree; diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PushdownMissingIndexRangeNodesVisitor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PushdownMissingIndexRangeNodesVisitor.java index a65dd7e36ba..361916c1676 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PushdownMissingIndexRangeNodesVisitor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PushdownMissingIndexRangeNodesVisitor.java @@ -17,8 +17,8 @@ import org.apache.commons.jexl3.parser.JexlNodes; import org.apache.log4j.Logger; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.config.IndexValueHole; -import datawave.query.config.ShardQueryConfiguration; import datawave.query.exceptions.DatawaveFatalQueryException; import datawave.query.jexl.JexlASTHelper; import datawave.query.jexl.LiteralRange; @@ -51,7 +51,7 @@ public class PushdownMissingIndexRangeNodesVisitor extends RebuildingVisitor { * @param helper * the metadata helper */ - public PushdownMissingIndexRangeNodesVisitor(ShardQueryConfiguration config, MetadataHelper helper) { + public PushdownMissingIndexRangeNodesVisitor(ImmutableShardQueryConfiguration config, MetadataHelper helper) { this.helper = helper; SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); this.beginDate = format.format(config.getBeginDate()); @@ -73,7 +73,7 @@ public PushdownMissingIndexRangeNodesVisitor(ShardQueryConfiguration config, Met * type of the query tree * @return a reference to the node */ - public static T pushdownPredicates(T queryTree, ShardQueryConfiguration config, MetadataHelper helper) { + public static T pushdownPredicates(T queryTree, ImmutableShardQueryConfiguration config, MetadataHelper helper) { PushdownMissingIndexRangeNodesVisitor visitor = new PushdownMissingIndexRangeNodesVisitor(config, helper); return (T) (queryTree.jjtAccept(visitor, null)); } diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PushdownUnexecutableNodesVisitor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PushdownUnexecutableNodesVisitor.java index 9df95261e65..b56ef28a180 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PushdownUnexecutableNodesVisitor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PushdownUnexecutableNodesVisitor.java @@ -56,7 +56,7 @@ import org.apache.commons.jexl3.parser.JexlNodes; import org.apache.log4j.Logger; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.jexl.nodes.QueryPropertyMarker; import datawave.query.util.MetadataHelper; @@ -67,14 +67,14 @@ public class PushdownUnexecutableNodesVisitor extends BaseVisitor { protected MetadataHelper helper; - protected ShardQueryConfiguration config; + protected ImmutableShardQueryConfiguration config; protected Set nonEventFields; protected Set indexOnlyFields; protected Set indexedFields; protected boolean forFieldIndex; - public PushdownUnexecutableNodesVisitor(ShardQueryConfiguration config, boolean forFieldIndex, Set indexedFields, Set indexOnlyFields, - Set nonEventFields, MetadataHelper helper) { + public PushdownUnexecutableNodesVisitor(ImmutableShardQueryConfiguration config, boolean forFieldIndex, Set indexedFields, + Set indexOnlyFields, Set nonEventFields, MetadataHelper helper) { this.helper = helper; this.config = config; this.forFieldIndex = forFieldIndex; @@ -113,7 +113,7 @@ public PushdownUnexecutableNodesVisitor(ShardQueryConfiguration config, boolean private static final Logger log = Logger.getLogger(PushdownUnexecutableNodesVisitor.class); - public static JexlNode pushdownPredicates(JexlNode queryTree, boolean forFieldIndex, ShardQueryConfiguration config, Set indexedFields, + public static JexlNode pushdownPredicates(JexlNode queryTree, boolean forFieldIndex, ImmutableShardQueryConfiguration config, Set indexedFields, Set indexOnlyFields, Set nonEventFields, MetadataHelper helper) { PushdownUnexecutableNodesVisitor visitor = new PushdownUnexecutableNodesVisitor(config, forFieldIndex, indexedFields, indexOnlyFields, nonEventFields, helper); diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/RegexFunctionVisitor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/RegexFunctionVisitor.java index 01e66df21bc..3347ba845d3 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/RegexFunctionVisitor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/RegexFunctionVisitor.java @@ -15,7 +15,7 @@ import org.apache.log4j.Logger; import datawave.core.common.logging.ThreadConfigurableLogger; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.exceptions.DatawaveFatalQueryException; import datawave.query.jexl.JexlASTHelper; import datawave.query.jexl.JexlNodeFactory; @@ -40,13 +40,14 @@ public class RegexFunctionVisitor extends FunctionIndexQueryExpansionVisitor { protected Set indexOnlyFields; - public RegexFunctionVisitor(ShardQueryConfiguration config, MetadataHelper metadataHelper, Set indexOnlyFields) { + public RegexFunctionVisitor(ImmutableShardQueryConfiguration config, MetadataHelper metadataHelper, Set indexOnlyFields) { super(config, metadataHelper, null); this.indexOnlyFields = indexOnlyFields; } @SuppressWarnings("unchecked") - public static T expandRegex(ShardQueryConfiguration config, MetadataHelper metadataHelper, Set indexOnlyFields, T script) { + public static T expandRegex(ImmutableShardQueryConfiguration config, MetadataHelper metadataHelper, Set indexOnlyFields, + T script) { RegexFunctionVisitor visitor = new RegexFunctionVisitor(config, metadataHelper, indexOnlyFields); JexlNode root = (T) script.jjtAccept(visitor, null); root = TreeFlatteningRebuildingVisitor.flatten(root); diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/RegexIndexExpansionVisitor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/RegexIndexExpansionVisitor.java index 6bdf4300ff4..0929ddb5322 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/RegexIndexExpansionVisitor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/RegexIndexExpansionVisitor.java @@ -34,7 +34,7 @@ import com.google.common.collect.Maps; import datawave.query.Constants; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.exceptions.DatawaveFatalQueryException; import datawave.query.exceptions.EmptyUnfieldedTermExpansionException; import datawave.query.jexl.JexlASTHelper; @@ -70,13 +70,13 @@ enum Join { } // The constructor should not be made public so that we can ensure that the executor is setup and shutdown correctly - protected RegexIndexExpansionVisitor(ShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper, + protected RegexIndexExpansionVisitor(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper, Map lookupMap) throws TableNotFoundException { this(config, scannerFactory, helper, lookupMap, "RegexIndexExpansion"); } // The constructor should not be made public so that we can ensure that the executor is setup and shutdown correctly - protected RegexIndexExpansionVisitor(ShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper, + protected RegexIndexExpansionVisitor(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper, Map lookupMap, String threadName) throws TableNotFoundException { super(config, scannerFactory, helper, lookupMap, threadName); @@ -111,7 +111,7 @@ protected RegexIndexExpansionVisitor(ShardQueryConfiguration config, ScannerFact * @throws TableNotFoundException * if we fail to retrieve fields from the metadata helper */ - public static T expandRegex(ShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper, + public static T expandRegex(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper, Map lookupMap, T script) throws TableNotFoundException { RegexIndexExpansionVisitor visitor = new RegexIndexExpansionVisitor(config, scannerFactory, helper, lookupMap); return ensureTreeNotEmpty(visitor.expand(script)); @@ -142,7 +142,7 @@ private static T ensureTreeNotEmpty(T script) throws EmptyU * @throws TableNotFoundException * if we fail to retrieve fields from the metadata helper */ - public static T expandRegex(ShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper, T script) + public static T expandRegex(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper, T script) throws TableNotFoundException { return expandRegex(config, scannerFactory, helper, null, script); } diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/SetMembershipVisitor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/SetMembershipVisitor.java index 67d0c3715a3..59643a2b235 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/SetMembershipVisitor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/SetMembershipVisitor.java @@ -23,7 +23,7 @@ import org.apache.commons.jexl3.parser.JexlNode; import org.apache.commons.jexl3.parser.JexlNodes; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.exceptions.DatawaveFatalQueryException; import datawave.query.jexl.IndexOnlyJexlContext; import datawave.query.jexl.JexlASTHelper; @@ -46,7 +46,7 @@ public class SetMembershipVisitor extends BaseVisitor { private static final int FUNCTION_SEARCH_DEPTH_LIMIT = 7; private final Set fields; - private final ShardQueryConfiguration config; + private final ImmutableShardQueryConfiguration config; private final Set discoveredFields; private final boolean fullTraversal; private final boolean tagIndexOnlyFields; @@ -63,7 +63,7 @@ public class SetMembershipVisitor extends BaseVisitor { * @return true if the query contains any of the fields present in the given fields set */ - public static Boolean contains(Set fields, ShardQueryConfiguration config, JexlNode tree) { + public static Boolean contains(Set fields, ImmutableShardQueryConfiguration config, JexlNode tree) { SetMembershipVisitor visitor = new SetMembershipVisitor(fields, config, false, false); return (Boolean) tree.jjtAccept(visitor, false); } @@ -79,7 +79,7 @@ public static Boolean contains(Set fields, ShardQueryConfiguration confi * the query tree * @return the set of fields found in the query that were in the given set of fields */ - public static Set getMembers(Set fields, ShardQueryConfiguration config, JexlNode tree) { + public static Set getMembers(Set fields, ImmutableShardQueryConfiguration config, JexlNode tree) { return getMembers(fields, config, tree, false); } @@ -101,13 +101,13 @@ public static Set getMembers(Set fields, ShardQueryConfiguration * if tagIndexOnlyFields is true, but lazySetMechanism in the given config is false and an index-only field was encountered. Note, in this case, * it is assumed that the given set of fields consists of index-only fields. */ - public static Set getMembers(Set fields, ShardQueryConfiguration config, JexlNode tree, boolean tagIndexOnlyFields) { + public static Set getMembers(Set fields, ImmutableShardQueryConfiguration config, JexlNode tree, boolean tagIndexOnlyFields) { final SetMembershipVisitor visitor = new SetMembershipVisitor(fields, config, true, tagIndexOnlyFields); tree.jjtAccept(visitor, false); return visitor.discoveredFields; } - private SetMembershipVisitor(Set fields, ShardQueryConfiguration config, boolean fullTraversal, boolean tagIndexOnlyFields) { + private SetMembershipVisitor(Set fields, ImmutableShardQueryConfiguration config, boolean fullTraversal, boolean tagIndexOnlyFields) { this.config = config; this.fields = fields; this.discoveredFields = new TreeSet<>(); @@ -303,8 +303,8 @@ public Object visit(ASTReferenceExpression node, Object data) { /** * Returns true if {@link SetMembershipVisitor#fullTraversal} is true, otherwise return the inverse of matchFound. This allows us to stop traversing the - * query tree as soon as a match has been found for {@link SetMembershipVisitor#contains(Set, ShardQueryConfiguration, JexlNode)} where a full traversal may - * not be required. + * query tree as soon as a match has been found for {@link SetMembershipVisitor#contains(Set, ImmutableShardQueryConfiguration, JexlNode)} where a full + * traversal may not be required. * * @param matchFound * whether a match has been found yet diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/UnfieldedIndexExpansionVisitor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/UnfieldedIndexExpansionVisitor.java index 3a42c37ca6a..f95ca09c7a8 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/UnfieldedIndexExpansionVisitor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/UnfieldedIndexExpansionVisitor.java @@ -21,7 +21,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.exceptions.DatawaveFatalQueryException; import datawave.query.exceptions.EmptyUnfieldedTermExpansionException; import datawave.query.jexl.JexlASTHelper; @@ -46,7 +46,7 @@ public class UnfieldedIndexExpansionVisitor extends RegexIndexExpansionVisitor { protected Set expansionFields; // The constructor should not be made public so that we can ensure that the executor is setup and shutdown correctly - protected UnfieldedIndexExpansionVisitor(ShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper) + protected UnfieldedIndexExpansionVisitor(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper) throws TableNotFoundException, IllegalAccessException, InstantiationException { super(config, scannerFactory, helper, null, "FieldNameIndexExpansion"); @@ -79,8 +79,8 @@ protected UnfieldedIndexExpansionVisitor(ShardQueryConfiguration config, Scanner * @throws InstantiationException * if we fail to retrieve all data types from the metadata helper */ - public static T expandUnfielded(ShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper, T script) - throws IllegalAccessException, TableNotFoundException, InstantiationException { + public static T expandUnfielded(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper, + T script) throws IllegalAccessException, TableNotFoundException, InstantiationException { // if not expanding fields or values, then this is a noop if (config.isExpandFields() || config.isExpandValues()) { UnfieldedIndexExpansionVisitor visitor = new UnfieldedIndexExpansionVisitor(config, scannerFactory, helper); diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/whindex/WhindexVisitor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/whindex/WhindexVisitor.java index 5fb688997e4..cd93c9d638a 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/whindex/WhindexVisitor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/whindex/WhindexVisitor.java @@ -40,7 +40,7 @@ import com.google.common.collect.Multimap; import datawave.core.common.logging.ThreadConfigurableLogger; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.jexl.JexlASTHelper; import datawave.query.jexl.JexlNodeFactory; import datawave.query.jexl.LiteralRange; @@ -91,7 +91,7 @@ private static class ExpandData { public Multimap usedAndedNodes = LinkedHashMultimap.create(); } - private WhindexVisitor(ShardQueryConfiguration config, Date beginDate, MetadataHelper metadataHelper) { + private WhindexVisitor(ImmutableShardQueryConfiguration config, Date beginDate, MetadataHelper metadataHelper) { this(config.getWhindexMappingFields(), config.getWhindexFieldMappings(), config.getWhindexCreationDates(), beginDate, metadataHelper); } @@ -119,7 +119,7 @@ private WhindexVisitor(Set mappingFields, Map> * the metadata helper * @return An expanded version of the passed-in script containing whindex nodes */ - public static T apply(T script, ShardQueryConfiguration config, Date beginDate, MetadataHelper metadataHelper) { + public static T apply(T script, ImmutableShardQueryConfiguration config, Date beginDate, MetadataHelper metadataHelper) { WhindexVisitor visitor = new WhindexVisitor(config, beginDate, metadataHelper); return apply(script, visitor); diff --git a/warehouse/query-core/src/main/java/datawave/query/planner/pushdown/CostEstimator.java b/warehouse/query-core/src/main/java/datawave/query/planner/pushdown/CostEstimator.java index 9d9c2bcc7a9..986a2697dff 100644 --- a/warehouse/query-core/src/main/java/datawave/query/planner/pushdown/CostEstimator.java +++ b/warehouse/query-core/src/main/java/datawave/query/planner/pushdown/CostEstimator.java @@ -10,7 +10,7 @@ import org.apache.log4j.Logger; import datawave.query.Constants; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.jexl.JexlASTHelper; import datawave.query.parser.JavaRegexAnalyzer; import datawave.query.parser.JavaRegexAnalyzer.JavaRegexParseException; @@ -23,7 +23,7 @@ public class CostEstimator { private static final Logger log = Logger.getLogger(CostEstimator.class); - protected ShardQueryConfiguration config; + protected ImmutableShardQueryConfiguration config; protected MetadataHelper helper; protected ScannerFactory scannerFactory; @@ -33,7 +33,7 @@ public CostEstimator(PushDownVisitor visitor) { this.scannerFactory = visitor.getScannerFactory(); } - public CostEstimator(ShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper) { + public CostEstimator(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper) { this.config = config; this.helper = helper; this.scannerFactory = scannerFactory; diff --git a/warehouse/query-core/src/main/java/datawave/query/scheduler/PushdownFunction.java b/warehouse/query-core/src/main/java/datawave/query/scheduler/PushdownFunction.java index 9c8e77cb2d8..b6467df3e4a 100644 --- a/warehouse/query-core/src/main/java/datawave/query/scheduler/PushdownFunction.java +++ b/warehouse/query-core/src/main/java/datawave/query/scheduler/PushdownFunction.java @@ -16,7 +16,7 @@ import com.google.common.collect.Lists; import datawave.core.query.configuration.QueryData; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.iterator.QueryOptions; import datawave.query.tables.BatchScannerSession; import datawave.query.tables.SessionOptions; @@ -35,14 +35,14 @@ public class PushdownFunction implements Function> /** * The shard query config */ - private final ShardQueryConfiguration config; + private final ImmutableShardQueryConfiguration config; // any custom settings protected Collection customSettings; // table id, used to apply execution hints protected TableId tableId; @Deprecated - public PushdownFunction(TabletLocator tabletLocator, ShardQueryConfiguration config, Collection settings, TableId tableId) { + public PushdownFunction(TabletLocator tabletLocator, ImmutableShardQueryConfiguration config, Collection settings, TableId tableId) { this(config, settings, tableId); } @@ -56,7 +56,7 @@ public PushdownFunction(TabletLocator tabletLocator, ShardQueryConfiguration con * @param tableId * the table id */ - public PushdownFunction(ShardQueryConfiguration config, Collection settings, TableId tableId) { + public PushdownFunction(ImmutableShardQueryConfiguration config, Collection settings, TableId tableId) { this.config = config; this.customSettings = settings; this.tableId = tableId; @@ -114,7 +114,7 @@ public List apply(QueryData qd) { return chunks; } - protected ShardQueryConfiguration getConfig() { + protected ImmutableShardQueryConfiguration getConfig() { return config; } } diff --git a/warehouse/query-core/src/main/java/datawave/query/scheduler/PushdownScheduler.java b/warehouse/query-core/src/main/java/datawave/query/scheduler/PushdownScheduler.java index c6a393cfeff..a843f86eb55 100644 --- a/warehouse/query-core/src/main/java/datawave/query/scheduler/PushdownScheduler.java +++ b/warehouse/query-core/src/main/java/datawave/query/scheduler/PushdownScheduler.java @@ -35,7 +35,7 @@ import datawave.core.query.logic.QueryCheckpoint; import datawave.core.query.logic.QueryKey; import datawave.mr.bulk.RfileResource; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.tables.BatchScannerSession; import datawave.query.tables.ScannerFactory; import datawave.query.tables.ShardQueryLogic; @@ -56,7 +56,7 @@ public class PushdownScheduler extends Scheduler { /** * Configuration reference. */ - protected final ShardQueryConfiguration config; + protected final ImmutableShardQueryConfiguration config; /** * Scanner factory reference. */ @@ -81,11 +81,11 @@ public class PushdownScheduler extends Scheduler { protected MetadataHelper metadataHelper; - public PushdownScheduler(ShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelperFactory metaFactory) { + public PushdownScheduler(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelperFactory metaFactory) { this(config, scannerFactory, metaFactory.createMetadataHelper(config.getClient(), config.getMetadataTableName(), config.getAuthorizations())); } - protected PushdownScheduler(ShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper) { + protected PushdownScheduler(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, MetadataHelper helper) { this.config = config; this.metadataHelper = helper; this.scannerFactory = scannerFactory; @@ -222,7 +222,7 @@ public void close() { * @see Scheduler#createBatchScanner(ShardQueryConfiguration, datawave.query.tables.ScannerFactory, datawave.webservice.query.configuration.QueryData) */ @Override - public BatchScanner createBatchScanner(ShardQueryConfiguration config, ScannerFactory scannerFactory, QueryData qd) throws TableNotFoundException { + public BatchScanner createBatchScanner(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, QueryData qd) throws TableNotFoundException { return ShardQueryLogic.createBatchScanner(config, scannerFactory, qd); } diff --git a/warehouse/query-core/src/main/java/datawave/query/scheduler/Scheduler.java b/warehouse/query-core/src/main/java/datawave/query/scheduler/Scheduler.java index 68db69dc8a4..9054940d99d 100644 --- a/warehouse/query-core/src/main/java/datawave/query/scheduler/Scheduler.java +++ b/warehouse/query-core/src/main/java/datawave/query/scheduler/Scheduler.java @@ -14,14 +14,15 @@ import datawave.core.query.logic.QueryCheckpoint; import datawave.core.query.logic.QueryKey; import datawave.query.CloseableIterable; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.tables.ScannerFactory; import datawave.query.tables.stats.ScanSessionStats; public abstract class Scheduler implements CloseableIterable { protected Collection settings = Lists.newArrayList(); - public abstract BatchScanner createBatchScanner(ShardQueryConfiguration config, ScannerFactory scannerFactory, QueryData qd) throws TableNotFoundException; + public abstract BatchScanner createBatchScanner(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, QueryData qd) + throws TableNotFoundException; /** * Returns the scan session stats provided by this scheduler diff --git a/warehouse/query-core/src/main/java/datawave/query/tables/BatchScannerSession.java b/warehouse/query-core/src/main/java/datawave/query/tables/BatchScannerSession.java index 7abc100fe12..1888a097885 100644 --- a/warehouse/query-core/src/main/java/datawave/query/tables/BatchScannerSession.java +++ b/warehouse/query-core/src/main/java/datawave/query/tables/BatchScannerSession.java @@ -41,7 +41,7 @@ import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.Service; -import datawave.core.query.configuration.GenericQueryConfiguration; +import datawave.core.query.configuration.ImmutableGenericQueryConfiguration; import datawave.core.query.configuration.QueryData; import datawave.core.query.configuration.Result; import datawave.core.query.configuration.ResultContext; @@ -62,7 +62,7 @@ public class BatchScannerSession extends ScannerSession implements Iterator { protected static FileSystemCache fileSystemCache = null; - private ShardQueryConfiguration config; + private ImmutableShardQueryConfiguration config; protected MetadataHelper metadataHelper; protected Set indexedFields; protected Set indexOnlyFields; @@ -93,7 +93,7 @@ public class VisitorFunction implements Function { private static final Logger log = Logger.getLogger(VisitorFunction.class); - public VisitorFunction(ShardQueryConfiguration config, MetadataHelper metadataHelper) throws MalformedURLException { + public VisitorFunction(ImmutableShardQueryConfiguration config, MetadataHelper metadataHelper) throws MalformedURLException { this.config = config; if (VisitorFunction.fileSystemCache == null && this.config.getHdfsSiteConfigURLs() != null) { @@ -622,7 +622,7 @@ protected void pruneQueryOptions(ASTJexlScript script, IteratorSetting settings) // push down large fielded lists. Assumes that the hdfs query cache uri and // site config urls are configured - protected ASTJexlScript pushdownLargeFieldedLists(ShardQueryConfiguration config, ASTJexlScript queryTree) throws IOException { + protected ASTJexlScript pushdownLargeFieldedLists(ImmutableShardQueryConfiguration config, ASTJexlScript queryTree) throws IOException { Query settings = config.getQuery(); if (config.canHandleExceededValueThreshold()) { @@ -693,7 +693,7 @@ protected ASTJexlScript pushdownLargeFieldedLists(ShardQueryConfiguration config } } - protected URI getFstHdfsQueryCacheUri(ShardQueryConfiguration config, Query settings) { + protected URI getFstHdfsQueryCacheUri(ImmutableShardQueryConfiguration config, Query settings) { if (config.getIvaratorFstHdfsBaseURIs() != null && !config.getIvaratorFstHdfsBaseURIs().isEmpty()) { String[] choices = config.getIvaratorFstHdfsBaseURIs().split(","); int index = random.nextInt(choices.length); diff --git a/warehouse/query-core/src/test/java/datawave/query/config/ShardQueryConfigurationTest.java b/warehouse/query-core/src/test/java/datawave/query/config/ShardQueryConfigurationTest.java index b94861046ae..a03755e362d 100644 --- a/warehouse/query-core/src/test/java/datawave/query/config/ShardQueryConfigurationTest.java +++ b/warehouse/query-core/src/test/java/datawave/query/config/ShardQueryConfigurationTest.java @@ -1,6 +1,7 @@ package datawave.query.config; import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.Collections; @@ -654,6 +655,43 @@ private ArrayListMultimap createArrayListMultimap(Multimap m return arrayListMultimap; } + @Test + public void testImmutableInterfaceHasAllGetters() throws Exception { + ShardQueryConfiguration config = ShardQueryConfiguration.create(); + ObjectMapper mapper = JsonMapper.builder().enable(MapperFeature.PROPAGATE_TRANSIENT_MARKER).build(); + JsonNode root = mapper.readTree(mapper.writeValueAsString(config)); + for (Iterator it = root.fieldNames(); it.hasNext();) { + String fieldName = it.next(); + Method getter = getGetterMethod(ImmutableShardQueryConfiguration.class, fieldName); + Assert.assertNotNull("Expected getter for " + fieldName + " on " + ImmutableShardQueryConfiguration.class.getSimpleName(), getter); + } + } + + @Test + public void testImmutableInterfaceHasNoSetters() { + for (Map.Entry entry : updatedValues.entrySet()) { + try { + Class valueClass = (entry.getValue() == null ? Object.class : entry.getValue().getClass()); + getSetterMethod(ImmutableShardQueryConfiguration.class, entry.getKey(), valueClass); + Assert.fail("Did not expect to find setter method for " + entry.getKey() + " on " + ImmutableShardQueryConfiguration.class.getSimpleName() + + " interface"); + } catch (NoSuchMethodException ne) { + // expected + } + } + + for (Map.Entry entry : extraValuesToSet.entrySet()) { + try { + Class valueClass = (entry.getValue() == null ? Object.class : entry.getValue().getClass()); + getSetterMethod(ImmutableShardQueryConfiguration.class, entry.getKey(), valueClass); + Assert.fail("Did not expect to find setter method for " + entry.getKey() + " on " + ImmutableShardQueryConfiguration.class.getSimpleName() + + " interface"); + } catch (NoSuchMethodException ne) { + // expected + } + } + } + private void testValues(ShardQueryConfiguration config, Map values, Map predicates) throws Exception { ObjectMapper mapper = JsonMapper.builder().enable(MapperFeature.PROPAGATE_TRANSIENT_MARKER).build(); JsonNode root = mapper.readTree(mapper.writeValueAsString(config)); @@ -695,44 +733,60 @@ public boolean isUnorderedListEqual(String expected, String actual) { return expectedSet.equals(actualSet); } - public Object getValue(Object source, String fieldName) throws InvocationTargetException, IllegalAccessException, NoSuchMethodException { + public Method getGetterMethod(Class clas, String fieldName) throws NoSuchMethodException { String getter = "get" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1); try { - return source.getClass().getMethod(getter).invoke(source); + return clas.getMethod(getter); } catch (NoSuchMethodException e) { getter = "is" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1); - return source.getClass().getMethod(getter).invoke(source); + return clas.getMethod(getter); } } + public Method getGetterMethod(Object source, String fieldName) throws NoSuchMethodException { + return getGetterMethod(source.getClass(), fieldName); + } + + public Object getValue(Object source, String fieldName) throws InvocationTargetException, IllegalAccessException, NoSuchMethodException { + return getGetterMethod(source, fieldName).invoke(source); + } + public void setValue(Object source, String fieldName, Object value) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { setValue(source, fieldName, value, value.getClass()); } - public Object setValue(Object source, String fieldName, Object value, Class valueClass) - throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { - String getter = "set" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1); + public Method getSetterMethod(Class clas, String fieldName, Class valueClass) throws NoSuchMethodException { + String setter = "set" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1); try { - return source.getClass().getMethod(getter, valueClass).invoke(source, value); + return clas.getMethod(setter, valueClass); } catch (NoSuchMethodException e) { if (primitiveMap.containsKey(valueClass)) { - return setValue(source, fieldName, value, primitiveMap.get(valueClass)); + return clas.getMethod(setter, primitiveMap.get(valueClass)); } else if (!valueClass.equals(Object.class) && !valueClass.isPrimitive()) { for (Class infc : valueClass.getInterfaces()) { try { - return setValue(source, fieldName, value, infc); + return getSetterMethod(clas, fieldName, infc); } catch (NoSuchMethodException e2) { // try next one } } if (!valueClass.isInterface()) { - return setValue(source, fieldName, value, valueClass.getSuperclass()); + return getSetterMethod(clas, fieldName, valueClass.getSuperclass()); } } throw e; } } + public Method getSetterMethod(Object source, String fieldName, Class valueClass) throws NoSuchMethodException { + return getSetterMethod(source.getClass(), fieldName, valueClass); + } + + public Object setValue(Object source, String fieldName, Object value, Class valueClass) + throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { + return getSetterMethod(source, fieldName, valueClass).invoke(source, value); + } + /** * Assert expected default values from an empty constructor call */ From d2cd20cc833f05b777f651be79345ad86172acf7 Mon Sep 17 00:00:00 2001 From: Ivan Bella <347158+ivakegg@users.noreply.github.com> Date: Fri, 8 Aug 2025 20:01:19 +0000 Subject: [PATCH 3/3] Updated to find correct constructor --- .../main/java/datawave/query/planner/DefaultQueryPlanner.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/warehouse/query-core/src/main/java/datawave/query/planner/DefaultQueryPlanner.java b/warehouse/query-core/src/main/java/datawave/query/planner/DefaultQueryPlanner.java index 2795135101f..f3ecce4b933 100644 --- a/warehouse/query-core/src/main/java/datawave/query/planner/DefaultQueryPlanner.java +++ b/warehouse/query-core/src/main/java/datawave/query/planner/DefaultQueryPlanner.java @@ -34,6 +34,7 @@ import java.util.regex.PatternSyntaxException; import java.util.stream.Collectors; +import datawave.query.config.ImmutableShardQueryConfiguration; import org.apache.accumulo.core.client.AccumuloException; import org.apache.accumulo.core.client.AccumuloSecurityException; import org.apache.accumulo.core.client.IteratorSetting; @@ -3203,7 +3204,7 @@ private RangeStream initializeRangeStream(ShardQueryConfiguration config, Scanne try { rstream = Class.forName(rangeStreamClass).asSubclass(RangeStream.class); - RangeStream stream = rstream.getConstructor(ShardQueryConfiguration.class, ScannerFactory.class, MetadataHelper.class).newInstance(config, + RangeStream stream = rstream.getConstructor(ImmutableShardQueryConfiguration.class, ScannerFactory.class, MetadataHelper.class).newInstance(config, scannerFactory, metadataHelper); // @formatter:off