Commit Graph

341 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
David Kyle 4c0d2a492d Refactor get methods (elastic/elasticsearch#747)
Original commit: elastic/x-pack-elasticsearch@d300be2dde
2017-01-18 13:35:25 +00: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
David Roberts f24e8c6d54 Remove C++ from build files (elastic/elasticsearch#739)
NB: The actual C++ code will be deleted in a separate commit to
avoid swamping this commit.

If you want to have the Java build pick up locally built C++ then:

export CPP_LOCAL_DISTS=$CPP_SRC_HOME/build/distributions

Otherwise, C++ artifacts will be downloaded from S3.

Original commit: elastic/x-pack-elasticsearch@246672e81d
2017-01-17 14:45:00 +00:00
David Kyle 9af2c2cbeb Fix check style error (wildcard import)
Original commit: elastic/x-pack-elasticsearch@d5ba5d8dda
2017-01-17 13:57:08 +00:00
David Kyle bc04bda8d6 Remember the index each result came from (elastic/elasticsearch#727)
* Delete unused batched ModelSnapshot iterator

* Pass source index with normalisable results

* Refactor Normalizable

* Rework persisting renormalised results

* Spell normalize with a ‘z’

* Rename ResultIndex -> ResultWithIndex

* Expand wildcard import

* Make Normalisable child type an enum

Original commit: elastic/x-pack-elasticsearch@52450abafd
2017-01-17 13:11:57 +00:00
Martijn van Groningen 1d891965c1 Stop scheduled job only once.
If scheduled job concurrently gets stopped from within (e.g. lookback) and externally via the stop scheduler api then make sure to execute the stop logic only once.

Original commit: elastic/x-pack-elasticsearch@505c44f515
2017-01-17 08:26:09 +01:00
Martijn van Groningen e0b6a1e493 Removed unneeded task (de)registering as the super class does this already
Original commit: elastic/x-pack-elasticsearch@f5be371e83
2017-01-17 08:19:53 +01:00
David Roberts 5cd79f20fa Add company name to copyright messages
Original commit: elastic/x-pack-elasticsearch@8ee353a550
2017-01-13 19:46:48 +00:00
David Roberts bc03dba9a2 Add facility to cross compile for Mac OS X on Linux (elastic/elasticsearch#717)
Adding a build system that makes it possible for an Ubuntu 16.04 build
server configured according to the instructions in
https://github.com/elastic/prelert-legacy/wiki/Plugin-Development-Setup-for-Mac-OS-X-cross-compiled-on-Linux
to build a Mac OS X version of the product.

Original commit: elastic/x-pack-elasticsearch@c6f39c0395
2017-01-13 17:42:11 +00:00
David Kyle c9a8d9d283 Update unit test after removing _all
Original commit: elastic/x-pack-elasticsearch@59c80a6ba3
2017-01-13 14:25:41 +00:00
Dimitris Athanasiou 4128d635f4 Remove explicit _all disabling from mappings (elastic/elasticsearch#719)
The _all field is now deprecated and disabled by default in elasticsearch
6.0.0. We no longer need to disable it explicitly.

Original commit: elastic/x-pack-elasticsearch@c71465083a
2017-01-13 12:39:59 +00:00
Dimitris Athanasiou 3ce48bc7b9 Remove ParseFieldMatcher (elastic/elasticsearch#718)
Original commit: elastic/x-pack-elasticsearch@070fb8146c
2017-01-13 11:54:25 +00:00
Dimitris Athanasiou c1ee50f238 Return 200 on GET requests for all resources when none exists (elastic/elasticsearch#694)
When a user makes a GET request to retrieve all resources of a type
(e.g. anomaly_detectors) and none exists, the response should be an
empty array with 200 status code. This commit fixes this issue for:

* anomaly_detectors and _stats
* schedulers and _stats
* lists
* buckets

All other GETs work fine already.

Original commit: elastic/x-pack-elasticsearch@4daaa91aa4
2017-01-12 17:46:39 +00:00
Martijn van Groningen c4d5cf660d Revert "fixed compile error due upstream changed"
This reverts commit elastic/x-pack@54d8aeadec.

Original commit: elastic/x-pack-elasticsearch@8846dc4ca5
2017-01-12 16:56:30 +01:00
Martijn van Groningen 4550d5f979 fixed compile error due upstream changed
Original commit: elastic/x-pack-elasticsearch@0dd924b287
2017-01-12 16:34:45 +01:00
Martijn van Groningen 9ec22efcba Removed last blocking client calls on network threads.
Closes elastic/elasticsearch#127

Original commit: elastic/x-pack-elasticsearch@3441f51764
2017-01-12 16:34:45 +01:00
Dimitrios Athanasiou d3e4ebcc0e Fix ScheduledJobsIT failure
Original commit: elastic/x-pack-elasticsearch@e43bb12ffb
2017-01-12 14:32:59 +00:00
Dimitris Athanasiou b93ec686f3 Use QUERY_THEN_FETCH (default) as search type for data extractor (elastic/elasticsearch#704)
I thought QUERY_AND_FETCH was the most efficient for the data extractor
but it does not work with sorting. It causes all shard results to be
returned before sorting and thus we may get out-of-order errors.

This commit switches to the default search type.

Original commit: elastic/x-pack-elasticsearch@d8a8155973
2017-01-12 13:36:09 +00:00
Hendrik Muhs af7edd84bb Fix buildbreak caused by upstream change (elastic/elasticsearch#700)
MLPlugin failed to compile du to removal of SearchRequestParsers (https://github.com/elastic/elasticsearch/pull/22538)

fixes elastic/elasticsearch#698

Original commit: elastic/x-pack-elasticsearch@73b7fca28c
2017-01-12 11:24:06 +01:00
Dimitris Athanasiou 3657d8a137 Scheduler robustness improvements (elastic/elasticsearch#687)
* Extract method ScheduledJob#postData

* Remove unreachable else statement

* Restrain usage of DataExtractor in a single thread

Original commit: elastic/x-pack-elasticsearch@5b9b310d9d
2017-01-10 17:09:01 +00:00
Dimitrios Athanasiou 51c50c5840 Remove deprecated use of ParseFieldMatcher
Original commit: elastic/x-pack-elasticsearch@e2150cf0aa
2017-01-10 13:42:58 +00:00
David Roberts c4038b52ed Rename prelert to ml (elastic/elasticsearch#681)
* prelert to ml
* Prelert to Ml
* PRELERT to ML

Exceptions:

* prelert.com - because it generally appears in links to our website, and
  although these will eventually break it will be possible for people to see
  what was there using https://archive.org/web/
* PRELERT_AWS_ACCESS_KEY_ID and PRELERT_AWS_SECRET_ACCESS_KEY - because it
  creates a knock-on effect on infra that will be temporary anyway because once
  we're in x-pack we'll use x-pack keys
* prelert-artifacts - this is the name of the s3 bucket we're currently using
  and you cannot rename s3 buckets - as with the access keys it will become
  obsolete when we merge to x-pack so there's no point changing it now
* prelert-legacy - the name of our legacy Git repo has not changed

Original commit: elastic/x-pack-elasticsearch@720e83c7f2
2017-01-10 13:40:16 +00:00
Martijn van Groningen 10d8a52b23 Made client calls non blocking in JobProvider#modelSnapshots(...)
Original commit: elastic/x-pack-elasticsearch@00790a5336
2017-01-10 12:57:28 +01:00
Martijn van Groningen 1d81509616 remove FixBlockingClientOperations usage in ElasticsearchBatchedDocumentsIterator as it is ok to make blocking from there. It is only used during remormalization which happens from a prelert thread and not a network thread.
Also removed some used code.

Original commit: elastic/x-pack-elasticsearch@2fe506099a
2017-01-10 12:56:09 +01:00
David Kyle 1a0151d020 Merge branch 'master' of github.com:elastic/prelert-legacy
Original commit: elastic/x-pack-elasticsearch@0696bda55c
2017-01-10 11:54:01 +00:00
David Kyle 9bc839b0fe Update yaml test with job id in path
Original commit: elastic/x-pack-elasticsearch@f74f1250d8
2017-01-10 11:53:48 +00:00
Martijn van Groningen 1a132e2c8b Made client calls non blocking in JobProvider#influencers(...)
and re-enabled some quantiles persistence unit tests (which can remain to be blocking as they aren't used on a network thread)

Original commit: elastic/x-pack-elasticsearch@cf8e78f42d
2017-01-10 12:49:51 +01:00
Dimitris Athanasiou 9e5245fd64 Replace http data extractor with a client extractor (elastic/elasticsearch#619)
* Replace http data extractor with a client extractor

This first implementation replaces the HTTP extractor
with a client extractor that uses search & scroll.

Note that this first implementation has some limitations:

- Only reads data that are in the _source
- Does not handle aggregated searches

These limitations will be addressed in follow up PRs.

Relates to elastic/elasticsearch#154

Original commit: elastic/x-pack-elasticsearch@f692ed961c
2017-01-10 11:45:17 +00:00
David Kyle dee7412044 Add job Id to custom all field (elastic/elasticsearch#598)
* Add job Id to custom all field

* Add yaml test for searching fields copied to custom all

Original commit: elastic/x-pack-elasticsearch@419189460f
2017-01-10 11:33:29 +00:00
Colin Goodheart-Smithe 68b8ce40fd Upgrades to 6.0.0-alpha1-SNAPSHOT (elastic/elasticsearch#672)
* Upgrades to ES 6.0.0-alpha1-SNAPSHOT

* Kibana changes to run upgrade to 6.0.0-alpha1-SNAPSHOT

* Other version changes to 6.0.0-alpha1-SNAPSHOT

Original commit: elastic/x-pack-elasticsearch@574d8573ab
2017-01-10 11:04:29 +00:00
Martijn van Groningen 2d8de6adb2 Fix scheduler config aggregation serialization logic due to upstream change in ES.
Original commit: elastic/x-pack-elasticsearch@3836cf753b
2017-01-10 11:39:04 +01:00
David Kyle fd4d412433 Fix GET bucket params validation (elastic/elasticsearch#661)
Original commit: elastic/x-pack-elasticsearch@66f522588b
2017-01-10 10:04:05 +00:00
David Roberts 45ef535b38 Endpoint adjustments (elastic/elasticsearch#662)
This commit contains around half of the endpoint changes Sophie and Steve
agreed with Clint:

1) Automatic job ID generation is removed

2) Job IDs must now be specified in the URL when putting a job; to avoid
   breaking many test configs, job IDs may also be specified in the job config
   body, but in this case the value specified must match the URL argument

3) The endpoint name for posting data is now post_data instead of job_data

4) The post_data endpoint ends with _data instead of data

5) modelsnapshots is renamed to model_snapshots in all related endpoints

6) PUT model_snapshots/description is changed to POST model_snapshots/_update

Relates elastic/elasticsearch#630

Original commit: elastic/x-pack-elasticsearch@c379a23f3c
2017-01-09 15:52:07 +00:00
Colin Goodheart-Smithe 0d7ac401f9 Removes duplicate influencer field declaration for results (elastic/elasticsearch#668)
The `influencer_field_name` field was declared two in the results mapping. Once directly from `ElasticsearchMappings.resultsMapping()` and again from `addInfluencerFieldsToMapping(XContentBuilder)` which the `resultsMapping()` method calls.

this change removes the duplicate.

Original commit: elastic/x-pack-elasticsearch@5707a5ee53
2017-01-09 13:59:12 +00:00
Martijn van Groningen c06342b556 use ActionListener.wrap(...) helper rather than anonymous action listener implementations
Original commit: elastic/x-pack-elasticsearch@d3c7e176ef
2017-01-09 13:59:47 +01:00
Martijn van Groningen ade3f6f207 fixed integration tests due to upstream changes
Original commit: elastic/x-pack-elasticsearch@e6bf9bb4a1
2017-01-09 12:03:14 +01:00
Martijn van Groningen 8e6aa2ba3d fixed compile errors due to upstream changes.
Original commit: elastic/x-pack-elasticsearch@9d3a96680d
2017-01-09 10:38:49 +01:00
Zachary Tong a375d90547 Allow deletes to proceed even if index is missing (elastic/elasticsearch#660)
Allow deletes to proceed even if index is missing

Also adds some tests.  All non-IndexNotFound exceptions will still abort the delete.
We can revisit this if we find other edge-cases.

Original commit: elastic/x-pack-elasticsearch@823d00d8a7
2017-01-06 12:26:13 -05:00
Martijn van Groningen d7f6de7133 Made client calls non blocking in JobProvider#modelSizeStats(...)
and FixBlockingClientOperations in two places where blocking client calls are ok,
because these methods aren't called from a network thread.

Original commit: elastic/x-pack-elasticsearch@a6dc34651c
2017-01-06 18:02:07 +01:00
Zachary Tong ae8695a22d Tweak logic to allow Deletes on already-deleting job (elastic/elasticsearch#658)
Original commit: elastic/x-pack-elasticsearch@5352cba1e7
2017-01-06 10:07:28 -05:00
Martijn van Groningen 3c3509d397 create XContentParser instances inside try code block
Original commit: elastic/x-pack-elasticsearch@664cba1633
2017-01-06 15:20:07 +01:00
Martijn van Groningen 092d2e2bdc Made client calls non blocking for JobProvider#getDataCounts(..)
Original commit: elastic/x-pack-elasticsearch@4d6d6360f6
2017-01-06 14:39:52 +01:00
Martijn van Groningen 468402426e Made client calls non blocking in get category apis.
Merged categoryDefinition(...) into categoryDefinitions(...) as the two did similar things. The get call has been replaced with a search with a query on the _uid field and routing on category id, so that the response handling code can be reused.

Original commit: elastic/x-pack-elasticsearch@4243917b00
2017-01-06 11:18:35 +01:00
Martijn van Groningen 66a2f999e5 scheduler: prevent stopping scheduler before the scheduler was actually started
The start scheduler waits until the scheduler state has been set to started before returning.
Before this change after the scheduler state has been set to started, the scheduler would link itself to the task the start scheduler api has created.
If the stop scheduler api was called immediately after the start scheduler api then this could lead the stop scheduler api cancelling the task without
stopping the scheduler, as the scheduler could not have been linked to the task.

Now the scheduler gets linked to the task before the scheduler state is set to started, fixing the problematic situation discribed above.

Original commit: elastic/x-pack-elasticsearch@8334ae1967
2017-01-05 21:10:23 +01:00
Colin Goodheart-Smithe b9205142a4 fix checkstyle
Original commit: elastic/x-pack-elasticsearch@b86e94228b
2017-01-05 16:29:18 +00:00
Colin Goodheart-Smithe 8fdeedf61d fix generics compile error in Eclipse
Eclipse compiler needs a hint to tell it the generics for the comparator function

Original commit: elastic/x-pack-elasticsearch@b3d71d3465
2017-01-05 16:23:24 +00:00
David Kyle 42898ba421 Fix noisy log message about missing mappings
From the scheduler integration test

Original commit: elastic/x-pack-elasticsearch@02d3f58d83
2017-01-05 14:43:29 +00:00
David Roberts 2746edf21b Properly assert that large state documents can be consumed quickly
AssertBusy was not the correct way to do this

Original commit: elastic/x-pack-elasticsearch@c6535e7545
2017-01-05 13:07:56 +00:00
Martijn van Groningen 41f2f51df6 Made client calls in get buckets code non blocking.
Also merged the JobProvider#getBucket(...) method into Jobprovider#getBuckets(...) method, because
it contained a lot of similar logic, otherwise it had to be converted to use non blocking client calls too.

Part of elastic/elasticsearch#127

Original commit: elastic/x-pack-elasticsearch@b1e66b62cb
2017-01-05 13:58:46 +01:00
Martijn van Groningen 51e1199860 Install prelert metadata and create required indices only once.
Original commit: elastic/x-pack-elasticsearch@12c8ba0ce0
2017-01-05 13:38:48 +01:00
David Roberts 27c9f39bf5 Speed up state processing (elastic/elasticsearch#642)
There was an N-squared algorithm in the state processing code, leading
to large state persistence eventually timing out.  Large state documents
are read from the network in 8KB chunks, and the old code was checking
ALL previously read chunks for separators every time a new chunk was read.

Fixes elastic/elasticsearch#635

Original commit: elastic/x-pack-elasticsearch@c814858c2c
2017-01-05 12:37:11 +00:00
David Roberts c7cfa56aaf Rename prelert to ml in endpoint base path (elastic/elasticsearch#639)
Original commit: elastic/x-pack-elasticsearch@ff6745e545
2017-01-05 08:18:43 +00:00
polyfractal f98b4a967c s/nocommit/norelease
Original commit: elastic/x-pack-elasticsearch@6523f5caa1
2017-01-04 16:50:51 -05:00
Zachary Tong 23aef2679d DELETING job status cluster state changes (elastic/elasticsearch#612)
Deleting a job now starts a three-step process:

1. Job status updated to DELETING
2. Physical index is deleted
3. Job removed from cluster state

When jobs are in DELETING, they cannot be modified/updated/changed at all.  Only jobs that are DELETING can actually be removed from the CS.

Original commit: elastic/x-pack-elasticsearch@2cd99a240c
2017-01-04 16:43:24 -05:00
Martijn van Groningen 090c7e792a in case of general exception no need to execute the rest of the method
Original commit: elastic/x-pack-elasticsearch@d0cdaf037d
2017-01-04 15:52:17 +01:00
Martijn van Groningen 5371cc8454 When failures happen during the scheduler's loopback run then make sure we either continue or stop.
Relates to elastic/elasticsearch#628

Original commit: elastic/x-pack-elasticsearch@c5726bd8e4
2017-01-04 15:52:17 +01:00
David Roberts a816ee27bb Fix error message for state index creation
Original commit: elastic/x-pack-elasticsearch@cd36db071e
2017-01-04 13:31:03 +00:00
Martijn van Groningen 567153d73a test: create airline-data index as part of test setup
Original commit: elastic/x-pack-elasticsearch@81dea8b071
2017-01-03 22:35:31 +01:00
David Roberts 852eeb106d Remove obsolete test files
Original commit: elastic/x-pack-elasticsearch@d708431007
2017-01-03 17:12:14 +00:00
David Kyle f6564c03e2 Add Influencer.influencer_field_value to custom all field (elastic/elasticsearch#624)
Original commit: elastic/x-pack-elasticsearch@5aa98d84dc
2017-01-03 16:46:19 +00:00
David Kyle 7a7ec570ae Flushing a closed job should not return a 200 (elastic/elasticsearch#625)
Original commit: elastic/x-pack-elasticsearch@419389e1af
2017-01-03 16:44:13 +00:00
David Kyle c58d1d43d6 Null check for anomaly score filter values and default the page params
Fixes broken tests

Original commit: elastic/x-pack-elasticsearch@2ebc42515a
2017-01-03 15:33:19 +00:00
David Kyle f8309a0706 Fix validating params for single bucket requests (elastic/elasticsearch#622)
Original commit: elastic/x-pack-elasticsearch@42f8771bf8
2017-01-03 14:59:01 +00:00
Martijn van Groningen db3358166b made checkstyle happy
Original commit: elastic/x-pack-elasticsearch@6e12c81c33
2017-01-03 12:38:12 +01:00
Martijn van Groningen 134ce2f074 test: added a temporary workaround in on check that happens after a suite has completed,
with the fix we also make sure that prelert metatadata is taken into account when verifying the cluste state consistency

Original commit: elastic/x-pack-elasticsearch@1deaec3836
2017-01-03 12:23:23 +01:00
Martijn van Groningen 16bd07b603 register prelert metadata as named writables
Original commit: elastic/x-pack-elasticsearch@628a4aa154
2017-01-03 11:59:37 +01:00