-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consolidate Ivarator Config #2655
Open
SethSmucker
wants to merge
32
commits into
integration
Choose a base branch
from
task/consolidate-ivaratorconfig
base: integration
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
dd97c1e
Add IvaratorConfig class
SethSmucker 94ce5ee
Add to QueryOptions
SethSmucker 16516a9
GitHub Actions: Fix Formatting
a775c2a
Fix type conversion issues
SethSmucker 079cbd1
Add serialization and QueryOption option
SethSmucker cd78978
Fix formatting issues
SethSmucker 0bef499
Merge branch 'integration' into task/consolidate-ivaratorconfig
SethSmucker 0acf575
Add tests
SethSmucker 2e1917f
Finish tests
SethSmucker b59258d
merge
SethSmucker f8499ee
GitHub Actions: Fix Formatting
8e9e0ad
Merge branch 'integration' into task/consolidate-ivaratorconfig
SethSmucker b8a57be
Fix ShardQueryConfigurationTest issue
SethSmucker 252e9f2
merge
SethSmucker b7cc60c
trivial commit
SethSmucker 9273e65
merge
SethSmucker dcdf3ae
GitHub Actions: Fix Formatting
bb7ceb9
Added lazy initialization
SethSmucker 59b1ce6
Merge cardinality
SethSmucker fea3168
Cardinality
SethSmucker 6abfef7
Cardinality
SethSmucker 20cc7bd
Merge branch 'integration' into task/consolidate-ivaratorconfig
SethSmucker e9da6db
GitHub Actions: Fix Formatting
1f02164
Merge branch 'integration' into task/consolidate-ivaratorconfig
SethSmucker ddd5466
Merge branch 'integration' into task/consolidate-ivaratorconfig
SethSmucker 21c54dd
Copy IvaratorConfig files over
SethSmucker 429797c
Apply wanted changes
SethSmucker d3e64cb
Merge from fix branch
SethSmucker 7127169
GitHub Actions: Fix Formatting
ef2c835
Add resultTimeout
SethSmucker 785feb0
Add resultTimeout
SethSmucker 1de49d1
GitHub Actions: Fix Formatting
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Submodule base-rest-responses
updated
2 files
+1 −1 | pom.xml | |
+0 −4 | src/main/java/datawave/webservice/query/exception/DatawaveErrorCode.java |
Submodule type-utils
updated
3 files
+1 −1 | pom.xml | |
+0 −16 | src/main/java/datawave/data/type/util/AbstractGeometry.java | |
+1 −9 | src/main/java/datawave/data/type/util/Geometry.java |
Submodule accumulo
updated
1 files
+2 −1 | service/src/main/java/datawave/microservice/accumulo/mock/MockAccumuloConfiguration.java |
Submodule query-metric
updated
9 files
217 changes: 217 additions & 0 deletions
217
warehouse/query-core/src/main/java/datawave/query/config/IvaratorConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,217 @@ | ||
package datawave.query.config; | ||
|
||
import java.io.Serializable; | ||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import com.fasterxml.jackson.databind.DeserializationFeature; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.databind.SerializationFeature; | ||
|
||
import datawave.query.iterator.ivarator.IvaratorCacheDirConfig; | ||
import datawave.query.util.sortedset.FileSortedSet; | ||
|
||
public class IvaratorConfig implements Serializable { | ||
|
||
private List<IvaratorCacheDirConfig> ivaratorCacheDirConfigs = Collections.emptyList(); | ||
private String ivaratorFstHdfsBaseURIs = null; | ||
private int ivaratorCacheBufferSize = 10000; | ||
private long ivaratorCacheScanPersistThreshold = 100000L; | ||
private long ivaratorCacheScanTimeout = 1000L * 60 * 60; | ||
private int maxFieldIndexRangeSplit = 11; | ||
private int ivaratorMaxOpenFiles = 100; | ||
private int ivaratorNumRetries = 2; | ||
private boolean ivaratorPersistVerify = true; | ||
private int ivaratorPersistVerifyCount = 100; | ||
private long maxIvaratorSources = 33; | ||
private long maxIvaratorSourceWait = 1000L * 60 * 30; | ||
private long maxIvaratorResults = -1; | ||
|
||
private static final ObjectMapper objectMapper = new ObjectMapper(); | ||
|
||
static { | ||
objectMapper.configure(SerializationFeature.WRITE_SINGLE_ELEM_ARRAYS_UNWRAPPED, true); | ||
objectMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true); | ||
} | ||
|
||
public IvaratorConfig() {} | ||
|
||
public IvaratorConfig(IvaratorConfig other) { | ||
copyFrom(other); | ||
} | ||
|
||
public void copyFrom(IvaratorConfig other) { | ||
this.setIvaratorCacheDirConfigs((other.getIvaratorCacheDirConfigs() == null) ? null : new ArrayList<>(other.getIvaratorCacheDirConfigs())); | ||
this.setIvaratorFstHdfsBaseURIs(other.getIvaratorFstHdfsBaseURIs()); | ||
this.setIvaratorCacheBufferSize(other.getIvaratorCacheBufferSize()); | ||
this.setIvaratorCacheScanPersistThreshold(other.getIvaratorCacheScanPersistThreshold()); | ||
this.setIvaratorCacheScanTimeout(other.getIvaratorCacheScanTimeout()); | ||
this.setMaxFieldIndexRangeSplit(other.getMaxFieldIndexRangeSplit()); | ||
this.setIvaratorMaxOpenFiles(other.getIvaratorMaxOpenFiles()); | ||
this.setIvaratorNumRetries(other.getIvaratorNumRetries()); | ||
this.setIvaratorPersistVerify(other.isIvaratorPersistVerify()); | ||
this.setIvaratorPersistVerifyCount(other.getIvaratorPersistVerifyCount()); | ||
this.setMaxIvaratorSources(other.getMaxIvaratorSources()); | ||
|
||
} | ||
|
||
public static String toJson(IvaratorConfig IvaratorConfig) throws JsonProcessingException { | ||
return objectMapper.writeValueAsString(IvaratorConfig); | ||
} | ||
|
||
public static IvaratorConfig fromJson(String jsonArray) throws JsonProcessingException { | ||
return objectMapper.readValue(jsonArray, IvaratorConfig.class); | ||
} | ||
|
||
public List<IvaratorCacheDirConfig> getIvaratorCacheDirConfigs() { | ||
return ivaratorCacheDirConfigs; | ||
} | ||
|
||
public IvaratorConfig setIvaratorCacheDirConfigs(List<IvaratorCacheDirConfig> ivaratorCacheDirConfigs) { | ||
this.ivaratorCacheDirConfigs = ivaratorCacheDirConfigs; | ||
return this; | ||
} | ||
|
||
public String getIvaratorFstHdfsBaseURIs() { | ||
return ivaratorFstHdfsBaseURIs; | ||
} | ||
|
||
public IvaratorConfig setIvaratorFstHdfsBaseURIs(String ivaratorFstHdfsBaseURIs) { | ||
this.ivaratorFstHdfsBaseURIs = ivaratorFstHdfsBaseURIs; | ||
return this; | ||
} | ||
|
||
public int getIvaratorCacheBufferSize() { | ||
return ivaratorCacheBufferSize; | ||
} | ||
|
||
public IvaratorConfig setIvaratorCacheBufferSize(int ivaratorCacheBufferSize) { | ||
this.ivaratorCacheBufferSize = ivaratorCacheBufferSize; | ||
return this; | ||
} | ||
|
||
public long getIvaratorCacheScanPersistThreshold() { | ||
return ivaratorCacheScanPersistThreshold; | ||
} | ||
|
||
public IvaratorConfig setIvaratorCacheScanPersistThreshold(long ivaratorCacheScanPersistThreshold) { | ||
this.ivaratorCacheScanPersistThreshold = ivaratorCacheScanPersistThreshold; | ||
return this; | ||
} | ||
|
||
public long getIvaratorCacheScanTimeout() { | ||
return ivaratorCacheScanTimeout; | ||
} | ||
|
||
public IvaratorConfig setIvaratorCacheScanTimeout(long ivaratorCacheScanTimeout) { | ||
this.ivaratorCacheScanTimeout = ivaratorCacheScanTimeout; | ||
return this; | ||
} | ||
|
||
public int getMaxFieldIndexRangeSplit() { | ||
return maxFieldIndexRangeSplit; | ||
} | ||
|
||
public IvaratorConfig setMaxFieldIndexRangeSplit(int maxFieldIndexRangeSplit) { | ||
this.maxFieldIndexRangeSplit = maxFieldIndexRangeSplit; | ||
return this; | ||
} | ||
|
||
public int getIvaratorMaxOpenFiles() { | ||
return ivaratorMaxOpenFiles; | ||
} | ||
|
||
public IvaratorConfig setIvaratorMaxOpenFiles(int ivaratorMaxOpenFiles) { | ||
this.ivaratorMaxOpenFiles = ivaratorMaxOpenFiles; | ||
return this; | ||
} | ||
|
||
public int getIvaratorNumRetries() { | ||
return ivaratorNumRetries; | ||
} | ||
|
||
public IvaratorConfig setIvaratorNumRetries(int ivaratorNumRetries) { | ||
this.ivaratorNumRetries = ivaratorNumRetries; | ||
return this; | ||
} | ||
|
||
public boolean isIvaratorPersistVerify() { | ||
return ivaratorPersistVerify; | ||
} | ||
|
||
public IvaratorConfig setIvaratorPersistVerify(boolean ivaratorPersistVerify) { | ||
this.ivaratorPersistVerify = ivaratorPersistVerify; | ||
return this; | ||
} | ||
|
||
public int getIvaratorPersistVerifyCount() { | ||
return ivaratorPersistVerifyCount; | ||
} | ||
|
||
public IvaratorConfig setIvaratorPersistVerifyCount(int ivaratorPersistVerifyCount) { | ||
this.ivaratorPersistVerifyCount = ivaratorPersistVerifyCount; | ||
return this; | ||
} | ||
|
||
public long getMaxIvaratorSources() { | ||
return maxIvaratorSources; | ||
} | ||
|
||
public IvaratorConfig setMaxIvaratorSources(long maxIvaratorSources) { | ||
this.maxIvaratorSources = maxIvaratorSources; | ||
return this; | ||
} | ||
|
||
public long getMaxIvaratorSourceWait() { | ||
return maxIvaratorSourceWait; | ||
} | ||
|
||
public IvaratorConfig setMaxIvaratorSourceWait(long maxIvaratorSourceWait) { | ||
this.maxIvaratorSourceWait = maxIvaratorSourceWait; | ||
return this; | ||
} | ||
|
||
public long getMaxIvaratorResults() { | ||
return maxIvaratorResults; | ||
} | ||
|
||
public IvaratorConfig setMaxIvaratorResults(long maxIvaratorResults) { | ||
this.maxIvaratorResults = maxIvaratorResults; | ||
return this; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) { | ||
return true; | ||
} | ||
if (obj == null || getClass() != obj.getClass()) { | ||
return false; | ||
} | ||
IvaratorConfig other = (IvaratorConfig) obj; | ||
return getIvaratorCacheBufferSize() == other.getIvaratorCacheBufferSize() | ||
&& getIvaratorCacheScanPersistThreshold() == other.getIvaratorCacheScanPersistThreshold() | ||
&& getIvaratorCacheScanTimeout() == other.getIvaratorCacheScanTimeout() | ||
&& getMaxFieldIndexRangeSplit() == other.getMaxFieldIndexRangeSplit() && getIvaratorMaxOpenFiles() == other.getIvaratorMaxOpenFiles() | ||
&& getIvaratorNumRetries() == other.getIvaratorNumRetries() && isIvaratorPersistVerify() == other.isIvaratorPersistVerify() | ||
&& getIvaratorPersistVerifyCount() == other.getIvaratorPersistVerifyCount() && getMaxIvaratorSources() == other.getMaxIvaratorSources() | ||
&& getMaxIvaratorSourceWait() == other.getMaxIvaratorSourceWait() && getMaxIvaratorResults() == other.getMaxIvaratorResults() | ||
&& (getIvaratorCacheDirConfigs() == null ? other.getIvaratorCacheDirConfigs() == null | ||
: getIvaratorCacheDirConfigs().equals(other.getIvaratorCacheDirConfigs())) | ||
&& (getIvaratorFstHdfsBaseURIs() == null ? other.getIvaratorFstHdfsBaseURIs() == null | ||
: getIvaratorFstHdfsBaseURIs().equals(other.getIvaratorFstHdfsBaseURIs())); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(getIvaratorCacheDirConfigs(), getIvaratorFstHdfsBaseURIs(), getIvaratorCacheBufferSize(), getIvaratorCacheScanPersistThreshold(), | ||
getIvaratorCacheScanTimeout(), getMaxFieldIndexRangeSplit(), getIvaratorMaxOpenFiles(), getIvaratorNumRetries(), | ||
isIvaratorPersistVerify(), getIvaratorPersistVerifyCount(), getMaxIvaratorSources(), getMaxIvaratorSourceWait(), | ||
getMaxIvaratorResults()); | ||
} | ||
|
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Add a class level comment that this class encapsulates all ivarator configs in a single object to simplify serialization of configs between the webservice and tablet servers