Commit Graph

1929 Commits

Author SHA1 Message Date
David Kyle e7dcab48ab Test was testing the wrong endpoint
Original commit: elastic/x-pack-elasticsearch@ca7a1a1097
2017-02-03 14:50:08 +00:00
Jason Tedor 45734aae22 Upgrade checkstyle to version 7.5
This commit upgrades the checkstyle configuration from version 5.9 to
version 7.5, the latest version as of today. The main enhancement
obtained via this upgrade is better detection of redundant modifiers.

Relates elastic/elasticsearch#4810

Original commit: elastic/x-pack-elasticsearch@2c9b7d23dc
2017-02-03 09:47:04 -05:00
David Kyle 70b8129b78 Add job update endpoint (elastic/elasticsearch#854)
* Remove redundant code

* Add job update endpoint

* Support updating detector description & rules

* Fix merge conflicts

* Use toStrings and fix race condition in update

* Revert to using xpack.ml.support.AbstractSerializingTestCase

Original commit: elastic/x-pack-elasticsearch@771ada0572
2017-02-03 14:22:36 +00:00
Adrien Grand 16be5ecc81 Clean up field-level security. (elastic/elasticsearch#4784)
This commit reuses the automaton that defines the allowed fields in
`FieldSubsetReader` rather than resolving the list of all matching fields from
the mapping. As a side-effect this change solves a bug that unmapped fields
could previously not be read from the source. Moreover it avoids determinization
errors in the case that the number of matching fields is high.

It also uses `CharacterRunAutomaton` to evaluate automata against a given
string, which should be faster than naively stepping into the automaton since
`CharacterRunAutomaton` builds a lookup table of transitions.

Closes elastic/elasticsearch#4679

Original commit: elastic/x-pack-elasticsearch@a30913dbd5
2017-02-03 12:31:04 +01:00
Dimitrios Athanasiou 2883b00b7c Also rename some *Status*Tests to *State*Tests
Original commit: elastic/x-pack-elasticsearch@6e1d3e2bba
2017-02-03 11:08:02 +00:00
Alexander Reelsen 44618b5b87 Watcher: Prevent NPE if watcher indices are closed (elastic/elasticsearch#4763)
The way we check for the triggered watches on start-up did not take into account
that an index could be closed and thus resulted in an NPE.

This commit adds a check to ensure that the watch index and triggered watches index
are open, before trying to check if all primary shards are active.

Original commit: elastic/x-pack-elasticsearch@ee05779963
2017-02-03 11:44:48 +01:00
Dimitris Athanasiou ca4badeb46 Rename {Job|Datafeed}Status to {Job|Datafeed}State (elastic/elasticsearch#856)
This is more consistent with elasticsearch where an index
has state [open, close], etc.

Original commit: elastic/x-pack-elasticsearch@30bf720c3e
2017-02-03 10:43:05 +00:00
David Kyle b940dbf6d9 Remove the overwrite option from PUT job (elastic/elasticsearch#855)
Original commit: elastic/x-pack-elasticsearch@0f7e0d35a9
2017-02-03 09:54:47 +00:00
Jay Modi 1f32ef21a2 Update to pass content type from the rest APIs to transport requests (elastic/elasticsearch#4689)
This change adapts x-pack to pass on the parsed XContentType from rest requests to transport
requests and use this value in place of attempting to auto-detect the content type.

Original commit: elastic/x-pack-elasticsearch@57475fd403
2017-02-02 14:08:34 -05:00
Igor Motov 53a5e19c70 Add support for task status on persistent tasks
Similarly to task status on normal tasks it's now possible to update task status on the persistent tasks. This should allow updating the state of the running tasks (such as loading, started, etc) as well as store intermediate state or progress.

Original commit: elastic/x-pack-elasticsearch@ed109cfa84
2017-02-02 13:35:37 -05:00
Martijn van Groningen 06d688eb74 AutodetectProcessManager#getStatistics(...) should can now just return stats for single job as the _all expension is done on the transport layer
Original commit: elastic/x-pack-elasticsearch@02d5272a4e
2017-02-02 13:11:39 +01:00
Dimitris Athanasiou 5ba9a6cfcc Clear scroll after it is complete (elastic/elasticsearch#847)
The ScrollDataExtractor needs to clear the scroll after
it is complete. Originally, it was thought that completing a scroll
leads to an automatic clearing of its context. That is not true,
thus manual clearing has to be requested.

- Also removes sorting in AggregationDataExtractor as it was redundant

Original commit: elastic/x-pack-elasticsearch@8f955da8ce
2017-02-02 10:18:36 +00:00
Zachary Tong a11ddd1e04 Integrate domainSplit function into datafeeds (elastic/elasticsearch#841)
If `domainSplit(` is detected in an inline script, the function and params are injected into
the script.

The majority of this PR is actually test-related.  Adds a unit test to check for the injected
script/params.  Also adds another QA test which -- through a very round-about mechanism --
confirms that the injected script compiles and functions correctly.  The QA test can
be simplified greatly once the Preview API is added.

Original commit: elastic/x-pack-elasticsearch@c7c35a982c
2017-02-01 10:20:00 -05:00
Martijn van Groningen ec902c4dc3 test: change assertion to be more lenient to platform specifics
Original commit: elastic/x-pack-elasticsearch@2131e7f0c7
2017-02-01 14:49:45 +01:00
Ali Beyad 4f4d262323 Adds bwc index for 5.2.0
Original commit: elastic/x-pack-elasticsearch@7b526b241a
2017-01-31 17:13:01 -05:00
Martijn van Groningen 051d8d8fdf Moved start and stop datafeeder apis over the persistent task infrastructure
Original commit: elastic/x-pack-elasticsearch@8e15578fb7
2017-01-31 22:50:00 +01:00
Martijn van Groningen 22282e9d56 cleanup toString() methods
Original commit: elastic/x-pack-elasticsearch@17a10ea68f
2017-01-31 22:35:54 +01:00
Martijn van Groningen ce6dc4a506 Make job stats api task aware.
This will allow the job stats api to redirect the request to node where job is running.

Original commit: elastic/x-pack-elasticsearch@9f1d12dfcb
2017-01-31 22:35:54 +01:00
Jack Conradson 7f0ecc4b30 Change Namespace for Stored Script to Only Use Id (elastic/elasticsearch#4387)
Changes the behavior in x-pack necessary to support the elasticsearch change elastic/elasticsearch#22206.

Original commit: elastic/x-pack-elasticsearch@916e72e263
2017-01-31 13:28:03 -08:00
Martijn van Groningen b07e9bbd07 Fixed AOBE caused by fetching model state when opening a job.
This error only occurred for jobs that have been opened before and persisted model state.

Closes elastic/elasticsearch#836

Original commit: elastic/x-pack-elasticsearch@ad76f4167f
2017-01-31 19:56:24 +01:00
David Roberts 7ff3b707a8 Make renormalization thread-safe (elastic/elasticsearch#840)
Each ScoresUpdater needs its own JobRenormalizedResultsPersister, because
each JobRenormalizedResultsPersister has a single BulkRequest that various
methods update.

Fixes elastic/elasticsearch#838

Original commit: elastic/x-pack-elasticsearch@90f4bbd5a0
2017-01-31 16:51:26 +00:00
David Kyle 97970b94cd Remove the ignoreDowntime parameter from the _data endpoint (elastic/elasticsearch#834)
The parameter only applies when a job is opened

Original commit: elastic/x-pack-elasticsearch@37b902aa2a
2017-01-31 11:48:58 +00:00
David Roberts 34274a30ed Make transport layer names consistent with corresponding endpoints (elastic/elasticsearch#822)
Closes elastic/elasticsearch#630

Original commit: elastic/x-pack-elasticsearch@32aae3e1d9
2017-01-31 11:42:06 +00:00
David Kyle c84f227857 Set memory usage log message to trace (elastic/elasticsearch#829)
Original commit: elastic/x-pack-elasticsearch@13412cc4cf
2017-01-31 09:54:56 +00:00
David Roberts ab957b6d91 Adjust validation endpoints (elastic/elasticsearch#812)
Changes are:

1. The detector validation endpoint is changed from /_xpack/ml/_validate/detector
   to /_xpack/ml/anomaly_detectors/_validate/detector
2. A new endpoint is added for validating an entire job config:
   /_xpack/ml/anomaly_detectors/_validate

Relates elastic/elasticsearch#630

Original commit: elastic/x-pack-elasticsearch@7b2031e746
2017-01-30 17:10:22 +00:00
David Kyle 4eab74ce29 Store input fields for anomaly records and influencers (elastic/elasticsearch#799)
* Store input fields for anomaly records and influencers

* Address review comments

* Remove DotNotationReverser

* Remove duplicated constants

* Can’t use the same date for all records as they will have equivalent Ids

Original commit: elastic/x-pack-elasticsearch@40796b5efc
2017-01-30 14:05:18 +00:00
Colin Goodheart-Smithe 79d1a10a86 Mutes DataFeedJobIT test method that uses painless
This needs to be moved to the single-node-tests qa modules since integTests shouldn’t access modules.

Original commit: elastic/x-pack-elasticsearch@289b697eb8
2017-01-30 10:55:59 +00:00
Colin Goodheart-Smithe 618cb2a1a0 Make all action names cluster actions
Original commit: elastic/x-pack-elasticsearch@815d8f0aac
2017-01-30 10:00:23 +00:00
Igor Motov 827118e154 Adds support for persistent actions
A persistent action is a transport-like action that is using the cluster state instead of transport to start tasks. This allows persistent tasks to survive restart of executing nodes. A persistent action can be implemented by extending TransportPersistentAction. TransportPersistentAction will start the task by using PersistentActionService, which controls persistent tasks lifecycle.  See TestPersistentActionPlugin for an example implementing a persistent action.

Original commit: elastic/x-pack-elasticsearch@8ef4103cd6
2017-01-27 11:20:54 -05:00
Martijn van Groningen ff65c38253 [TEST] fixed mocking logic to include id
Original commit: elastic/x-pack-elasticsearch@7b20e92fdc
2017-01-27 17:20:18 +01:00
Martijn van Groningen 2059b91620 Workaround for index request without an id being retried that are tripping an assertion in internal engine. (2)
Original commit: elastic/x-pack-elasticsearch@22d5060deb
2017-01-27 17:07:51 +01:00
Martijn van Groningen ad4218320c Workaround for index request without an id being retried that are tripping an assertion in internal engine.
Original commit: elastic/x-pack-elasticsearch@ba44acc28b
2017-01-27 16:15:00 +01:00
Simon Willnauer 795a8a84ed Remove obsolete transport handlers
Original commit: elastic/x-pack-elasticsearch@9a9ce85b76
2017-01-27 16:05:47 +01:00
David Roberts 64fdb039ab Reduce the controller connect timeout (elastic/elasticsearch#804)
This used to be 60 seconds, dating back to the days when the controller
had to be started manually after starting Elasticsearch.  However, now
Elasticsearch starts it automatically it should already be running when
we try to connect, so the timeout can be much lower.  It just needs to
be long enough to give the C++ process time to create its named pipes.
2 seconds seems reasonable, and matches what we use for autodetect and
normalize.

Original commit: elastic/x-pack-elasticsearch@7300d68482
2017-01-27 14:23:18 +00:00
Zachary Tong 9395ef81b1 Painless DomainSplit tests in new Single-Node QA Module (elastic/elasticsearch#787)
This contains the Painless-based DomainSplit function, generated static maps and basic tests.  Due to cross-module complications, the tests are run by executing searches with script_fields and checking the response


Original commit: elastic/x-pack-elasticsearch@c6c2942e01
2017-01-27 08:52:48 -05:00
Dimitris Athanasiou 91be1e719d Disable stored_fields when possible in ScrollDataExtractor (elastic/elasticsearch#801)
When source fields are not required, stored_fields can be disabled.
This can make the query faster as no stored fields have to be
decompressed. Note that this means no metadata (_id, _index, _type, etc.)
will be returned.

Original commit: elastic/x-pack-elasticsearch@b1ea526d83
2017-01-27 11:38:54 +00:00
Tim Brooks 5f84ddee7c Add doPrivileged blocks for socket connect ops (elastic/elasticsearch#4701)
This is related to elastic/elasticsearch#22116. X-pack opens socket connections for a number
of pieces of functionality (Active Directory support, ssl, email
notification, etc). As SocketPermissions are transitioned out of core,
x-pack will require connect permission. This pull request wraps
operations requiring these permissions in doPrivileged blocks.

Original commit: elastic/x-pack-elasticsearch@1bfee97550
2017-01-26 13:18:36 -06:00
Nik Everett ae994c72d3 Fix compilation in Eclipse (elastic/elasticsearch#4745)
Eclipse compiler is silly....

Original commit: elastic/x-pack-elasticsearch@1c7d19bffe
2017-01-26 12:00:52 -05:00
Suyog Rao 31bda61d92 [Monitoring UI] Add cgroups charts to LS advanced view
* Adds Advanced view for Logstash
* Adds 2 cgroups stats based chart in advanced view

Fixes elastic/elasticsearch#4386

Original commit: elastic/x-pack-elasticsearch@453847bcd3
2017-01-26 08:28:49 -08:00
Dimitris Athanasiou 5790a6f152 Handle shard failures in extractors (elastic/elasticsearch#794)
Even though a search response may return a 200 status code, things could
still have gone wrong. A search response may report shard failures.

The datafeed extractors should check for that and report an extraction
error accordingly.

Closes elastic/elasticsearch#775

Original commit: elastic/x-pack-elasticsearch@5d6d899738
2017-01-26 16:01:43 +00:00
David Kyle efc47c2a6f Remove Usage classes (elastic/elasticsearch#796)
* Delete usage class

* Delete usage reporter

* Remove unused constant

Original commit: elastic/x-pack-elasticsearch@c7a6c457bd
2017-01-26 11:50:08 +00:00
David Kyle db14d89358 Fix checkstyle
Original commit: elastic/x-pack-elasticsearch@05d59da705
2017-01-26 10:05:03 +00:00
David Kyle e3bb7cfea3 Split ml-int index into .ml-audit and .ml-meta (elastic/elasticsearch#752)
* Audit messages in .ml-audit

* Rename ml-int to .ml-meta

* Remove no release comment

* Fix compilation after classes moved to a different package

* Create the Audit, state and meta indices every time a job is created

* Revert change creating the audit index etc when the job is created

* Rename index .ml-audit -> .ml-notifications

Original commit: elastic/x-pack-elasticsearch@95168fa341
2017-01-26 09:44:54 +00:00
Martijn van Groningen 3a36f94a4a When timeout has been reached, check one more time if the job / datafeed status has the expected value.
Decreased wait timeout from 30s to 20s

Original commit: elastic/x-pack-elasticsearch@b46fb0abe3
2017-01-25 23:32:04 +01:00
Simon Willnauer 133591a26f [TEST] Remove dfs_query_and_fetch - this mode is internal only and will be removed
Original commit: elastic/x-pack-elasticsearch@f6bb9ce498
2017-01-25 20:18:27 +01:00
Dimitris Athanasiou 86291c12e2 Handle manual aggregations in datafeeds (elastic/elasticsearch#784)
* Handle manual aggregations in datafeeds

Adds a DataExtractor implementation that runs aggregated searches.

The manual aggregations supported have the following limitations:

- each aggregation can hava 0 or 1 sub-aggregations
- the top aggregation has to be a histogram
- sub-aggregations have to be either terms aggregations or single value
metric aggregations.

The response is converted into flat JSON documents that contain only the
fields of interest and can be parsed without additional context from our
JSON parser. The fields in the JSON documents correspond to the names of the aggregations.

Closes elastic/elasticsearch#680

Original commit: elastic/x-pack-elasticsearch@7dfd2d31e6
2017-01-25 19:13:03 +00:00
Colin Goodheart-Smithe 716f543f7b Adds a new constructor to plugin
The new constructor takes an Environment object. This is needed for migration to X-Pack since the environment instance is built by the XPackPlugin and then passed into the feature plugins.

Original commit: elastic/x-pack-elasticsearch@f25225bc6a
2017-01-25 18:45:04 +00:00
Chris Earle 9fad3cf85c [Watcher] Allow Index Action to set _id (elastic/elasticsearch#4694)
This adds a "doc_id" parameter to the index action itself, which can accept a single ID value. This also allows the payload to set _id (or _doc._id) for each document being indexed in order to support this with bulk index actions.

If doc_id and _id are used together, then this blocks the action.

Original commit: elastic/x-pack-elasticsearch@f186ccceb8
2017-01-25 13:03:26 -05:00
David Roberts 4b366f8ef6 Removing transforms and the SINGLE_LINE input format (elastic/elasticsearch#790)
Most transforms will be replaced with Painless scripts.

The exception is the DateTransform, whose functionality is now simplified
to what existed before the other transforms were added.

The SINGLE_LINE format relied on transforms to extract fields, so has also
been removed, but this is reasonable as it strays into Logstash territory.

Relates elastic/elasticsearch#630

Closes elastic/elasticsearch#39

Original commit: elastic/x-pack-elasticsearch@a593d3e0ad
2017-01-25 15:51:50 +00:00
Alexander Reelsen 9d002430b5 Tests: Remove class only used by tests
The `Integers` class was only used in tests (but lurked around in the src) and is not needed.
Also replaced some lambda calls with their shorter equivalents.

Original commit: elastic/x-pack-elasticsearch@a81a5c33d3
2017-01-24 18:10:05 +01:00
Colin Goodheart-Smithe 603fa47580 Adds an option to disable the ML plugin (elastic/elasticsearch#785)
Adds an `xpack.ml.enabled` node level setting that can be used to enable and disable the plugin. This will be important when we migrate to X-Pack

Closes elastic/elasticsearch#781

Original commit: elastic/x-pack-elasticsearch@e5c4969a96
2017-01-24 16:14:56 +00:00
Alexander Reelsen 984b1b0dd1 Watcher: Add dedicated acknowledged state (elastic/elasticsearch#4588)
In order to display a better UI page for the watch history, the state
of a throttled watch should be visualized. However, right now there
is no way to differentiate between a time throttled watch and a user
acknowledged watch (or action). This commit introduces a new type in a
throttled result, which in turn is used to set the execution state of
a watch.

Closes elastic/elasticsearch#4531

Original commit: elastic/x-pack-elasticsearch@b86e666e54
2017-01-24 16:33:29 +01:00
Luca Cavanna 5e8dd26d93 adapt to "move es. headers to metadata set in ElasticsearchException and stop returning them as response headers" (elastic/elasticsearch#4693)
Original commit: elastic/x-pack-elasticsearch@91abdf73c8
2017-01-24 16:13:03 +01:00
Martijn van Groningen e9f899e57a Improved datafeed logging for stopping
Original commit: elastic/x-pack-elasticsearch@94bd5d6a00
2017-01-24 16:00:54 +01:00
Martijn van Groningen b636a4b829 Fixed timeout (de-)serialization for start and stop datafeeder and open job apis.
Original commit: elastic/x-pack-elasticsearch@be054db48c
2017-01-24 15:53:54 +01:00
javanna a8bb433aa1 fix compile errors due to upstream changes
Original commit: elastic/x-pack-elasticsearch@40a2561fa3
2017-01-24 13:09:01 +01:00
Martijn van Groningen 8dbaef186e [TEST] use unique job ids to make debugging log files easier
Original commit: elastic/x-pack-elasticsearch@9f04e1b01f
2017-01-24 12:01:21 +01:00
Martijn van Groningen 29451bb7e3 [TEST] select timestamp differently for test documents
Original commit: elastic/x-pack-elasticsearch@679273012c
2017-01-24 11:07:24 +01:00
David Roberts 215410e93f Rename list to filter (elastic/elasticsearch#774)
Part of the endpoint rename Sophie and Steve agreed with Clint

Relates elastic/elasticsearch#630

Original commit: elastic/x-pack-elasticsearch@6ded117849
2017-01-24 10:01:24 +00:00
Martijn van Groningen a7d1918461 [TEST] added more logging
Original commit: elastic/x-pack-elasticsearch@062a0b41b8
2017-01-23 17:54:14 +01:00
Simon Willnauer 1998b7ef46 Remove RequestContext from Security (elastic/elasticsearch#4710)
RequestContext is a leftover from when we had no thread context. This
commit removes the last place where it was used and uses the thread context
instead.

Original commit: elastic/x-pack-elasticsearch@50a2bff400
2017-01-23 15:44:40 +01:00
Simon Willnauer 8651c0ad9f Log exceptions in onFailure instead of bubbling up (elastic/elasticsearch#4709)
Today we wrap the checked IOException in an unchecked exception when
sending back a failure the security transport interceptor. Yet, if that failure handling
in-turn fails due to a broken response channel we should rather log the exception instead
of bubbling it up since it can have unforeseeable side-effects.

Relates to elastic/elasticsearch#4706

* fix line len

Original commit: elastic/x-pack-elasticsearch@03c3826112
2017-01-23 15:08:48 +01:00
David Roberts cd2332730b Move the named pipe no bootstrap test to a separate qa module (elastic/elasticsearch#769)
This matches the way tests that need to run without an Elasticsearch
bootstrap are run in core Elasticsearch.  This should make merging to
x-pack easier.

Note that the no bootstrap tests now run after the integration tests, but
this doesn't really matter.

Original commit: elastic/x-pack-elasticsearch@5547f457b6
2017-01-23 12:08:35 +00:00
Dimitris Athanasiou b3b8a7edc9 Restructure packages (elastic/elasticsearch#767)
Restructure packages according to plan described in elastic/elasticsearch#730.
Copying here for completeness.

* Move config classes
* DataCounts/Quantiles/state are process.autodetect.state
* AutodetectProcessManager move to process.autodetect
* lists -> config
* PageParams, QueryPage -> action.util
* StatusReporter -> process.DataCountsReporter
* CountingInputStream -> process
* JobManager -> job
* CppLog* -> process.logging
* DataProcessor -> collapse into implementation
* job.audit -> ml.notifications

Closes elastic/elasticsearch#730

Original commit: elastic/x-pack-elasticsearch@769ea1ed69
2017-01-23 10:12:21 +00:00
Simon Willnauer b6703c1515 Preserve `forceExecution` flag when forking off handler threads after authentication (elastic/elasticsearch#4706)
Today we might get a rejection on a critical operation where `forceExecution=true` but
due to the fact that the forceExecution flag is not passed to the transport interceptor
interface we were not able to preserve this flag when forking off the request after authentication.
This causes serious issues if for instance a replication handler is rejected.

Closes elastic/elasticsearch#4704

Original commit: elastic/x-pack-elasticsearch@f0aad7dede
2017-01-23 11:07:36 +01:00
Martijn van Groningen 0c40317ed2 Remove unneeded inject annotations, because they are no longer needed since rest controllers have been de-guiced.
Original commit: elastic/x-pack-elasticsearch@d272ae1a1c
2017-01-23 10:05:09 +01:00
polyfractal ae7446f78e De-guice getRestHandlers() to follow upstream changes
Original commit: elastic/x-pack-elasticsearch@04bd9e688f
2017-01-20 17:13:35 -05:00
Jay Modi 9005e9fdb9 security: filter content of known requests with passwords (elastic/elasticsearch#4700)
This commit adds a mechanism for defining known sensitive values in rest bodies so that
these can be filtered when auditing the request body.

Original commit: elastic/x-pack-elasticsearch@d138a6bff7
2017-01-20 14:05:23 -05:00
David Kyle ecd462bf89 Fix bug updating normalised results (elastic/elasticsearch#765)
The bulk request needed resetting after it was executed otherwise stale documents are persisted repeatedly after they have been updated causing a versioning error

Original commit: elastic/x-pack-elasticsearch@263fa9d25d
2017-01-20 17:33:37 +00:00
Nik Everett d690c5f789 Deguice rest handlers (elastic/elasticsearch#4598)
Since some of the rest handlers depend on components constructed
in `createComponents` we use `SetOnce` to save a reference to
the components at the class level and reuse the reference in
`initRestHandlers`. This does require that `initRestHandlers`
is called after `createComponents` but I think that is fairly
reasonable.

Original commit: elastic/x-pack-elasticsearch@4fd87ad911
2017-01-20 11:49:20 -05:00
Colin Goodheart-Smithe 4c6989212a Gets build to use elasticsearch-extras (elastic/elasticsearch#758)
* Gets build to use elasticsearch-extras

Also adds ci script for building repo on CI servers

To use this change you need to:
1. Clone elasticsearch: `git@github.com:elastic/elasticsearch.git`
2. create a directory at the same level as elasticsearch called `elasticsearch-extra`
3. Clone this repository into the `elasticsearch-extra` directory
4. Run `gradle build` from the `elasticsearch-extra/prelert-legacy` directory or run `gradle :prelert-legacy:build` from the `elasticsearch directory

* Adds USE_SSH option to ci script

* iter

Original commit: elastic/x-pack-elasticsearch@ea127dfef0
2017-01-20 15:11:21 +00:00
Yannick Welsch 8f70653233 Close XContentParser when executing searches from Watcher (elastic/elasticsearch#4696)
Also removes unused method convertToObject from XContentUtils that does not close XContentParser either.

Original commit: elastic/x-pack-elasticsearch@99ce977c55
2017-01-20 12:40:48 +01:00
Alexander Reelsen 84936d57ad Watcher: Fix XContentFilterKeysUtils when using nested lists (elastic/elasticsearch#4635)
The ability to filter JSON inside of arrays was stopping after the first element was found.

Closes elastic/elasticsearch#4614

Original commit: elastic/x-pack-elasticsearch@452cf1c49d
2017-01-20 12:22:20 +01:00
Alexander Reelsen 8011912ce7 Tests: Added some tests for proper 404 responses on watch actions (elastic/elasticsearch#4620)
Relates elastic/elasticsearch#4616 elastic/elasticsearch#4617

Original commit: elastic/x-pack-elasticsearch@7f73792507
2017-01-20 12:01:44 +01:00
David Roberts bddfac59ed Minor adjustments to datafeed endpoints (elastic/elasticsearch#761)
1. get_datafeeds_stats -> get_datafeed_stats

2. get_datafeeds now accepts implicit _all

Relates elastic/elasticsearch#630

Original commit: elastic/x-pack-elasticsearch@1fc0f69ee2
2017-01-20 10:57:06 +00:00
David Kyle 2eb0499454 Remove JobDataDeleterFactory and OldDataDeleter (elastic/elasticsearch#759)
Original commit: elastic/x-pack-elasticsearch@ac5b75eb58
2017-01-20 09:49:24 +00:00
Boaz Leskes 630b5fd836 Move ContextPreservingActionListener to core (elastic/elasticsearch#4692)
Original commit: elastic/x-pack-elasticsearch@c3e5762ffc
2017-01-20 10:14:34 +01:00
Martijn van Groningen 9665368755 Changed job lifecycle to be task oriented.
The job open api starts a task and ties that AutodetectCommunicator.
The job close api is a sugar api, that uses the list and cancel task api to close a AutodetectCommunicator instance.
The flush job and post data api redirect to the node holding the job task and then delegate the flush or data to the AutodetectCommunicator instance.

Also:
* Added basic multi node cluster test.
* Fixed cluster state diffs bugs, forgot to mark ml metadata diffs as named writeable.
* Moved waiting for open job logic into OpenJobAction.TransportAction and moved the logic that was original there to a new action named InternalOpenJobAction.

Original commit: elastic/x-pack-elasticsearch@194a058dd2
2017-01-19 23:15:00 +01:00
Martijn van Groningen f20f56e2e1 fixed compile errors due upstream change
Original commit: elastic/x-pack-elasticsearch@0a9d73d2be
2017-01-19 20:42:44 +01:00
Colin Goodheart-Smithe 3fa87c0994 Removes upload pack task from build (elastic/elasticsearch#757)
* removes upload pack task from build

This is preventing us from being an elasticsearch-extra project and we cannot have this task when we move to x-pack. Once we are in X-Pack the unified build will be uploading the final artifact so for now we will change the CI build to add a build step to upload the pack artifact.

* Removes OS specific stuff from the build

the CPP_LOCAL_DIST will now look for any `ml-cpp` artifacts for the same version in the specified directory.

* review corrections

Original commit: elastic/x-pack-elasticsearch@be15e55ddb
2017-01-19 16:14:08 +00:00
Colin Goodheart-Smithe 55dd438557 Fixes typo on cpp dependencies
Original commit: elastic/x-pack-elasticsearch@1bf51ac6f5
2017-01-19 15:36:45 +00:00
Colin Goodheart-Smithe 62cb7a17c5 Changes build to get c++ lib as a standard dependency (elastic/elasticsearch#756)
Original commit: elastic/x-pack-elasticsearch@d46990da49
2017-01-19 15:22:55 +00:00
Colin Goodheart-Smithe 33800bae5e Changes build to make cpp artifact download correct with ml-cpp changes (elastic/elasticsearch#754)
https://github.com/elastic/machine-learning-cpp/pull/3 changes the artifact names and paths for the ml-cpp build. This change makes it so the machine learning build references the artifacts in their new location.

Original commit: elastic/x-pack-elasticsearch@d3916b6a7f
2017-01-19 13:51:01 +00:00
Dimitris Athanasiou 0b084ea0e6 Treat timestamps without timezone as UTC (elastic/elasticsearch#753)
Original commit: elastic/x-pack-elasticsearch@33ab2fb781
2017-01-19 13:49:14 +00:00
David Roberts 36bdcaff5d Rename scheduler/scheduled to datafeed (elastic/elasticsearch#755)
Relates elastic/elasticsearch#630

The more subtle changes to the datafeed endpoints required by elastic/elasticsearch#630
are NOT in this commit, as they would be drowned out by the rename

Original commit: elastic/x-pack-elasticsearch@3318971da9
2017-01-19 13:44:19 +00:00
David Roberts 10441a3e38 More endpoint adjustments (elastic/elasticsearch#750)
This commit contains some more of the endpoint changes Sophie and Steve
agreed with Clint:

1. get_jobs_stats renamed to get_job_stats

2. Revert snapshot must now be done using an ID - other options removed

3. Renamed "categorydefinitions" to "categories" in endpoints

4. get_jobs now has an implicit _all if no job ID/wildcard is specified

5. There is an option to retrieve a specific model snapshot by ID in
   get_model_snapshots

Relates elastic/elasticsearch#630

Original commit: elastic/x-pack-elasticsearch@9dd71c64a8
2017-01-19 11:41:35 +00:00
David Kyle e826a56212 Make document Ids unique if in a shared index (elastic/elasticsearch#749)
Original commit: elastic/x-pack-elasticsearch@ecc7e876ce
2017-01-19 09:31:03 +00:00
Martijn van Groningen d3c589c33d Moved waiting for scheduler started logic into StartSchedulerAction.TransportAction and moved the logic that was original there to a new action named InternalStartSchedulerAction.
This change prepares for elastic/elasticsearch/elastic/elasticsearch#22575, where we don't have ClusterService available in rest actions.

Original commit: elastic/x-pack-elasticsearch@87658c7fe8
2017-01-19 09:38:10 +01:00
Daniel Mitterdorfer 6ed83cc8ea Merge pull request elastic/elasticsearch#4380 from danielmitterdorfer/strict-booleans
This PR removes all leniency in the conversion of Strings to booleans: "true" is converted to the boolean value true, "false" is converted to the boolean value false. Everything else raises an error.

Relates elastic/elasticsearchelastic/elasticsearch#22200

Original commit: elastic/x-pack-elasticsearch@a505df1f5d
2017-01-19 08:00:06 +01:00
Ali Beyad 5aae30f722 [TEST] fixes known handler test
Original commit: elastic/x-pack-elasticsearch@98a8f23d23
2017-01-18 16:42:08 -05:00
Dimitris Athanasiou c33f26976d Improve field extraction in scheduler (elastic/elasticsearch#748)
This commit performs the following improvements:

- the time field is always requested as doc_value. This makes
specifying a time format for scheduled jobs unnecessary.
- adds DataDescription as a param to the PostDataAction. When set,
it overrides the job's DataDescription. This allows the scheduler to
override the job's DataDescription since it knows the data format (JSON)
and the time format (epoch_ms). This is not exposed in the REST API to
discourage users from using it.
- by default, data extractor search now requests doc_values for analysis fields. This is
expected to result in increased performance.
- a `_source` field is added to the scheduler config. This needs to be
set to true when one or more of the analysis fields do not have
doc_values.
- the ELASTICSEARCH data format is removed as is now redundant.
- fixes the usage of `script_fields`. Previously, setting
`script_fields` would result to none of the source to be returned. Thus,
is the analysis fields were a mixture of script and non-script fields it
would not work.
- ensures nested fields are handled properly

Closes elastic/elasticsearch#679, Closes elastic/elasticsearch#267 

Original commit: elastic/x-pack-elasticsearch@fed35ed354
2017-01-18 18:46:43 +00:00
Ali Beyad 159bf63cd4 [TEST] fix security's request handler tests to check in the
knownHandlers set, not the knownActions

Original commit: elastic/x-pack-elasticsearch@63f3744853
2017-01-18 12:19:42 -05:00
Simon Willnauer 5b5c77f573 Follow up for elastic/elasticsearchelastic/elasticsearch#22677 (elastic/elasticsearch#4670)
This commit picks up some improvments from elastic/elasticsearch#22677 that streamlines correct restore of stored contexts.

Original commit: elastic/x-pack-elasticsearch@0259de50c8
2017-01-18 16:18:10 +01:00
David Kyle 4c0d2a492d Refactor get methods (elastic/elasticsearch#747)
Original commit: elastic/x-pack-elasticsearch@d300be2dde
2017-01-18 13:35:25 +00:00
Daniel Mitterdorfer 226d6872ff Merge remote-tracking branch 'origin/master' into strict-booleans
Original commit: elastic/x-pack-elasticsearch@a81d65f77f
2017-01-18 13:39:52 +01:00
Simon Willnauer 533b525b13 Add cross cluster search proxy actions
Original commit: elastic/x-pack-elasticsearch@13f78dffe4
2017-01-18 10:25:40 +01:00
Martijn van Groningen 40332c7e1c use client instead of transport action directly in rest actions
Original commit: elastic/x-pack-elasticsearch@4c3380ceb9
2017-01-17 20:38:53 +01:00
Martijn van Groningen d9a75424d0 fixed wrong mockito import in test
Original commit: elastic/x-pack-elasticsearch@c6a7232a87
2017-01-17 20:22:30 +01:00
David Roberts 449a74b2fd C++ log message handler now remembers C++ process copyright message (elastic/elasticsearch#743)
Once we're in x-pack this (or the portion of it containing the version)
can be returned in the ml feature info of the x-pack info endpoint

Relates elastic/elasticsearch#566

Original commit: elastic/x-pack-elasticsearch@b2ea740a6d
2017-01-17 17:19:48 +00:00
David Kyle cfb94b6627 Rename result iterators (elastic/elasticsearch#740)
Original commit: elastic/x-pack-elasticsearch@c462e9595a
2017-01-17 16:02:02 +00:00