Date: Add DateFormatters class that uses java.time#30612
Closed
spinscale wants to merge 41 commits intoelastic:java-timefrom
Closed
Date: Add DateFormatters class that uses java.time#30612spinscale wants to merge 41 commits intoelastic:java-timefrom
spinscale wants to merge 41 commits intoelastic:java-timefrom
Conversation
A newly added class called DateFormatters now contains java.time based builders for dates, which also intends to be fully backwards compatible, when the name based date formatters are picked. A duelling test class has been added that ensures the same dates when parsing java or joda time formatted dates for the name based dates. A first user of this class is the ingest module, which now uses java.time under the hood instead of joda time. Note, that java.time and joda time are not fully backwards compatible, which also means that old formats will currently not work with this setup.
Collaborator
|
Pinging @elastic/es-core-infra |
4728a07 to
804c56f
Compare
Contributor
Author
|
@elasticmachine retest this please |
Contributor
Author
|
this fails on CI due to a discrepancy between java8 and java 10... java 10 works as expected, but java 8 fails, this is a test that will not work on java8 but will on java10 |
Updates the build.gradle to take into account the OS differences for Windows (in particular line separator and project naming)
…1804) Job updates or changes to calendars or filters may result into updating the job process if it has been running. To preserve the order of updates, process updates are queued through the UpdateJobProcessNotifier which is only running on the master node. All actions performing such updates must run on the master node. However, the CRUD actions for calendars and filters are not master node actions. They have been submitting the updates to the UpdateJobProcessNotifier even though it might have not been running (given the action was run on a non-master node). When that happens, the update never reaches the process. This commit fixes this problem by ensuring the notifier runs on all nodes and by ensuring the process update action gets the resources again before updating the process (instead of having those resources passed in the request). This ensures that even if the order of the updates gets messed up, the latest update will read the latest state of those resource and the process will get back in sync. This leaves us with 2 types of updates: 1. updates to the job config should happen on the master node. This is because we cannot refetch the entire job and update it. We need to know the parts that have been changed. 2. updates to resources the job uses. Those can be handled on non-master nodes but they should be re-fetched by the update process action. Closes elastic#31803
…tic#31800) Job persistent tasks with stale allocation IDs used to always be considered as OPENING jobs in the ML job node allocation decision. However, FAILED jobs are not relocated to other nodes, which leads to them blocking up the nodes they failed on after node restarts. FAILED jobs should not restrict how many other jobs can open on a node, regardless of whether they are stale or not. Closes elastic#31794
…stic#31817) It seems that java 11 tightened some validations with regard to time formats. The random instance creator was setting an odd time format to the data description which is invalid when run with java 11. This commit changes it to a valid format.
…ic#31394) Removes support for storing scripts without the usual json around the script. So You can no longer do: ``` POST _scripts/<templatename> { "query": { "match": { "title": "{{query_string}}" } } } ``` and must instead do: ``` POST _scripts/<templatename> { "script": { "lang": "mustache", "source": { "query": { "match": { "title": "{{query_string}}" } } } } } ``` This improves error reporting when you attempt to store a script but don't quite get the syntax right. Before, there was a good chance that we'd think of it as a "raw" template and just store it. Now we won't do that. Nice.
At the end of every `ESRestTestCase` we clean the cluster which includes deleting all of the templates. If xpack is installed it'll automatically recreate a few templates every time they are removed. Which is slow. This change stops the cleanup from removing the xpack templates. It cuts the time to run the docs tests more than in half and it probably saves a bit more time on other tests as well.
Member
|
@spinscale I see this PR is against the java-time branch. Can this new DateFormatters class be added to master/6.x directly? I noticed there are a lot of unrelated diffs because the branch is out of date from master. |
Contributor
Author
|
Superceded by #31856 (which is already in master) |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A newly added class called DateFormatters now contains java.time based
builders for dates, which also intends to be fully backwards compatible,
when the name based date formatters are picked.
A duelling test class has been added that ensures the same dates when
parsing java or joda time formatted dates for the name based dates.
A first user of this class is the ingest module, which now uses
java.time under the hood instead of joda time.
Note, that java.time and joda time are not fully backwards compatible,
which also means that old formats will currently not work with this
setup.