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 f08ac4b4481..1e93f04f5a3 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 f65bb070ab4..b5c635ecfc4 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 4b5df080b29..2d26bced2f3 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 @@ -16,7 +16,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; @@ -39,7 +39,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()); @@ -53,7 +53,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..ad513c61218 --- /dev/null +++ b/warehouse/query-core/src/main/java/datawave/query/config/ImmutableShardQueryConfiguration.java @@ -0,0 +1,523 @@ +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.config.annotation.AllHitsQueryConfig; +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(); + + int getEventPerDayThreshold(); + + int getShardsPerDayThreshold(); + + int getInitialMaxTermThreshold(); + + int getIntermediateMaxTermThreshold(); + + int getIndexedMaxTermThreshold(); + + int getFinalMaxTermThreshold(); + + int getMaxDepthThreshold(); + + boolean isExpandFields(); + + int getMaxUnfieldedExpansionThreshold(); + + boolean isExpandValues(); + + boolean isExpandUnfieldedValues(); + + List> getExcludeUnfieldedTypes(); + + 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(); + + boolean isDisableIteratorMostRecentUniqueFields(); + + 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(); + + int getMaxYields(); + + 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 isDeferPushdownPullup(); + + String getDayIndexTableName(); + + String getYearIndexTableName(); + + boolean isUseShardedIndex(); + + int getDayIndexThreshold(); + + boolean isUseTruncatedIndex(); + + String getTruncatedIndexTableName(); + + AllHitsQueryConfig getAllHitsQueryConfig(); + + String getOriginalJexlQuery(); + + boolean isUseNewIndexLookups(); +} 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 f4c2256a407..a482ac15234 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 @@ -81,7 +81,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"; @@ -1021,6 +1022,7 @@ public void setTableName(String tableName) { this.shardTableName = tableName; } + @Override public String getMetadataTableName() { return metadataTableName; } @@ -1029,6 +1031,7 @@ public void setMetadataTableName(String metadataTableName) { this.metadataTableName = metadataTableName; } + @Override public String getDateIndexTableName() { return dateIndexTableName; } @@ -1037,6 +1040,7 @@ public void setDateIndexTableName(String dateIndexTableName) { this.dateIndexTableName = dateIndexTableName; } + @Override public String getDefaultDateTypeName() { return defaultDateTypeName; } @@ -1045,6 +1049,7 @@ public void setDefaultDateTypeName(String defaultDateTypeName) { this.defaultDateTypeName = defaultDateTypeName; } + @Override public String getIndexTableName() { return indexTableName; } @@ -1053,6 +1058,7 @@ public void setIndexTableName(String indexTableName) { this.indexTableName = indexTableName; } + @Override public String getReverseIndexTableName() { return reverseIndexTableName; } @@ -1061,6 +1067,7 @@ public void setReverseIndexTableName(String reverseIndexTableName) { this.reverseIndexTableName = reverseIndexTableName; } + @Override public String getIndexStatsTableName() { return indexStatsTableName; } @@ -1069,6 +1076,7 @@ public void setIndexStatsTableName(String statsTableName) { this.indexStatsTableName = statsTableName; } + @Override public Integer getNumQueryThreads() { return numQueryThreads; } @@ -1077,6 +1085,7 @@ public void setNumQueryThreads(Integer numQueryThreads) { this.numQueryThreads = numQueryThreads; } + @Override public Integer getNumIndexLookupThreads() { return numLookupThreads; } @@ -1085,6 +1094,7 @@ public void setNumIndexLookupThreads(Integer numIndexLookupThreads) { this.numLookupThreads = numIndexLookupThreads; } + @Override public Integer getNumDateIndexThreads() { return numDateIndexThreads; } @@ -1093,6 +1103,7 @@ public void setNumDateIndexThreads(Integer numDateIndexThreads) { this.numDateIndexThreads = numDateIndexThreads; } + @Override public Integer getMaxDocScanTimeout() { return maxDocScanTimeout; } @@ -1101,6 +1112,7 @@ public void setMaxDocScanTimeout(Integer maxDocScanTimeout) { this.maxDocScanTimeout = maxDocScanTimeout; } + @Override public float getCollapseDatePercentThreshold() { return collapseDatePercentThreshold; } @@ -1109,6 +1121,7 @@ public void setCollapseDatePercentThreshold(float collapseDatePercentThreshold) this.collapseDatePercentThreshold = collapseDatePercentThreshold; } + @Override public Boolean getFullTableScanEnabled() { return fullTableScanEnabled; } @@ -1117,6 +1130,7 @@ public void setFullTableScanEnabled(Boolean fullTableScanEnabled) { this.fullTableScanEnabled = fullTableScanEnabled; } + @Override public String getShardDateFormat() { return shardDateFormat; } @@ -1125,6 +1139,7 @@ public void setShardDateFormat(String shardDateFormat) { this.shardDateFormat = shardDateFormat; } + @Override public SimpleDateFormat getShardDateFormatter() { return shardDateFormatter; } @@ -1133,6 +1148,7 @@ public void setShardDateFormatter(SimpleDateFormat shardDateFormatter) { this.shardDateFormatter = shardDateFormatter; } + @Override public Set getDatatypeFilter() { return datatypeFilter; } @@ -1141,6 +1157,7 @@ public void setDatatypeFilter(Set typeFilter) { this.datatypeFilter = typeFilter; } + @Override public String getDatatypeFilterAsString() { return new TypeFilter(datatypeFilter).toString(); } @@ -1149,6 +1166,7 @@ private Set deconstruct(Collection fields) { return fields == null ? null : fields.stream().map(JexlASTHelper::deconstructIdentifier).collect(Collectors.toSet()); } + @Override public Set getProjectFields() { return projectFields; } @@ -1157,10 +1175,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; } @@ -1169,6 +1189,7 @@ public void setRenameFields(Set renameFields) { this.renameFields = renameFields; } + @Override public Set getDisallowlistedFields() { return disallowlistedFields; } @@ -1177,10 +1198,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; } @@ -1189,6 +1212,7 @@ public void setUseEnrichers(Boolean useEnrichers) { this.useEnrichers = useEnrichers; } + @Override public List getEnricherClassNames() { return enricherClassNames; } @@ -1197,6 +1221,7 @@ public void setEnricherClassNames(List enricherClassNames) { this.enricherClassNames = enricherClassNames; } + @Override public boolean isTldQuery() { return tldQuery; } @@ -1205,6 +1230,7 @@ public void setTldQuery(boolean tldQuery) { this.tldQuery = tldQuery; } + @Override public boolean isDebugMultithreadedSources() { return debugMultithreadedSources; } @@ -1213,6 +1239,7 @@ public void setDebugMultithreadedSources(boolean debugMultithreadedSources) { this.debugMultithreadedSources = debugMultithreadedSources; } + @Override public boolean isSortGeoWaveQueryRanges() { return sortGeoWaveQueryRanges; } @@ -1221,6 +1248,7 @@ public void setSortGeoWaveQueryRanges(boolean sortGeoWaveQueryRanges) { this.sortGeoWaveQueryRanges = sortGeoWaveQueryRanges; } + @Override public int getNumRangesToBuffer() { return numRangesToBuffer; } @@ -1229,6 +1257,7 @@ public void setNumRangesToBuffer(int numRangesToBuffer) { this.numRangesToBuffer = numRangesToBuffer; } + @Override public long getRangeBufferTimeoutMillis() { return rangeBufferTimeoutMillis; } @@ -1237,6 +1266,7 @@ public void setRangeBufferTimeoutMillis(long rangeBufferTimeoutMillis) { this.rangeBufferTimeoutMillis = rangeBufferTimeoutMillis; } + @Override public long getRangeBufferPollMillis() { return rangeBufferPollMillis; } @@ -1245,6 +1275,7 @@ public void setRangeBufferPollMillis(long rangeBufferPollMillis) { this.rangeBufferPollMillis = rangeBufferPollMillis; } + @Override public int getGeometryMaxExpansion() { return geometryMaxExpansion; } @@ -1253,6 +1284,7 @@ public void setGeometryMaxExpansion(int geometryMaxExpansion) { this.geometryMaxExpansion = geometryMaxExpansion; } + @Override public int getPointMaxExpansion() { return pointMaxExpansion; } @@ -1261,6 +1293,7 @@ public void setPointMaxExpansion(int pointMaxExpansion) { this.pointMaxExpansion = pointMaxExpansion; } + @Override public int getGeoMaxExpansion() { return geoMaxExpansion; } @@ -1269,6 +1302,7 @@ public void setGeoMaxExpansion(int geoMaxExpansion) { this.geoMaxExpansion = geoMaxExpansion; } + @Override public int getGeoWaveRangeSplitThreshold() { return geoWaveRangeSplitThreshold; } @@ -1277,6 +1311,7 @@ public void setGeoWaveRangeSplitThreshold(int geoWaveRangeSplitThreshold) { this.geoWaveRangeSplitThreshold = geoWaveRangeSplitThreshold; } + @Override public double getGeoWaveMaxRangeOverlap() { return geoWaveMaxRangeOverlap; } @@ -1285,6 +1320,7 @@ public void setGeoWaveMaxRangeOverlap(double geoWaveMaxRangeOverlap) { this.geoWaveMaxRangeOverlap = geoWaveMaxRangeOverlap; } + @Override public boolean isOptimizeGeoWaveRanges() { return optimizeGeoWaveRanges; } @@ -1293,6 +1329,7 @@ public void setOptimizeGeoWaveRanges(boolean optimizeGeoWaveRanges) { this.optimizeGeoWaveRanges = optimizeGeoWaveRanges; } + @Override public int getGeoWaveMaxEnvelopes() { return geoWaveMaxEnvelopes; } @@ -1301,6 +1338,7 @@ public void setGeoWaveMaxEnvelopes(int geoWaveMaxEnvelopes) { this.geoWaveMaxEnvelopes = geoWaveMaxEnvelopes; } + @Override public Boolean getUseFilters() { return useFilters; } @@ -1337,6 +1375,7 @@ public void putFilterOptions(final Map options) { } } + @Override public Map getFilterOptions() { return Collections.unmodifiableMap(filterOptions); } @@ -1346,6 +1385,7 @@ public void setFilterOptions(Map options) { this.filterOptions.putAll(options); } + @Override public List getFilterClassNames() { return filterClassNames; } @@ -1355,6 +1395,7 @@ public void setFilterClassNames(List filterClassNames) { this.filterClassNames = new ArrayList<>((filterClassNames != null ? filterClassNames : Collections.emptyList())); } + @Override public String getFieldRuleClassName() { return fieldRuleClassName; } @@ -1371,6 +1412,7 @@ public void setFieldRuleClassName(String fieldRuleClassName) { * @see QueryIterator * @see TLDQueryIterator */ + @Override public List getIndexFilteringClassNames() { return indexFilteringClassNames; } @@ -1387,6 +1429,7 @@ public void setIndexFilteringClassNames(List classNames) { this.indexFilteringClassNames = new ArrayList<>((classNames != null ? classNames : Collections.emptyList())); } + @Override public Class> getDefaultType() { return defaultType; } @@ -1404,6 +1447,7 @@ public void setDefaultType(String className) { } } + @Override public Set getNonEventKeyPrefixes() { return nonEventKeyPrefixes; } @@ -1416,10 +1460,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; } @@ -1433,6 +1479,7 @@ public void setUnevaluatedFields(Collection unevaluatedFields) { } @Deprecated(since = "7.1.0", forRemoval = true) + @Override public int getEventPerDayThreshold() { return eventPerDayThreshold; } @@ -1443,6 +1490,7 @@ public void setEventPerDayThreshold(int eventPerDayThreshold) { } @Deprecated(since = "7.1.0", forRemoval = true) + @Override public int getShardsPerDayThreshold() { return shardsPerDayThreshold; } @@ -1452,6 +1500,7 @@ public void setShardsPerDayThreshold(int shardsPerDayThreshold) { this.shardsPerDayThreshold = shardsPerDayThreshold; } + @Override public int getInitialMaxTermThreshold() { return initialMaxTermThreshold; } @@ -1460,6 +1509,7 @@ public void setInitialMaxTermThreshold(int initialMaxTermThreshold) { this.initialMaxTermThreshold = initialMaxTermThreshold; } + @Override public int getIntermediateMaxTermThreshold() { return intermediateMaxTermThreshold; } @@ -1468,6 +1518,7 @@ public void setIntermediateMaxTermThreshold(int intermediateMaxTermThreshold) { this.intermediateMaxTermThreshold = intermediateMaxTermThreshold; } + @Override public int getIndexedMaxTermThreshold() { return indexedMaxTermThreshold; } @@ -1476,6 +1527,7 @@ public void setIndexedMaxTermThreshold(int indexedMaxTermThreshold) { this.indexedMaxTermThreshold = indexedMaxTermThreshold; } + @Override public int getFinalMaxTermThreshold() { return finalMaxTermThreshold; } @@ -1484,6 +1536,7 @@ public void setFinalMaxTermThreshold(int finalMaxTermThreshold) { this.finalMaxTermThreshold = finalMaxTermThreshold; } + @Override public int getMaxDepthThreshold() { return maxDepthThreshold; } @@ -1492,6 +1545,7 @@ public void setMaxDepthThreshold(int maxDepthThreshold) { this.maxDepthThreshold = maxDepthThreshold; } + @Override public boolean isExpandFields() { return expandFields; } @@ -1500,6 +1554,7 @@ public void setExpandFields(boolean expandFields) { this.expandFields = expandFields; } + @Override public int getMaxUnfieldedExpansionThreshold() { return maxUnfieldedExpansionThreshold; } @@ -1508,6 +1563,7 @@ public void setMaxUnfieldedExpansionThreshold(int maxUnfieldedExpansionThreshold this.maxUnfieldedExpansionThreshold = maxUnfieldedExpansionThreshold; } + @Override public boolean isExpandValues() { return expandValues; } @@ -1516,6 +1572,7 @@ public void setExpandValues(boolean expandValues) { this.expandValues = expandValues; } + @Override public boolean isExpandUnfieldedValues() { return expandUnfieldedValues; } @@ -1524,6 +1581,7 @@ public void setExpandUnfieldedValues(boolean expandUnfieldedValues) { this.expandUnfieldedValues = expandUnfieldedValues; } + @Override public int getMaxValueExpansionThreshold() { return maxValueExpansionThreshold; } @@ -1532,6 +1590,7 @@ public void setMaxValueExpansionThreshold(int maxValueExpansionThreshold) { this.maxValueExpansionThreshold = maxValueExpansionThreshold; } + @Override public int getMaxScannerBatchSize() { return this.maxScannerBatchSize; } @@ -1540,6 +1599,7 @@ public void setMaxScannerBatchSize(final int size) { this.maxScannerBatchSize = size; } + @Override public int getMaxIndexBatchSize() { return this.maxIndexBatchSize; } @@ -1550,6 +1610,7 @@ public void setMaxIndexBatchSize(final int size) { } } + @Override public int getMaxOrExpansionThreshold() { return maxOrExpansionThreshold; } @@ -1558,6 +1619,7 @@ public void setMaxOrExpansionThreshold(int maxOrExpansionThreshold) { this.maxOrExpansionThreshold = maxOrExpansionThreshold; } + @Override public int getMaxOrRangeThreshold() { return maxOrRangeThreshold; } @@ -1566,6 +1628,7 @@ public void setMaxOrRangeThreshold(int maxOrRangeThreshold) { this.maxOrRangeThreshold = maxOrRangeThreshold; } + @Override public int getMaxOrRangeIvarators() { return maxOrRangeIvarators; } @@ -1574,6 +1637,7 @@ public void setMaxOrRangeIvarators(int maxOrRangeIvarators) { this.maxOrRangeIvarators = maxOrRangeIvarators; } + @Override public int getMaxRangesPerRangeIvarator() { return maxRangesPerRangeIvarator; } @@ -1582,6 +1646,7 @@ public void setMaxRangesPerRangeIvarator(int maxRangesPerRangeIvarator) { this.maxRangesPerRangeIvarator = maxRangesPerRangeIvarator; } + @Override public int getMaxOrExpansionFstThreshold() { return maxOrExpansionFstThreshold; } @@ -1590,6 +1655,7 @@ public void setMaxOrExpansionFstThreshold(int maxOrExpansionFstThreshold) { this.maxOrExpansionFstThreshold = maxOrExpansionFstThreshold; } + @Override public String getHdfsSiteConfigURLs() { return hdfsSiteConfigURLs; } @@ -1598,6 +1664,7 @@ public void setHdfsSiteConfigURLs(String hadoopConfigURLs) { this.hdfsSiteConfigURLs = hadoopConfigURLs; } + @Override public String getHdfsFileCompressionCodec() { return hdfsFileCompressionCodec; } @@ -1606,6 +1673,7 @@ public void setHdfsFileCompressionCodec(String hdfsFileCompressionCodec) { this.hdfsFileCompressionCodec = hdfsFileCompressionCodec; } + @Override public String getZookeeperConfig() { return zookeeperConfig; } @@ -1614,6 +1682,7 @@ public void setZookeeperConfig(String zookeeperConfig) { this.zookeeperConfig = zookeeperConfig; } + @Override public List getIvaratorCacheDirConfigs() { return ivaratorCacheDirConfigs; } @@ -1626,10 +1695,12 @@ public void setLocalIvaratorCacheDirConfigs(List localIv this.localIvaratorCacheDirConfigs = localIvaratorCacheDirConfigs; } + @Override public List getLocalIvaratorCacheDirConfigs() { return localIvaratorCacheDirConfigs; } + @Override public String getIvaratorFstHdfsBaseURIs() { return ivaratorFstHdfsBaseURIs; } @@ -1638,6 +1709,7 @@ public void setIvaratorFstHdfsBaseURIs(String ivaratorFstHdfsBaseURIs) { this.ivaratorFstHdfsBaseURIs = ivaratorFstHdfsBaseURIs; } + @Override public int getUniqueCacheBufferSize() { return uniqueCacheBufferSize; } @@ -1646,6 +1718,7 @@ public void setUniqueCacheBufferSize(int uniqueCacheBufferSize) { this.uniqueCacheBufferSize = uniqueCacheBufferSize; } + @Override public int getIvaratorCacheBufferSize() { return ivaratorCacheBufferSize; } @@ -1654,6 +1727,7 @@ public void setIvaratorCacheBufferSize(int ivaratorCacheBufferSize) { this.ivaratorCacheBufferSize = ivaratorCacheBufferSize; } + @Override public long getIvaratorCacheScanPersistThreshold() { return ivaratorCacheScanPersistThreshold; } @@ -1662,6 +1736,7 @@ public void setIvaratorCacheScanPersistThreshold(long ivaratorCacheScanPersistTh this.ivaratorCacheScanPersistThreshold = ivaratorCacheScanPersistThreshold; } + @Override public long getIvaratorCacheScanTimeout() { return ivaratorCacheScanTimeout; } @@ -1670,6 +1745,7 @@ public void setIvaratorCacheScanTimeout(long ivaratorCacheScanTimeout) { this.ivaratorCacheScanTimeout = ivaratorCacheScanTimeout; } + @Override public List> getExcludeUnfieldedTypes() { return excludeUnfieldedTypes; } @@ -1678,6 +1754,7 @@ public void setExcludeUnfieldedTypes(List> excludeUnfieldedTypes) { this.excludeUnfieldedTypes = excludeUnfieldedTypes; } + @Override public int getMaxFieldIndexRangeSplit() { return maxFieldIndexRangeSplit; } @@ -1686,6 +1763,7 @@ public void setMaxFieldIndexRangeSplit(int maxFieldIndexRangeSplit) { this.maxFieldIndexRangeSplit = maxFieldIndexRangeSplit; } + @Override public int getIvaratorMaxOpenFiles() { return ivaratorMaxOpenFiles; } @@ -1694,6 +1772,7 @@ public void setIvaratorMaxOpenFiles(int ivaratorMaxOpenFiles) { this.ivaratorMaxOpenFiles = ivaratorMaxOpenFiles; } + @Override public int getIvaratorNumRetries() { return ivaratorNumRetries; } @@ -1710,6 +1789,7 @@ public void setIvaratorPersistVerify(boolean ivaratorPersistVerify) { this.ivaratorPersistVerify = ivaratorPersistVerify; } + @Override public int getIvaratorPersistVerifyCount() { return ivaratorPersistVerifyCount; } @@ -1718,6 +1798,7 @@ public void setIvaratorPersistVerifyCount(int ivaratorPersistVerifyCount) { this.ivaratorPersistVerifyCount = ivaratorPersistVerifyCount; } + @Override public int getMaxIvaratorSources() { return maxIvaratorSources; } @@ -1726,6 +1807,7 @@ public void setMaxIvaratorSources(int maxIvaratorSources) { this.maxIvaratorSources = maxIvaratorSources; } + @Override public long getMaxIvaratorSourceWait() { return maxIvaratorSourceWait; } @@ -1734,6 +1816,7 @@ public void setMaxIvaratorSourceWait(long maxIvaratorSourceWait) { this.maxIvaratorSourceWait = maxIvaratorSourceWait; } + @Override public long getMaxIvaratorResults() { return maxIvaratorResults; } @@ -1742,6 +1825,7 @@ public void setMaxIvaratorResults(long maxIvaratorResults) { this.maxIvaratorResults = maxIvaratorResults; } + @Override public int getMaxIvaratorTerms() { return maxIvaratorTerms; } @@ -1750,6 +1834,7 @@ public void setMaxIvaratorTerms(int maxIvaratorTerms) { this.maxIvaratorTerms = maxIvaratorTerms; } + @Override public int getMaxEvaluationPipelines() { return maxEvaluationPipelines; } @@ -1758,6 +1843,7 @@ public void setMaxEvaluationPipelines(int maxEvaluationPipelines) { this.maxEvaluationPipelines = maxEvaluationPipelines; } + @Override public int getMaxPipelineCachedResults() { return maxPipelineCachedResults; } @@ -1766,6 +1852,7 @@ public void setMaxPipelineCachedResults(int maxCachedResults) { this.maxPipelineCachedResults = maxCachedResults; } + @Override public boolean isExpandAllTerms() { return expandAllTerms; } @@ -1779,6 +1866,7 @@ public void setExpandAllTerms(boolean expandAllTerms) { * * @return FIELDNAME1:normalizer.class;FIELDNAME2:normalizer.class; */ + @Override public String getIndexedFieldDataTypesAsString() { if (null == this.getIndexedFields() || this.getIndexedFields().isEmpty()) { @@ -1815,6 +1903,7 @@ public String getNormalizedFieldNormalizersAsString() { return sb.toString(); } + @Override public Set getIndexedFields() { return indexedFields; } @@ -1827,6 +1916,7 @@ public void setIndexedFields(Set indexedFields) { this.indexedFields = (null == indexedFields) ? Collections.emptySet() : Sets.newHashSet(indexedFields); } + @Override public Set getReverseIndexedFields() { return reverseIndexedFields; } @@ -1839,6 +1929,7 @@ public void setReverseIndexedFields(Set reverseIndexedFields) { this.reverseIndexedFields = reverseIndexedFields == null ? new HashSet<>() : Sets.newHashSet(reverseIndexedFields); } + @Override public Set getNormalizedFields() { return normalizedFields; } @@ -1847,6 +1938,7 @@ public void setNormalizedFields(Set normalizedFields) { this.normalizedFields = normalizedFields; } + @Override public Multimap> getDataTypes() { if (dataTypes == null) { dataTypes = HashMultimap.create(); @@ -1863,6 +1955,7 @@ public void setDataTypes(Multimap> dataTypes) { this.dataTypes = dataTypes; } + @Override public Multimap> getQueryFieldsDatatypes() { return queryFieldsDatatypes; } @@ -1871,6 +1964,7 @@ public void setQueryFieldsDatatypes(Multimap> queryFieldsDatatype this.queryFieldsDatatypes = queryFieldsDatatypes; } + @Override public Map> getFieldToDiscreteIndexTypes() { return fieldToDiscreteIndexTypes; } @@ -1879,6 +1973,7 @@ public void setFieldToDiscreteIndexTypes(Map> fieldT this.fieldToDiscreteIndexTypes = fieldToDiscreteIndexTypes; } + @Override public Multimap getCompositeToFieldMap() { return compositeToFieldMap; } @@ -1887,6 +1982,7 @@ public void setCompositeToFieldMap(Multimap compositeToFieldMap) this.compositeToFieldMap = compositeToFieldMap; } + @Override public Map getCompositeTransitionDates() { return compositeTransitionDates; } @@ -1895,6 +1991,7 @@ public void setCompositeTransitionDates(Map compositeTransitionDate this.compositeTransitionDates = compositeTransitionDates; } + @Override public Map getCompositeFieldSeparators() { return compositeFieldSeparators; } @@ -1903,6 +2000,7 @@ public void setCompositeFieldSeparators(Map compositeFieldSeparat this.compositeFieldSeparators = compositeFieldSeparators; } + @Override public Map getWhindexCreationDates() { return whindexCreationDates; } @@ -1911,6 +2009,7 @@ public void setWhindexCreationDates(Map whindexCreationDates) { this.whindexCreationDates = whindexCreationDates; } + @Override public Multimap> getNormalizedFieldsDatatypes() { return normalizedFieldsDatatypes; } @@ -1920,6 +2019,7 @@ public void setNormalizedFieldsDatatypes(Multimap> normalizedFiel this.normalizedFields = Sets.newHashSet(this.normalizedFieldsDatatypes.keySet()); } + @Override public Set getLimitFields() { return limitFields; } @@ -1928,10 +2028,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; } @@ -1940,10 +2042,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; } @@ -1952,6 +2056,7 @@ public void setLimitFieldsPreQueryEvaluation(boolean limitFieldsPreQueryEvaluati this.limitFieldsPreQueryEvaluation = limitFieldsPreQueryEvaluation; } + @Override public String getLimitFieldsField() { return limitFieldsField; } @@ -1960,6 +2065,7 @@ public void setLimitFieldsField(String limitFieldsField) { this.limitFieldsField = limitFieldsField; } + @Override public boolean isDateIndexTimeTravel() { return dateIndexTimeTravel; } @@ -1968,6 +2074,7 @@ public void setDateIndexTimeTravel(boolean dateIndexTimeTravel) { this.dateIndexTimeTravel = dateIndexTimeTravel; } + @Override public boolean isDateIndexIterator() { return dateIndexIterator; } @@ -1976,6 +2083,7 @@ public void setDateIndexIterator(boolean dateIndexIterator) { this.dateIndexIterator = dateIndexIterator; } + @Override public boolean getIgnoreNonExistentFields() { return ignoreNonExistentFields; } @@ -1984,6 +2092,7 @@ public void setIgnoreNonExistentFields(boolean ignoreNonExistentFields) { this.ignoreNonExistentFields = ignoreNonExistentFields; } + @Override public long getBeginDateCap() { return beginDateCap; } @@ -1992,6 +2101,7 @@ public void setBeginDateCap(long beginDateCap) { this.beginDateCap = beginDateCap; } + @Override public boolean isFailOutsideValidDateRange() { return failOutsideValidDateRange; } @@ -2000,6 +2110,7 @@ public void setFailOutsideValidDateRange(boolean failOutsideValidDateRange) { this.failOutsideValidDateRange = failOutsideValidDateRange; } + @Override public int getGroupFieldsBatchSize() { return groupFieldsBatchSize; } @@ -2008,10 +2119,12 @@ public void setGroupFieldsBatchSize(int groupFieldsBatchSize) { this.groupFieldsBatchSize = groupFieldsBatchSize; } + @Override public String getGroupFieldsBatchSizeAsString() { return "" + groupFieldsBatchSize; } + @Override public boolean isDisableIteratorUniqueFields() { return disableIteratorUniqueFields; } @@ -2020,6 +2133,7 @@ public void setDisableIteratorUniqueFields(boolean disableIteratorUniqueFields) this.disableIteratorUniqueFields = disableIteratorUniqueFields; } + @Override public boolean isDisableIteratorMostRecentUniqueFields() { return disableIteratorMostRecentUniqueFields; } @@ -2028,6 +2142,7 @@ public void setDisableIteratorMostRecentUniqueFields(boolean disableIteratorMost this.disableIteratorMostRecentUniqueFields = disableIteratorMostRecentUniqueFields; } + @Override public UniqueFields getUniqueFields() { return uniqueFields; } @@ -2036,6 +2151,7 @@ public void setUniqueFields(UniqueFields uniqueFields) { this.uniqueFields = uniqueFields.clone(); } + @Override public boolean isHitList() { return this.hitList; } @@ -2044,6 +2160,7 @@ public void setHitList(boolean hitList) { this.hitList = hitList; } + @Override public boolean isRawTypes() { return this.rawTypes; } @@ -2052,6 +2169,7 @@ public void setRawTypes(boolean rawTypes) { this.rawTypes = rawTypes; } + @Override public double getMinSelectivity() { return minSelectivity; } @@ -2075,6 +2193,7 @@ public boolean canRunQuery() { return true; } + @Override public boolean getFilterMaskedValues() { return filterMaskedValues; } @@ -2083,6 +2202,7 @@ public void setFilterMaskedValues(boolean filterMaskedValues) { this.filterMaskedValues = filterMaskedValues; } + @Override public boolean getIncludeDataTypeAsField() { return includeDataTypeAsField; } @@ -2091,6 +2211,7 @@ public void setIncludeDataTypeAsField(boolean includeDataTypeAsField) { this.includeDataTypeAsField = includeDataTypeAsField; } + @Override public boolean getIncludeRecordId() { return includeRecordId; } @@ -2099,6 +2220,7 @@ public void setIncludeRecordId(boolean includeRecordId) { this.includeRecordId = includeRecordId; } + @Override public boolean getIncludeHierarchyFields() { return includeHierarchyFields; } @@ -2107,6 +2229,7 @@ public void setIncludeHierarchyFields(boolean includeHierarchyFields) { this.includeHierarchyFields = includeHierarchyFields; } + @Override public Map getHierarchyFieldOptions() { return this.hierarchyFieldOptions; } @@ -2116,6 +2239,7 @@ public void setHierarchyFieldOptions(final Map options) { this.hierarchyFieldOptions = (null != options) ? options : emptyOptions; } + @Override public boolean getIncludeGroupingContext() { return includeGroupingContext; } @@ -2124,6 +2248,7 @@ public void setIncludeGroupingContext(boolean withContextOption) { this.includeGroupingContext = withContextOption; } + @Override public List getDocumentPermutations() { return documentPermutations; } @@ -2144,6 +2269,7 @@ public void setDocumentPermutations(List documentPermutations) { this.documentPermutations = permutations; } + @Override public boolean isReducedResponse() { return reducedResponse; } @@ -2152,6 +2278,7 @@ public void setReducedResponse(boolean reducedResponse) { this.reducedResponse = reducedResponse; } + @Override public boolean isDisableEvaluation() { return disableEvaluation; } @@ -2160,6 +2287,7 @@ public void setDisableEvaluation(boolean disableEvaluation) { this.disableEvaluation = disableEvaluation; } + @Override public boolean isDisableIndexOnlyDocuments() { return disableIndexOnlyDocuments; } @@ -2168,6 +2296,7 @@ public void setDisableIndexOnlyDocuments(boolean disableIndexOnlyDocuments) { this.disableIndexOnlyDocuments = disableIndexOnlyDocuments; } + @Override public boolean isContainsIndexOnlyTerms() { return containsIndexOnlyTerms; } @@ -2176,6 +2305,7 @@ public void setContainsIndexOnlyTerms(boolean containsIndexOnlyTerms) { this.containsIndexOnlyTerms = containsIndexOnlyTerms; } + @Override public boolean isContainsCompositeTerms() { return containsCompositeTerms; } @@ -2184,6 +2314,7 @@ public void setContainsCompositeTerms(boolean containsCompositeTerms) { this.containsCompositeTerms = containsCompositeTerms; } + @Override public boolean isAllowFieldIndexEvaluation() { return allowFieldIndexEvaluation; } @@ -2192,6 +2323,7 @@ public void setAllowFieldIndexEvaluation(boolean allowFieldIndexEvaluation) { this.allowFieldIndexEvaluation = allowFieldIndexEvaluation; } + @Override public boolean isAllowTermFrequencyLookup() { return allowTermFrequencyLookup; } @@ -2200,6 +2332,7 @@ public void setAllowTermFrequencyLookup(boolean allowTermFrequencyLookup) { this.allowTermFrequencyLookup = allowTermFrequencyLookup; } + @Override public boolean isExpandUnfieldedNegations() { return expandUnfieldedNegations; } @@ -2208,6 +2341,7 @@ public void setExpandUnfieldedNegations(boolean expandUnfieldedNegations) { this.expandUnfieldedNegations = expandUnfieldedNegations; } + @Override public boolean isAllTermsIndexOnly() { return allTermsIndexOnly; } @@ -2216,6 +2350,7 @@ public void setAllTermsIndexOnly(boolean allTermsIndexOnly) { this.allTermsIndexOnly = allTermsIndexOnly; } + @Override public QueryModel getQueryModel() { return queryModel; } @@ -2224,6 +2359,7 @@ public void setQueryModel(QueryModel queryModel) { this.queryModel = queryModel; } + @Override public String getModelName() { return modelName; } @@ -2232,6 +2368,7 @@ public void setModelName(String modelName) { this.modelName = modelName; } + @Override public String getModelTableName() { return modelTableName; } @@ -2240,6 +2377,7 @@ public void setModelTableName(String modelTableName) { this.modelTableName = modelTableName; } + @Override public ReturnType getReturnType() { return returnType; } @@ -2248,6 +2386,7 @@ public void setReturnType(ReturnType returnType) { this.returnType = returnType; } + @Override public QueryStopwatch getTimers() { return timers; } @@ -2260,6 +2399,7 @@ public void appendTimers(QueryStopwatch timers) { this.timers.appendTimers(timers); } + @Override public ASTJexlScript getQueryTree() { return queryTree; } @@ -2283,6 +2423,7 @@ public String getQueryString() { return super.getQueryString(); } + @Override public boolean isCompressServerSideResults() { return compressServerSideResults; } @@ -2297,6 +2438,7 @@ public void setCompressServerSideResults(boolean compressServerSideResults) { * * @return true, if index-only filter functions should be enabled. */ + @Override public boolean isIndexOnlyFilterFunctionsEnabled() { return this.indexOnlyFilterFunctionsEnabled; } @@ -2312,6 +2454,7 @@ public void setIndexOnlyFilterFunctionsEnabled(boolean enabled) { this.indexOnlyFilterFunctionsEnabled = enabled; } + @Override public boolean isCompositeFilterFunctionsEnabled() { return compositeFilterFunctionsEnabled; } @@ -2320,6 +2463,7 @@ public void setCompositeFilterFunctionsEnabled(boolean compositeFilterFunctionsE this.compositeFilterFunctionsEnabled = compositeFilterFunctionsEnabled; } + @Override public List getRealmSuffixExclusionPatterns() { return realmSuffixExclusionPatterns; } @@ -2328,6 +2472,7 @@ public void setRealmSuffixExclusionPatterns(List realmSuffixExclusionPat this.realmSuffixExclusionPatterns = realmSuffixExclusionPatterns; } + @Override public Set getQueryTermFrequencyFields() { return queryTermFrequencyFields; } @@ -2336,6 +2481,7 @@ public void setQueryTermFrequencyFields(Set queryTermFrequencyFields) { this.queryTermFrequencyFields = deconstruct(queryTermFrequencyFields); } + @Override public boolean isTermFrequenciesRequired() { return termFrequenciesRequired; } @@ -2348,10 +2494,12 @@ public void setLimitTermExpansionToModel(boolean shouldLimitTermExpansionToModel this.shouldLimitTermExpansionToModel = shouldLimitTermExpansionToModel; } + @Override public boolean isLimitTermExpansionToModel() { return shouldLimitTermExpansionToModel; } + @Override public long getMaxIndexScanTimeMillis() { return maxIndexScanTimeMillis; } @@ -2360,6 +2508,7 @@ public void setMaxIndexScanTimeMillis(long maxTime) { this.maxIndexScanTimeMillis = maxTime; } + @Override public boolean getParseTldUids() { return parseTldUids; } @@ -2368,6 +2517,7 @@ public void setParseTldUids(boolean parseTldUids) { this.parseTldUids = parseTldUids; } + @Override public boolean getCollapseUids() { return collapseUids; } @@ -2376,6 +2526,7 @@ public void setCollapseUids(boolean collapseUids) { this.collapseUids = collapseUids; } + @Override public int getCollapseUidsThreshold() { return collapseUidsThreshold; } @@ -2384,6 +2535,7 @@ public void setCollapseUidsThreshold(int collapseUidsThreshold) { this.collapseUidsThreshold = collapseUidsThreshold; } + @Override public boolean getEnforceUniqueTermsWithinExpressions() { return enforceUniqueTermsWithinExpressions; } @@ -2392,6 +2544,7 @@ public void setEnforceUniqueTermsWithinExpressions(boolean enforceUniqueTermsWit this.enforceUniqueTermsWithinExpressions = enforceUniqueTermsWithinExpressions; } + @Override public boolean getPruneQueryByIngestTypes() { return pruneQueryByIngestTypes; } @@ -2400,6 +2553,7 @@ public void setPruneQueryByIngestTypes(boolean pruneQueryByIngestTypes) { this.pruneQueryByIngestTypes = pruneQueryByIngestTypes; } + @Override public boolean getReduceQueryFields() { return reduceQueryFields; } @@ -2408,6 +2562,7 @@ public void setReduceQueryFields(boolean reduceQueryFields) { this.reduceQueryFields = reduceQueryFields; } + @Override public boolean getReduceQueryFieldsPerShard() { return reduceQueryFieldsPerShard; } @@ -2416,6 +2571,7 @@ public void setReduceQueryFieldsPerShard(boolean reduceQueryFieldsPerShard) { this.reduceQueryFieldsPerShard = reduceQueryFieldsPerShard; } + @Override public boolean getReduceTypeMetadata() { return reduceTypeMetadata; } @@ -2424,6 +2580,7 @@ public void setReduceTypeMetadata(boolean reduceTypeMetadata) { this.reduceTypeMetadata = reduceTypeMetadata; } + @Override public boolean getReduceTypeMetadataPerShard() { return reduceTypeMetadataPerShard; } @@ -2432,6 +2589,7 @@ public void setReduceTypeMetadataPerShard(boolean reduceTypeMetadataPerShard) { this.reduceTypeMetadataPerShard = reduceTypeMetadataPerShard; } + @Override public boolean getLimitAnyFieldLookups() { return limitAnyFieldLookups; } @@ -2440,6 +2598,7 @@ public void setLimitAnyFieldLookups(boolean limitAnyFieldLookups) { this.limitAnyFieldLookups = limitAnyFieldLookups; } + @Override public boolean getAllowShortcutEvaluation() { return allowShortcutEvaluation; } @@ -2448,6 +2607,7 @@ public void setAllowShortcutEvaluation(boolean allowShortcutEvaluation) { this.allowShortcutEvaluation = allowShortcutEvaluation; } + @Override public boolean getAccrueStats() { return accrueStats; } @@ -2457,6 +2617,7 @@ public void setAccrueStats(boolean accrueStats) { } + @Override public List getIndexValueHoles() { return indexValueHoles; } @@ -2465,6 +2626,7 @@ public void setIndexValueHoles(List indexValueHoles) { this.indexValueHoles = indexValueHoles; } + @Override public boolean getCollectTimingDetails() { return collectTimingDetails; } @@ -2474,6 +2636,7 @@ public void setCollectTimingDetails(boolean collectTimingDetails) { } + @Override public boolean getLogTimingDetails() { return logTimingDetails; } @@ -2482,6 +2645,7 @@ public void setLogTimingDetails(boolean logTimingDetails) { this.logTimingDetails = logTimingDetails; } + @Override public String getStatsdHost() { return statsdHost; } @@ -2490,6 +2654,7 @@ public void setStatsdHost(String statsdHost) { this.statsdHost = statsdHost; } + @Override public int getStatsdPort() { return statsdPort; } @@ -2498,6 +2663,7 @@ public void setStatsdPort(int statsdPort) { this.statsdPort = statsdPort; } + @Override public int getStatsdMaxQueueSize() { return statsdMaxQueueSize; } @@ -2506,6 +2672,7 @@ public void setStatsdMaxQueueSize(int statsdMaxQueueSize) { this.statsdMaxQueueSize = statsdMaxQueueSize; } + @Override public boolean getSendTimingToStatsd() { return sendTimingToStatsd; } @@ -2514,6 +2681,7 @@ public void setSendTimingToStatsd(boolean sendTimingToStatsd) { this.sendTimingToStatsd = sendTimingToStatsd; } + @Override public boolean isCleanupShardsAndDaysQueryHints() { return cleanupShardsAndDaysQueryHints; } @@ -2522,6 +2690,7 @@ public void setCleanupShardsAndDaysQueryHints(boolean cleanupShardsAndDaysQueryH this.cleanupShardsAndDaysQueryHints = cleanupShardsAndDaysQueryHints; } + @Override public AtomicInteger getFstCount() { return fstCount; } @@ -2530,6 +2699,7 @@ public void setFstCount(AtomicInteger fstCount) { this.fstCount = fstCount; } + @Override public boolean getCacheModel() { return cacheModel; } @@ -2538,6 +2708,7 @@ public void setCacheModel(boolean cacheModel) { this.cacheModel = cacheModel; } + @Override public boolean isBypassExecutabilityCheck() { return bypassExecutabilityCheck; } @@ -2550,6 +2721,7 @@ public void setBypassExecutabilityCheck(boolean bypassExecutabilityCheck) { this.bypassExecutabilityCheck = bypassExecutabilityCheck; } + @Override public boolean getBackoffEnabled() { return backoffEnabled; } @@ -2558,6 +2730,7 @@ public void setBackoffEnabled(boolean backoffEnabled) { this.backoffEnabled = backoffEnabled; } + @Override public boolean getUnsortedUIDsEnabled() { return unsortedUIDsEnabled; } @@ -2566,6 +2739,7 @@ public void setUnsortedUIDsEnabled(boolean unsortedUIDsEnabled) { this.unsortedUIDsEnabled = unsortedUIDsEnabled; } + @Override public boolean getSpeculativeScanning() { return speculativeScanning; } @@ -2574,6 +2748,7 @@ public void setSpeculativeScanning(boolean speculativeScanning) { this.speculativeScanning = speculativeScanning; } + @Override public boolean getSerializeQueryIterator() { return serializeQueryIterator; } @@ -2582,6 +2757,7 @@ public void setSerializeQueryIterator(boolean serializeQueryIterator) { this.serializeQueryIterator = serializeQueryIterator; } + @Override public boolean isSortedUIDs() { return sortedUIDs; } @@ -2590,6 +2766,7 @@ public void setSortedUIDs(boolean sortedUIDs) { this.sortedUIDs = sortedUIDs; } + @Override public long getYieldThresholdMs() { return yieldThresholdMs; } @@ -2598,6 +2775,7 @@ public void setYieldThresholdMs(long yieldThresholdMs) { this.yieldThresholdMs = yieldThresholdMs; } + @Override public int getMaxYields() { return maxYields; } @@ -2606,6 +2784,7 @@ public void setMaxYields(int maxYields) { this.maxYields = maxYields; } + @Override public boolean isTrackSizes() { return trackSizes; } @@ -2614,6 +2793,7 @@ public void setTrackSizes(boolean trackSizes) { this.trackSizes = trackSizes; } + @Override public List getContentFieldNames() { return contentFieldNames; } @@ -2626,10 +2806,12 @@ public void setEvaluationOnlyFields(Set evaluationOnlyFields) { this.evaluationOnlyFields = evaluationOnlyFields; } + @Override public Set getEvaluationOnlyFields() { return this.evaluationOnlyFields; } + @Override public Set getDisallowedRegexPatterns() { return disallowedRegexPatterns; } @@ -2638,6 +2820,7 @@ public void setDisallowedRegexPatterns(Set disallowedRegexPatterns) { this.disallowedRegexPatterns = disallowedRegexPatterns; } + @Override public String getActiveQueryLogNameSource() { return activeQueryLogNameSource; } @@ -2656,6 +2839,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 ""; @@ -2670,6 +2854,7 @@ public String getActiveQueryLogName() { } } + @Override public boolean isDisableWhindexFieldMappings() { return disableWhindexFieldMappings; } @@ -2678,6 +2863,7 @@ public void setDisableWhindexFieldMappings(boolean disableWhindexFieldMappings) this.disableWhindexFieldMappings = disableWhindexFieldMappings; } + @Override public Set getWhindexMappingFields() { return whindexMappingFields; } @@ -2686,6 +2872,7 @@ public void setWhindexMappingFields(Set whindexMappingFields) { this.whindexMappingFields = whindexMappingFields; } + @Override public Map> getWhindexFieldMappings() { return whindexFieldMappings; } @@ -2694,6 +2881,7 @@ public void setWhindexFieldMappings(Map> whindexFieldM this.whindexFieldMappings = whindexFieldMappings; } + @Override public boolean isGeneratePlanOnly() { return generatePlanOnly; } @@ -2702,6 +2890,7 @@ public void setGeneratePlanOnly(boolean generatePlanOnly) { this.generatePlanOnly = generatePlanOnly; } + @Override public boolean getEnforceUniqueConjunctionsWithinExpression() { return enforceUniqueConjunctionsWithinExpression; } @@ -2710,6 +2899,7 @@ public void setEnforceUniqueConjunctionsWithinExpression(boolean enforceUniqueCo this.enforceUniqueConjunctionsWithinExpression = enforceUniqueConjunctionsWithinExpression; } + @Override public boolean getEnforceUniqueDisjunctionsWithinExpression() { return enforceUniqueDisjunctionsWithinExpression; } @@ -2718,6 +2908,7 @@ public void setEnforceUniqueDisjunctionsWithinExpression(boolean enforceUniqueDi this.enforceUniqueDisjunctionsWithinExpression = enforceUniqueDisjunctionsWithinExpression; } + @Override public BloomFilter getBloom() { return bloom; } @@ -2726,6 +2917,7 @@ public void setBloom(BloomFilter bloom) { this.bloom = bloom; } + @Override public Set getNoExpansionFields() { return this.noExpansionFields; } @@ -2734,6 +2926,7 @@ public void setNoExpansionFields(Set noExpansionFields) { this.noExpansionFields = noExpansionFields; } + @Override public Set getLenientFields() { return lenientFields; } @@ -2742,6 +2935,7 @@ public void setLenientFields(Set lenientFields) { this.lenientFields = lenientFields; } + @Override public Set getStrictFields() { return strictFields; } @@ -2750,6 +2944,7 @@ public void setStrictFields(Set strictFields) { this.strictFields = strictFields; } + @Override public ExcerptFields getExcerptFields() { return excerptFields; } @@ -2761,6 +2956,7 @@ public void setExcerptFields(ExcerptFields excerptFields) { this.excerptFields = excerptFields; } + @Override public Class> getExcerptIterator() { return excerptIterator; } @@ -2769,6 +2965,7 @@ public void setExcerptIterator(Class this.excerptIterator = excerptIterator; } + @Override public SummaryOptions getSummaryOptions() { return summaryOptions; } @@ -2779,6 +2976,7 @@ public void setSummaryOptions(SummaryOptions summaryOptions) { } } + @Override public Class> getSummaryIterator() { return summaryIterator; } @@ -2787,6 +2985,7 @@ public void setSummaryIterator(Class this.summaryIterator = summaryIterator; } + @Override public String getSummaryFieldName() { return summaryFieldName; } @@ -2795,6 +2994,7 @@ public void setSummaryFieldName(String summaryFieldName) { this.summaryFieldName = summaryFieldName; } + @Override public int getFiFieldSeek() { return fiFieldSeek; } @@ -2803,6 +3003,7 @@ public void setFiFieldSeek(int fiFieldSeek) { this.fiFieldSeek = fiFieldSeek; } + @Override public int getFiNextSeek() { return fiNextSeek; } @@ -2811,6 +3012,7 @@ public void setFiNextSeek(int fiNextSeek) { this.fiNextSeek = fiNextSeek; } + @Override public int getEventFieldSeek() { return eventFieldSeek; } @@ -2819,6 +3021,7 @@ public void setEventFieldSeek(int eventFieldSeek) { this.eventFieldSeek = eventFieldSeek; } + @Override public int getEventNextSeek() { return eventNextSeek; } @@ -2827,6 +3030,7 @@ public void setEventNextSeek(int eventNextSeek) { this.eventNextSeek = eventNextSeek; } + @Override public int getTfFieldSeek() { return tfFieldSeek; } @@ -2835,6 +3039,7 @@ public void setTfFieldSeek(int tfFieldSeek) { this.tfFieldSeek = tfFieldSeek; } + @Override public int getTfNextSeek() { return tfNextSeek; } @@ -2843,6 +3048,7 @@ public void setTfNextSeek(int tfNextSeek) { this.tfNextSeek = tfNextSeek; } + @Override public boolean isSeekingEventAggregation() { return seekingEventAggregation; } @@ -2851,6 +3057,7 @@ public void setSeekingEventAggregation(boolean seekingEventAggregation) { this.seekingEventAggregation = seekingEventAggregation; } + @Override public long getVisitorFunctionMaxWeight() { return visitorFunctionMaxWeight; } @@ -2863,10 +3070,12 @@ public void setQueryExecutionForPageTimeout(long queryExecutionForPageTimeout) { this.queryExecutionForPageTimeout = queryExecutionForPageTimeout; } + @Override public long getQueryExecutionForPageTimeout() { return this.queryExecutionForPageTimeout; } + @Override public boolean isLazySetMechanismEnabled() { return lazySetMechanismEnabled; } @@ -2875,6 +3084,7 @@ public void setLazySetMechanismEnabled(boolean lazySetMechanismEnabled) { this.lazySetMechanismEnabled = lazySetMechanismEnabled; } + @Override public int getDocAggregationThresholdMs() { return docAggregationThresholdMs; } @@ -2883,6 +3093,7 @@ public void setDocAggregationThresholdMs(int docAggregationThresholdMs) { this.docAggregationThresholdMs = docAggregationThresholdMs; } + @Override public int getTfAggregationThresholdMs() { return tfAggregationThresholdMs; } @@ -2891,6 +3102,7 @@ public void setTfAggregationThresholdMs(int tfAggregationThresholdMs) { this.tfAggregationThresholdMs = tfAggregationThresholdMs; } + @Override public GroupFields getGroupFields() { return groupFields; } @@ -2903,6 +3115,7 @@ public void setGroupFields(GroupFields groupFields) { } } + @Override public boolean getPruneQueryOptions() { return pruneQueryOptions; } @@ -2911,6 +3124,7 @@ public void setPruneQueryOptions(boolean pruneQueryOptions) { this.pruneQueryOptions = pruneQueryOptions; } + @Override public boolean isRebuildDatatypeFilter() { return rebuildDatatypeFilter; } @@ -2919,6 +3133,7 @@ public void setRebuildDatatypeFilter(boolean rebuildDatatypeFilter) { this.rebuildDatatypeFilter = rebuildDatatypeFilter; } + @Override public boolean isRebuildDatatypeFilterPerShard() { return rebuildDatatypeFilterPerShard; } @@ -2927,6 +3142,7 @@ public void setRebuildDatatypeFilterPerShard(boolean rebuildDatatypeFilterPerSha this.rebuildDatatypeFilterPerShard = rebuildDatatypeFilterPerShard; } + @Override public double getIndexFieldHoleMinThreshold() { return indexFieldHoleMinThreshold; } @@ -2935,6 +3151,7 @@ public void setIndexFieldHoleMinThreshold(double indexFieldHoleMinThreshold) { this.indexFieldHoleMinThreshold = indexFieldHoleMinThreshold; } + @Override public boolean getReduceIngestTypes() { return reduceIngestTypes; } @@ -2943,6 +3160,7 @@ public void setReduceIngestTypes(boolean reduceIngestTypes) { this.reduceIngestTypes = reduceIngestTypes; } + @Override public boolean getReduceIngestTypesPerShard() { return reduceIngestTypesPerShard; } @@ -2951,6 +3169,7 @@ public void setReduceIngestTypesPerShard(boolean reduceIngestTypesPerShard) { this.reduceIngestTypesPerShard = reduceIngestTypesPerShard; } + @Override public boolean isSortQueryPreIndexWithImpliedCounts() { return sortQueryPreIndexWithImpliedCounts; } @@ -2959,6 +3178,7 @@ public void setSortQueryPreIndexWithImpliedCounts(boolean sortQueryPreIndexWithI this.sortQueryPreIndexWithImpliedCounts = sortQueryPreIndexWithImpliedCounts; } + @Override public boolean isSortQueryPreIndexWithFieldCounts() { return sortQueryPreIndexWithFieldCounts; } @@ -2967,6 +3187,7 @@ public void setSortQueryPreIndexWithFieldCounts(boolean sortQueryPreIndexWithFie this.sortQueryPreIndexWithFieldCounts = sortQueryPreIndexWithFieldCounts; } + @Override public boolean isSortQueryPostIndexWithFieldCounts() { return sortQueryPostIndexWithFieldCounts; } @@ -2975,6 +3196,7 @@ public void setSortQueryPostIndexWithFieldCounts(boolean sortQueryPostIndexWithF this.sortQueryPostIndexWithFieldCounts = sortQueryPostIndexWithFieldCounts; } + @Override public boolean isSortQueryPostIndexWithTermCounts() { return sortQueryPostIndexWithTermCounts; } @@ -2983,6 +3205,7 @@ public void setSortQueryPostIndexWithTermCounts(boolean sortQueryPostIndexWithTe this.sortQueryPostIndexWithTermCounts = sortQueryPostIndexWithTermCounts; } + @Override public int getCardinalityThreshold() { return cardinalityThreshold; } @@ -3485,6 +3708,7 @@ protected Object readResolve() throws ObjectStreamException { return this; } + @Override public boolean isUseQueryTreeScanHintRules() { return useQueryTreeScanHintRules; } @@ -3493,6 +3717,7 @@ public void setUseQueryTreeScanHintRules(boolean useQueryTreeScanHintRules) { this.useQueryTreeScanHintRules = useQueryTreeScanHintRules; } + @Override public List> getQueryTreeScanHintRules() { return queryTreeScanHintRules; } @@ -3501,6 +3726,7 @@ public void setQueryTreeScanHintRules(List> queryTreeScan this.queryTreeScanHintRules = queryTreeScanHintRules; } + @Override public long getMaxAnyFieldScanTimeMillis() { return maxAnyFieldScanTimeMillis; } @@ -3509,6 +3735,7 @@ public void setMaxAnyFieldScanTimeMillis(long maxAnyFieldScanTimeMillis) { this.maxAnyFieldScanTimeMillis = maxAnyFieldScanTimeMillis; } + @Override public Set getNoExpansionIfCurrentDateTypes() { return noExpansionIfCurrentDateTypes; } @@ -3517,6 +3744,7 @@ public void setNoExpansionIfCurrentDateTypes(Set noExpansionIfCurrentDat this.noExpansionIfCurrentDateTypes = noExpansionIfCurrentDateTypes; } + @Override public DocumentScannerConfig getDocumentScannerConfig() { return documentScannerConfig; } @@ -3525,6 +3753,7 @@ public void setDocumentScannerConfig(DocumentScannerConfig documentScannerConfig this.documentScannerConfig = documentScannerConfig; } + @Override public boolean isUseDocumentScheduler() { return useDocumentScheduler; } @@ -3533,6 +3762,7 @@ public void setUseDocumentScheduler(boolean useDocumentScheduler) { this.useDocumentScheduler = useDocumentScheduler; } + @Override public int getMaxLinesToPrint() { return maxLinesToPrint; } @@ -3541,6 +3771,7 @@ public void setMaxLinesToPrint(int maxLinesToPrint) { this.maxLinesToPrint = maxLinesToPrint; } + @Override public boolean isDeferPushdownPullup() { return deferPushdownPullup; } @@ -3549,6 +3780,7 @@ public void setDeferPushdownPullup(boolean deferPushdownPullup) { this.deferPushdownPullup = deferPushdownPullup; } + @Override public String getDayIndexTableName() { return dayIndexTableName; } @@ -3557,6 +3789,7 @@ public void setDayIndexTableName(String dayIndexTableName) { this.dayIndexTableName = dayIndexTableName; } + @Override public String getYearIndexTableName() { return yearIndexTableName; } @@ -3565,6 +3798,7 @@ public void setYearIndexTableName(String yearIndexTableName) { this.yearIndexTableName = yearIndexTableName; } + @Override public boolean isUseShardedIndex() { return useShardedIndex; } @@ -3573,6 +3807,7 @@ public void setUseShardedIndex(boolean useShardedIndex) { this.useShardedIndex = useShardedIndex; } + @Override public int getDayIndexThreshold() { return dayIndexThreshold; } @@ -3581,6 +3816,7 @@ public void setDayIndexThreshold(int dayIndexThreshold) { this.dayIndexThreshold = dayIndexThreshold; } + @Override public boolean isUseTruncatedIndex() { return useTruncatedIndex; } @@ -3589,6 +3825,7 @@ public void setUseTruncatedIndex(boolean useTruncatedIndex) { this.useTruncatedIndex = useTruncatedIndex; } + @Override public String getTruncatedIndexTableName() { return truncatedIndexTableName; } @@ -3597,6 +3834,7 @@ public void setTruncatedIndexTableName(String truncatedIndexTableName) { this.truncatedIndexTableName = truncatedIndexTableName; } + @Override public AllHitsQueryConfig getAllHitsQueryConfig() { return allHitsQueryConfig; } @@ -3605,6 +3843,7 @@ public void setAllHitsQueryConfig(AllHitsQueryConfig allHitsQueryConfig) { this.allHitsQueryConfig = allHitsQueryConfig; } + @Override public String getOriginalJexlQuery() { return originalJexlQuery; } @@ -3613,6 +3852,7 @@ public void setOriginalJexlQuery(String originalJexlQuery) { this.originalJexlQuery = originalJexlQuery; } + @Override public boolean isUseNewIndexLookups() { return useNewIndexLookups; } 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 26727c21fbf..2ed3a5e675e 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 @@ -33,7 +33,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; @@ -564,7 +563,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 f45f63f2b0b..e6f16dc4b95 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 @@ -77,7 +77,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; @@ -116,7 +116,7 @@ public class RangeStream extends BaseVisitor implements QueryPlanStream { * An assignment to this variable can be used to specify a stream of shards and days anywhere in the query. Used by the date function index query creation. */ - protected final ShardQueryConfiguration config; + protected final ImmutableShardQueryConfiguration config; protected final ScannerFactory scanners; protected final MetadataHelper metadataHelper; protected Iterator itr; @@ -154,7 +154,7 @@ public class RangeStream extends BaseVisitor implements QueryPlanStream { protected int maxLinesToPrint = -1; protected int linesPrinted = 0; - public RangeStream(ShardQueryConfiguration config, ScannerFactory scanners, MetadataHelper metadataHelper) { + public RangeStream(ImmutableShardQueryConfiguration config, ScannerFactory scanners, MetadataHelper metadataHelper) { this.config = config; this.scanners = scanners; this.metadataHelper = metadataHelper; @@ -929,7 +929,7 @@ private void populateCache() { } - public Range rangeForTerm(String term, String field, ShardQueryConfiguration config) { + public Range rangeForTerm(String term, String field, ImmutableShardQueryConfiguration config) { return rangeForTerm(term, field, config.getBeginDate(), config.getEndDate()); } @@ -937,7 +937,7 @@ public Range rangeForTerm(String term, String field, Date start, Date end) { return new Range(new Key(term, field, DateHelper.format(start) + "_"), true, new Key(term, field, DateHelper.format(end) + "_" + '\uffff'), false); } - public static IteratorSetting makeDataTypeFilter(ShardQueryConfiguration config, int stackPosition) { + public static IteratorSetting makeDataTypeFilter(ImmutableShardQueryConfiguration config, int stackPosition) { IteratorSetting is = new IteratorSetting(stackPosition, DataTypeFilter.class); is.addOption(DataTypeFilter.TYPES, config.getDatatypeFilterAsString()); return is; @@ -969,7 +969,7 @@ public static boolean isNormalized(String field, Set 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 72d929ee9b2..bcc94efa167 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); @@ -34,7 +34,7 @@ public abstract class AsyncIndexLookup extends IndexLookup { protected ScanMonitor monitor; - 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/BaseRegexIndexLookup.java b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/BaseRegexIndexLookup.java index a3f3d5a422d..7ade18b52ff 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/BaseRegexIndexLookup.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/BaseRegexIndexLookup.java @@ -10,7 +10,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.tables.ScannerFactory; /** @@ -29,7 +29,7 @@ public abstract class BaseRegexIndexLookup extends AsyncIndexLookup { // used when scanning the shard reverse index private final StringBuilder sb = new StringBuilder(); - public BaseRegexIndexLookup(ShardQueryConfiguration config, ScannerFactory scannerFactory, boolean unfieldedLookup, ExecutorService execService, + public BaseRegexIndexLookup(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, boolean unfieldedLookup, ExecutorService execService, String pattern, Range range, boolean reverse) { super(config, scannerFactory, unfieldedLookup, execService); this.pattern = pattern; 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 6097eb06141..647ea0fdf92 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 @@ -25,7 +25,7 @@ import datawave.core.iterators.CompositeSeekingIterator; import datawave.data.type.DiscreteIndexType; import datawave.query.Constants; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.exceptions.IllegalRangeArgumentException; import datawave.query.jexl.LiteralRange; import datawave.query.tables.ScannerFactory; @@ -66,7 +66,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/FieldNameIndexLookup.java b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/FieldNameIndexLookup.java index a0d345977ef..0a65740a1f9 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; @@ -59,7 +59,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/FieldedRegexIndexLookup.java b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/FieldedRegexIndexLookup.java index d844c024c25..240f80ff332 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/FieldedRegexIndexLookup.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/FieldedRegexIndexLookup.java @@ -16,7 +16,7 @@ import com.google.common.base.Preconditions; import datawave.core.iterators.FieldedRegexExpansionIterator; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.tables.ScannerFactory; import datawave.util.time.DateHelper; @@ -31,8 +31,8 @@ public class FieldedRegexIndexLookup extends BaseRegexIndexLookup { private final String field; - public FieldedRegexIndexLookup(ShardQueryConfiguration config, ScannerFactory scannerFactory, ExecutorService execService, String field, String pattern, - Range range, boolean reverse) { + public FieldedRegexIndexLookup(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, ExecutorService execService, String field, + String pattern, Range range, boolean reverse) { super(config, scannerFactory, false, execService, pattern, range, reverse); this.field = field; 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 4d8473c568a..4b9b9633b2e 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 4d77e843c93..bee867f36a5 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; @@ -78,8 +78,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; @@ -102,8 +102,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 fe0b51dcff5..3b4962d816d 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); Set indexedExpansionFields = getIndexedExpansionFields(expansionFields, false, config.getDatatypeFilter(), helperRef); return new FieldNameIndexLookup(config, scannerFactory, indexedExpansionFields, 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/lookups/UnfieldedLiteralIndexLookup.java b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/UnfieldedLiteralIndexLookup.java index 0dfdd55ee97..00dbaa9ee67 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/UnfieldedLiteralIndexLookup.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/UnfieldedLiteralIndexLookup.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.exceptions.DatawaveFatalQueryException; import datawave.query.tables.ScannerFactory; import datawave.util.time.DateHelper; @@ -40,7 +40,7 @@ public class UnfieldedLiteralIndexLookup extends AsyncIndexLookup { private Future future; - public UnfieldedLiteralIndexLookup(ShardQueryConfiguration config, ScannerFactory scannerFactory, String term, Set fields, + public UnfieldedLiteralIndexLookup(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/UnfieldedRegexIndexLookup.java b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/UnfieldedRegexIndexLookup.java index 6805dd04df0..51b95b8cf8d 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/UnfieldedRegexIndexLookup.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/UnfieldedRegexIndexLookup.java @@ -19,7 +19,7 @@ import com.google.common.base.Preconditions; import datawave.core.iterators.UnfieldedRegexExpansionIterator; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.tables.ScannerFactory; import datawave.util.time.DateHelper; @@ -38,8 +38,8 @@ public class UnfieldedRegexIndexLookup extends BaseRegexIndexLookup { private final int keyThreshold; private final int valueThreshold; - public UnfieldedRegexIndexLookup(ShardQueryConfiguration config, ScannerFactory scannerFactory, ExecutorService execService, String pattern, Range range, - boolean reverse, Set fields) { + public UnfieldedRegexIndexLookup(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, ExecutorService execService, String pattern, + Range range, boolean reverse, Set fields) { super(config, scannerFactory, true, execService, pattern, range, reverse); this.fields = Objects.requireNonNullElse(fields, Collections.emptySet()); this.keyThreshold = config.getMaxUnfieldedExpansionThreshold(); 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 6ea812c7186..9b361c9c439 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 @@ -19,7 +19,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; @@ -62,14 +62,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 1994df63dc0..9ebac7e3bc8 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 @@ -16,7 +16,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; @@ -28,13 +28,13 @@ */ public class BoundedRangeDetectionVisitor extends ShortCircuitBaseVisitor { - ShardQueryConfiguration config; + ImmutableShardQueryConfiguration config; MetadataHelper helper; private Set nonEventFields; @Deprecated(since = "7.35.0", forRemoval = true) - public BoundedRangeDetectionVisitor(ShardQueryConfiguration config, MetadataHelper metadataHelper) { + public BoundedRangeDetectionVisitor(ImmutableShardQueryConfiguration config, MetadataHelper metadataHelper) { this.config = config; this.helper = metadataHelper; } @@ -44,7 +44,7 @@ public BoundedRangeDetectionVisitor(Set nonEventFields) { } @Deprecated(since = "7.35.0", forRemoval = true) - public static boolean mustExpandBoundedRange(ShardQueryConfiguration config, MetadataHelper metadataHelper, JexlNode script) { + public static boolean mustExpandBoundedRange(ImmutableShardQueryConfiguration config, MetadataHelper metadataHelper, JexlNode script) { try { Set nonEventFields = metadataHelper.getNonEventFields(config.getDatatypeFilter()); return mustExpandBoundedRange(script, nonEventFields); 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 282a2b94263..859afcc299f 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 @@ -13,7 +13,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 b4ac0db8bb9..939d4efc399 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 @@ -14,7 +14,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; @@ -24,12 +24,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); @@ -37,11 +37,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 56206886c13..e6b993fd8ad 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 @@ -73,7 +73,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; @@ -368,13 +368,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; @@ -433,15 +434,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<>(); } @@ -452,11 +454,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 @@ -466,7 +469,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); @@ -478,30 +481,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 72ef29c490c..ea244f88e65 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 @@ -46,7 +46,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; @@ -68,11 +68,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); @@ -95,7 +95,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 a98ad482752..b0ab04b6788 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 b96bf8b61f0..71546f79e3b 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.DoNotPerformOptimizedQueryException; import datawave.query.exceptions.EmptyUnfieldedTermExpansionException; @@ -79,13 +79,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); @@ -129,7 +129,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)); @@ -160,7 +160,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); } @@ -766,7 +766,7 @@ protected void validatePattern(String pattern) { } /** - * Wrapper around {@link ShardIndexQueryTableStaticMethods#getRegexRange(Map.Entry, boolean, MetadataHelper, ShardQueryConfiguration)}. + * Wrapper around {@link ShardIndexQueryTableStaticMethods#getRegexRange(Map.Entry, boolean, MetadataHelper, ImmutableShardQueryConfiguration)}. * * @param field * the field 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 c238c22274a..37b937541ed 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 @@ -24,7 +24,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.jexl.JexlASTHelper; @@ -49,7 +49,7 @@ public class UnfieldedIndexExpansionVisitor extends RegexIndexExpansionVisitor { private static final Logger log = LoggerFactory.getLogger(UnfieldedIndexExpansionVisitor.class); // 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"); @@ -85,8 +85,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() || config.isExpandUnfieldedValues()) { 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/DefaultQueryPlanner.java b/warehouse/query-core/src/main/java/datawave/query/planner/DefaultQueryPlanner.java index 3c20abd2401..1685d3f72d0 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 @@ -84,6 +84,7 @@ import datawave.query.common.grouping.GroupFields; import datawave.query.composite.CompositeMetadata; import datawave.query.composite.CompositeUtils; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.config.ScanHintRule; import datawave.query.config.ShardQueryConfiguration; import datawave.query.exceptions.CannotExpandUnfieldedTermFatalException; @@ -3129,7 +3130,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 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 12af5d05fe4..614218da910 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 a11f5ef2007..1fd62e4ebf8 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 @@ -15,7 +15,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; @@ -34,7 +34,7 @@ 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 @@ -50,7 +50,7 @@ public class PushdownFunction implements Function> * @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; @@ -108,7 +108,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 5d9df8647be..3f16da80c3e 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 @@ -39,7 +39,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; @@ -60,7 +60,7 @@ public class BatchScannerSession extends ScannerSession implements Iterator executionHints = Collections.emptyMap(); protected ConsistencyLevel consistencyLevel = ConsistencyLevel.IMMEDIATE; - protected ShardQueryConfiguration queryConfig; + protected ImmutableShardQueryConfiguration queryConfig; protected ReadWriteLock readWriteLock = new ReentrantReadWriteLock(); public SessionOptions() {} - public SessionOptions(SessionOptions options) { - setOptions(this, options); + public SessionOptions(SessionOptions other) { + this.queryConfig = other.queryConfig; } protected static void setOptions(SessionOptions dst, SessionOptions src) { @@ -294,7 +294,7 @@ public void setConsistencyLevel(ConsistencyLevel level) { * * @return the configuration */ - public ShardQueryConfiguration getQueryConfiguration() { + public ImmutableShardQueryConfiguration getQueryConfiguration() { return queryConfig; } @@ -304,7 +304,7 @@ public ShardQueryConfiguration getQueryConfiguration() { * @param queryConfig * the configuration */ - public void setQueryConfiguration(ShardQueryConfiguration queryConfig) { + public void setQueryConfiguration(ImmutableShardQueryConfiguration queryConfig) { this.queryConfig = queryConfig; } diff --git a/warehouse/query-core/src/main/java/datawave/query/tables/ShardQueryLogic.java b/warehouse/query-core/src/main/java/datawave/query/tables/ShardQueryLogic.java index 2a060393b8f..dcdbf8d8e7c 100644 --- a/warehouse/query-core/src/main/java/datawave/query/tables/ShardQueryLogic.java +++ b/warehouse/query-core/src/main/java/datawave/query/tables/ShardQueryLogic.java @@ -81,6 +81,7 @@ import datawave.query.attributes.UniqueFields; import datawave.query.cardinality.CardinalityConfiguration; import datawave.query.common.grouping.GroupFields; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.config.IndexValueHole; import datawave.query.config.Profile; import datawave.query.config.ScanHintRule; @@ -288,7 +289,8 @@ public ShardQueryLogic(ShardQueryLogic other) { } } - public static BatchScanner createBatchScanner(ShardQueryConfiguration config, ScannerFactory scannerFactory, QueryData qd) throws TableNotFoundException { + public static BatchScanner createBatchScanner(ImmutableShardQueryConfiguration config, ScannerFactory scannerFactory, QueryData qd) + throws TableNotFoundException { final BatchScanner bs = scannerFactory.newScanner(config.getShardTableName(), config.getAuthorizations(), config.getNumQueryThreads(), config.getQuery()); diff --git a/warehouse/query-core/src/main/java/datawave/query/tables/TruncatedIndexScanner.java b/warehouse/query-core/src/main/java/datawave/query/tables/TruncatedIndexScanner.java index 61f3f53f05b..4d46a69013b 100644 --- a/warehouse/query-core/src/main/java/datawave/query/tables/TruncatedIndexScanner.java +++ b/warehouse/query-core/src/main/java/datawave/query/tables/TruncatedIndexScanner.java @@ -19,7 +19,7 @@ import com.google.common.base.Joiner; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.index.lookup.DataTypeFilter; import datawave.query.index.lookup.IndexInfo; import datawave.query.index.lookup.TruncatedIndexIterator; @@ -52,7 +52,7 @@ public class TruncatedIndexScanner implements Iterator> private final DateIterator dateIterator; private final BitSetIterator bitsetIterator; - public TruncatedIndexScanner(ShardQueryConfiguration config) { + public TruncatedIndexScanner(ImmutableShardQueryConfiguration config) { this(config.getClient(), DateHelper.format(config.getBeginDate()), DateHelper.format(config.getEndDate())); } 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 657e709f5a4..40b182ddd17 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 @@ -40,7 +40,7 @@ import datawave.core.common.util.TypeFilter; import datawave.core.iterators.filesystem.FileSystemCache; import datawave.microservice.query.Query; -import datawave.query.config.ShardQueryConfiguration; +import datawave.query.config.ImmutableShardQueryConfiguration; import datawave.query.exceptions.DatawaveFatalQueryException; import datawave.query.exceptions.InvalidQueryException; import datawave.query.iterator.QueryOptions; @@ -80,7 +80,7 @@ public class VisitorFunction implements Function { protected static FileSystemCache fileSystemCache = null; - private ShardQueryConfiguration config; + private ImmutableShardQueryConfiguration config; protected MetadataHelper metadataHelper; protected Set indexedFields; protected Set indexOnlyFields; @@ -94,7 +94,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) { @@ -624,7 +624,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()) { @@ -695,7 +695,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 1499ce689c1..08e1f828739 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; @@ -689,6 +690,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)); @@ -730,44 +768,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 */