-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[Test] Allow configuring configDir for the Java test cluster #125094
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
Merged
elasticsearchmachine
merged 12 commits into
elastic:main
from
ywangd:add-and-remove-file-on-java-test-cluster
Mar 20, 2025
Merged
Changes from 8 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
280d89d
[Test] Allow add and remove files on Java test cluster
ywangd 7fe0911
typo
ywangd 46b2849
add spec option for config dir function
ywangd a3bd7a2
revert changes for add/remove config files
ywangd 942695e
more removal
ywangd df7c6e7
[CI] Auto commit changes from spotless
9592e91
Merge remote-tracking branch 'origin/main' into add-and-remove-file-o…
ywangd 0851c4d
change to use raw path
ywangd d8bb5cd
replace with supplier
ywangd 0651da0
reduce laziness
ywangd b69d60e
Merge branch 'main' into add-and-remove-file-on-java-test-cluster
elasticmachine d6b7838
tweak
ywangd 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
import org.elasticsearch.test.cluster.util.Version; | ||
import org.elasticsearch.test.cluster.util.resource.Resource; | ||
|
||
import java.nio.file.Path; | ||
import java.util.function.Consumer; | ||
import java.util.function.Predicate; | ||
import java.util.function.Supplier; | ||
|
@@ -155,4 +156,10 @@ interface LocalSpecBuilder<T extends LocalSpecBuilder<?>> { | |
* Adds an additional command line argument to node JVM arguments. | ||
*/ | ||
T jvmArg(String arg); | ||
|
||
/** | ||
* Register a function to compute config directory based on the node name. The default config directory | ||
|
||
* is used when the function is null or the return value of the function is null. | ||
*/ | ||
T withConfigDir(Path configDir); | ||
} |
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.
Why do we need to do this path -> file -> path conversion?
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.
The last conversion gives a String. The reason is that temporary directory created by Lucene temporariy directory, e.g.
LuceneTestCase#createTempDir
returns a LuceneFilterDirectory
which always works forresolve(String)
but throws forresolve(Path)
if the givenPath
argument is not also aFilterDirectory
. Since I changed the other PR to use Junit's TemporaryDirectory, this is no longer an issue for now. But I think it might be worthwhile to keep the change so that it does not just break if someone decides to use Lucene temporary in future?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.
I don't have super strong feelings about working around idiosyncrasies with lucene types. Can this be simplified to
relativePath.toString()
?