Commit Graph

307 Commits

Author SHA1 Message Date
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
David Roberts 161eefe7d8 Remove PROTO constants
This is a follow-up to the previous commit

Original commit: elastic/x-pack-elasticsearch@4d1e52fe43
2017-01-03 10:49:00 +00:00
David Roberts ad9d65cfa5 Fix compilation after upstream Elasticsearch changes (elastic/elasticsearch#621)
The Elasticsearch change that caused the breakage was
73625f6291

Original commit: elastic/x-pack-elasticsearch@01b82a79d4
2017-01-03 10:13:39 +00:00
Martijn van Groningen ec8fb6c99f fixed scheduler job integration tests
Original commit: elastic/x-pack-elasticsearch@bb522d9d6d
2016-12-27 22:54:07 +01:00
Martijn van Groningen b94b79a411 test: fixed deleteAllSchedulers(...) method
Original commit: elastic/x-pack-elasticsearch@641c8c16b9
2016-12-27 20:34:05 +01:00
Martijn van Groningen b409b72629 fixed two other rest integ tests
Original commit: elastic/x-pack-elasticsearch@7fe318e2a8
2016-12-27 17:37:54 +01:00
Martijn van Groningen a2aaef90b7 first step to get things working again, added norelease work around for blocking client calls
Original commit: elastic/x-pack-elasticsearch@2c2a6d9ae8
2016-12-27 17:25:45 +01:00
David Kyle d431ebba6f Fix compilation after upstream changes
Original commit: elastic/x-pack-elasticsearch@b1cb074651
2016-12-23 12:34:25 +00:00
Dimitrios Athanasiou c1cd964458 fixed compile errors due to upstream changes in elasticsearch itself
Note that the change in elasticsearch allowed us to store scheduler
config's query and scriptFields as typed objects instead of
ByteReference.

Original commit: elastic/x-pack-elasticsearch@38c5aef2ef
2016-12-23 02:21:31 +00:00
David Kyle 95cfae59ea Fix bulkrequest validation exception in the log (elastic/elasticsearch#610)
* Check the bulk request contains actions before executing.

This suppresses an validation exception about no requests being added.

* Persist bulk request before refreshing the indexes on a flush acknowledgment

Original commit: elastic/x-pack-elasticsearch@22543e46c8
2016-12-22 11:23:58 +00:00
Martijn van Groningen 84b419052f fixed compile errors due to upstream changes in elasticsearch itself
Original commit: elastic/x-pack-elasticsearch@defb853486
2016-12-22 11:12:12 +01:00
David Roberts 92def19a73 Send header to C++ process on job open (elastic/elasticsearch#603)
This avoids the problem of the C++ process getting confused by control
messages that are sent before any data messages have been sent

Fixes elastic/elasticsearch#593

Original commit: elastic/x-pack-elasticsearch@9aed3f0b82
2016-12-21 14:32:54 +00:00
David Kyle a47c5332d5 Rename prelertresults- to .ml-anomalies (elastic/elasticsearch#607)
Original commit: elastic/x-pack-elasticsearch@ad3bb7c819
2016-12-21 13:47:00 +00:00
David Kyle 6de846d4c6 Put model state in the .mlstate-anomalydetectors index (elastic/elasticsearch#589)
* Put model state in the .mlstate index

* Revert results index rename

* Put ModelSnapshots in the results index

* Change state index in C++

* Fix logging

* Rename state index ‘.ml-state’

Original commit: elastic/x-pack-elasticsearch@dbe5f6b525
2016-12-21 12:03:17 +00:00
Dimitris Athanasiou 3e494070bf Strict parse search parts of schedulerConfig (elastic/elasticsearch#600)
* Strict parse search parts of schedulerConfig

This commit adds methods to build the typed objects
for the search parts of a scheduler config. Those are:
query, aggregations and script_fields.

As scheduler configs are stored in the cluster state and parsing
the search parts requires a SearchRequestParsers object, we cannot
store them as typed fields. Instead, they are now stored as
BytesReferences.

This change is in preparation for switching over to using a
client based data extractor.

Point summary of changes:

- query, aggregations and scriptFields are now stored as BytesReference
- adds methods to build the corresponding typed objects
- putting a scheduler now builds the search parts to to validate that
the config is valid

Relates to elastic/elasticsearch#478



Original commit: elastic/x-pack-elasticsearch@e6d5a85871
2016-12-21 10:57:55 +00:00
David Roberts 4033c93a13 Never persist records inside bucket objects (elastic/elasticsearch#588)
This doesn't happen initially when buckets are output by the C++, but
buckets can contain records at the moment they're sent for persistence
during normalization or during integration tests.  It's safest if the
persistence code specifically doesn't persist these records.

Original commit: elastic/x-pack-elasticsearch@a93135d8c0
2016-12-21 10:42:39 +00:00
Martijn van Groningen 0b5b26284b Validate if job index already exists after job validation.
Closes elastic/elasticsearch#594

Original commit: elastic/x-pack-elasticsearch@b3b7b086a7
2016-12-21 08:34:16 +01:00
Martijn van Groningen 999a1eb234 fix JobTests#testEquals_noId by fixing regex expression and including `-`
Original commit: elastic/x-pack-elasticsearch@b295d5f621
2016-12-20 15:15:47 +01:00
David Roberts 8b135226f6 Fix long line
Original commit: elastic/x-pack-elasticsearch@8d030d8cf8
2016-12-20 14:09:39 +00:00
David Kyle 537fea313f Add job config option to set the index name (elastic/elasticsearch#560)
* Add job config option to set the index name

* Check index does not already exist if ’index_name’ is set

* Don’t create alias if ‘index_name’ is the same as ‘job_id’

* Default index_name value

Set it to job_id if null and only create the index alias if job_id != index_name

* Fix compile errors after rebasing

* Address review comments

* Test if the index exists by checking the cluster state

* Update comment

Original commit: elastic/x-pack-elasticsearch@a3e7f1a5bb
2016-12-20 14:03:24 +00:00
David Roberts 3383c67cf2 Ensure automatically generated job IDs meet the validation criteria (elastic/elasticsearch#586)
Original commit: elastic/x-pack-elasticsearch@34b67cb509
2016-12-20 13:53:29 +00:00
David Roberts 5b029ee595 Correct test condition and add a message in case of future failures
Original commit: elastic/x-pack-elasticsearch@55729b39fa
2016-12-20 11:22:03 +00:00
David Kyle 78fdca65d5 Add job Id to state document IDs (elastic/elasticsearch#579)
* Persist quantile documents with the jobId in the document Id

* Add job Id to snapshot Id

* Add job Id to categoriser state document Id

* Rename quantiles doc to start with job id as the other state docs do

* Fix restoring categoriser state

Original commit: elastic/x-pack-elasticsearch@3e5d3368b5
2016-12-20 10:47:37 +00:00
Dimitrios Athanasiou 316f6bf6cb Remove unused methods and fix test
Original commit: elastic/x-pack-elasticsearch@12290517d0
2016-12-20 10:15:53 +00:00
Dimitris Athanasiou bee58f8b81 Add get API for schedulers (elastic/elasticsearch#582)
Original commit: elastic/x-pack-elasticsearch@59c555d60a
2016-12-20 10:09:45 +00:00
David Roberts 9b3764b7fa Max jobs per node cannot be dynamic due to threadpool (elastic/elasticsearch#578)
The threadpool that supplies the threads used for job IO cannot be
resized, so the number of jobs cannot be dynamic either

Original commit: elastic/x-pack-elasticsearch@c584bf7147
2016-12-19 17:48:22 +00:00
David Roberts f65125df55 No point rethrowing exception in thread pool task
It will just get logged twice, but with a less useful message the
second time

Original commit: elastic/x-pack-elasticsearch@7d32f65cc1
2016-12-19 16:24:45 +00:00
Dimitrios Athanasiou 081bebbbcd Remove unused constants
Original commit: elastic/x-pack-elasticsearch@0f72f1fc6e
2016-12-19 14:22:05 +00:00
Dimitris Athanasiou 8750e5f926 Redesign the get anomaly_detectors APIs (elastic/elasticsearch#570)
* Redesign the get anomaly_detectors APIs

This commit redesigns the APIs to get anomaly_detectors.

The new design has 2 GET APIs:

- An API to get the configurations: /anomaly_detectors/{job_id}
- An API to get the stats: /anomaly_detectors/{job_id}/_stats

For both APIs entering "_all" as the job_id returns results for
all jobs.

Note that page params have been removed. They were useful
when the configs were stored in an index. Now that they are part
of cluster state there is no need. Additionally, future support
for wildcard job_id expressions will give users a tool to narrow
down the GET actions to a certain subset of jobs which will be
more useful than the from/size approach.

Follow up:

- Implement similar GET APIs for schedulers
- Remove scheduler_stats from the anomaly_detectors _stats API
as it will be part of the schedulers _stats API

Closes elastic/elasticsearch#548

Original commit: elastic/x-pack-elasticsearch@046a0db8f5
2016-12-19 13:09:54 +00:00
David Kyle 4eda09d24a Don’t write job description if not set
Original commit: elastic/x-pack-elasticsearch@6e7ff939d3
2016-12-19 11:27:32 +00:00
David Roberts 854dc88cbd Corrections to previous commit
Original commit: elastic/x-pack-elasticsearch@a9e94119e1
2016-12-19 10:28:23 +00:00
David Roberts 028a505fe5 Update copyright headers (elastic/elasticsearch#572)
* Added the Elastic copyright header to C++ files

* Added the name of the copyright holder to Java files

Original commit: elastic/x-pack-elasticsearch@aea1b5a656
2016-12-19 10:19:21 +00:00
Dimitris Athanasiou 6a14f52d2e Remove aggs and retrieve_whole_source from SchedulerConfig (elastic/elasticsearch#569)
Aggs does not need to be a separate member field. There can simply
be an aggs parse field which also then stored onto the aggregations
parse field.

Finally, retrieve_whole_source is unnecessary as we move towards
a node client based data extraction.

Original commit: elastic/x-pack-elasticsearch@14024c2ee5
2016-12-19 09:54:59 +00:00
David Kyle aacb6f3949 Move JobResultsPersister.getJobIndexName to new class AnomalyDetectorsIndex (elastic/elasticsearch#567)
Original commit: elastic/x-pack-elasticsearch@bf54dd56a9
2016-12-16 17:47:52 +00:00
Martijn van Groningen e3ec908828 run with native process by default
Original commit: elastic/x-pack-elasticsearch@c73beec522
2016-12-16 15:21:11 +01:00
Martijn van Groningen eaca8fb06a Stop local allocated jobs before closing node.
Original commit: elastic/x-pack-elasticsearch@ad3ed7c86a
2016-12-16 14:59:35 +01:00
David Roberts c43a9ba1dd Fix intermittent failure of renormalization (elastic/elasticsearch#558)
The synchronization was flawed

Original commit: elastic/x-pack-elasticsearch@a968c68c7d
2016-12-16 13:45:47 +00:00
Colin Goodheart-Smithe 5e6c63bc51 Removes warnings
Original commit: elastic/x-pack-elasticsearch@59626a3a3a
2016-12-16 12:35:45 +00:00
Dimitris Athanasiou c932588c68 Repackage scheduler classes (elastic/elasticsearch#559)
* Repackage scheduler classes

* Rename and move scheduler status tests

Original commit: elastic/x-pack-elasticsearch@a9d7cc4e48
2016-12-16 09:50:06 +00:00
David Kyle 8d5c8b24d6 Make ModelDebugOutput fields snake case (elastic/elasticsearch#555)
* snake_case model debug output fields

* Rename CategorizerState and BucketInfluencer types to snake_case

Original commit: elastic/x-pack-elasticsearch@da94dc7ec1
2016-12-15 15:42:38 +00:00
David Kyle 8e14aee978 Audit message were being persisted with the type ‘audit_activity’ (elastic/elasticsearch#554)
Original commit: elastic/x-pack-elasticsearch@7c00495c98
2016-12-15 15:31:11 +00:00
Dimitris Athanasiou 8841a97659 Disallow non alphanumeric chars from start or end in IDs (elastic/elasticsearch#552)
Closes elastic/elasticsearch#550

Original commit: elastic/x-pack-elasticsearch@ca0ca9f4da
2016-12-15 13:49:07 +00:00
Dimitrios Athanasiou bc8d966690 Fix integration tests
Original commit: elastic/x-pack-elasticsearch@a5955cfde3
2016-12-15 12:03:51 +00:00
David Kyle b97610f245 Streamed boolean values can on be 0 or 1
Original commit: elastic/x-pack-elasticsearch@16ffa0727b
2016-12-15 12:01:09 +00:00
Martijn van Groningen faf54d4952 renamed test classes
Original commit: elastic/x-pack-elasticsearch@5296de69d7
2016-12-14 19:52:10 +01:00
Martijn van Groningen 985bdf6cb1 Changed rest start scheduler api to wait with returning a response until the the scheduler status has been set to STARTED and
changed stop scheduler api to wait with returning a response until the scheduler status has been set to STOPPED.

Original commit: elastic/x-pack-elasticsearch@e20fcd1ae9
2016-12-14 19:50:02 +01:00
Martijn van Groningen 3b487a268b Add validation for stop scheduler api
Original commit: elastic/x-pack-elasticsearch@4571bbacd9
2016-12-14 19:28:12 +01:00
David Kyle f085b935f6 Custom all mapping for interesting result fields (elastic/elasticsearch#535)
* Check use of mappings

* Add unit tests for JobProvider.createJobRelatedIndices

* Remove ‘index: no’ from mappings as no longer required

The entire type mapping has ‘enabled: false’

* Restore “index.analysis.analyzer.default.type” setting

* Remove include_in_all from nested mappings

* Add audit and usage mappings to the job index

* Revert ‘Restore “index.analysis.analyzer.default.type” setting’

Original commit: elastic/x-pack-elasticsearch@c7d62e0c7e
2016-12-14 16:32:36 +00:00
David Roberts 0a45d846df Add back native process normalizer functionality (elastic/elasticsearch#540)
This builds on PR elastic/elasticsearch#526 to get normalization working end-to-end using the
native normalizer process.

The ShortCircuitingRenormalizer class is basically doing what the old
BlockingQueueRenormaliser class did but using the ES threadpool instead
of its own thread.

Also fixed a bug where the C++ was calling the score field of partition_score
documents normalized_probability but the Java was calling it anomaly_score.

Original commit: elastic/x-pack-elasticsearch@d4cecae150
2016-12-14 16:06:01 +00:00
Dimitris Athanasiou 4732223214 Split SchedulerConfig from Job (elastic/elasticsearch#541)
Original commit: elastic/x-pack-elasticsearch@32a55da726
2016-12-14 14:10:44 +00:00
David Kyle 7efdbd9320 Fix the reported number of bytes read (elastic/elasticsearch#544)
Original commit: elastic/x-pack-elasticsearch@a98902f309
2016-12-14 13:39:00 +00:00
Zachary Tong b386ed33a1 Add ability to get all lists, ensure params are mutually exclusive (elastic/elasticsearch#514)
Also removes some unnecessary stuff in validate()

Related elastic/elasticsearch#291

Original commit: elastic/x-pack-elasticsearch@d9af2d3a30
2016-12-13 11:38:11 -05:00
Zachary Tong 6ef954e3f0 Add mutually-exclusive param validation to GetCategories (elastic/elasticsearch#512)
Also adds body parsing to the REST action, which seemed to be missing (but supported because of the POST)

Closes elastic/elasticsearch#430

Original commit: elastic/x-pack-elasticsearch@e7455ffbb6
2016-12-13 11:37:46 -05:00
Martijn van Groningen 3581fc9d91 removed redundant private method
Original commit: elastic/x-pack-elasticsearch@dbc377d6b4
2016-12-13 13:35:14 +01:00
Martijn van Groningen d15933ac32 test: move java rest test to yaml rest test.
These test are just checking response / status code. It is cleaner to have these tests as yaml tests.

Original commit: elastic/x-pack-elasticsearch@61c323059e
2016-12-13 12:13:24 +01:00
David Kyle 9f73f047eb Test for job existence before updating its state (elastic/elasticsearch#532)
* Test for job existence before updating its state

* Add unit tests covering expected missing job exceptions

Original commit: elastic/x-pack-elasticsearch@bcd270dafd
2016-12-13 09:24:16 +00:00
David Kyle bca06f0ad7 Fix forbidden API errors and logger usage check (elastic/elasticsearch#533)
Original commit: elastic/x-pack-elasticsearch@e7bdaa8b0a
2016-12-12 17:31:39 +00:00
David Kyle 1d67c6ea1d Fix build: rename import Renormali[s]er -> Renormali[z]er
Original commit: elastic/x-pack-elasticsearch@70fa67aaf7
2016-12-12 17:08:39 +00:00
David Kyle 2302dc78ba AutodetectResultProcessor Integration Test (elastic/elasticsearch#516)
* Add results processor integration test

* Integration tests for AutodetectResultProcessor

Original commit: elastic/x-pack-elasticsearch@19e7ec48dd
2016-12-12 16:55:20 +00:00
David Kyle dae0b5625d Add yaml tests assert a 404 is returned when the job id isn’t recognised (elastic/elasticsearch#531)
For open, close, _flush and posting data

Original commit: elastic/x-pack-elasticsearch@be2c29c409
2016-12-12 16:00:20 +00:00
David Kyle 300d7c67d2 Fix failing integration tests
Incorrect job id was used

Original commit: elastic/x-pack-elasticsearch@625a1616ee
2016-12-12 13:03:09 +00:00
David Kyle 3829a83864 Check job exists and return a 404 on flush (elastic/elasticsearch#529)
Original commit: elastic/x-pack-elasticsearch@7721d4510a
2016-12-12 12:50:40 +00:00
David Kyle 46938b281c Check job exists before opening & closing (elastic/elasticsearch#530)
Original commit: elastic/x-pack-elasticsearch@037ea30a12
2016-12-12 12:50:29 +00:00
David Roberts 1d4df3903c Add back parts of the normalizer functionality (elastic/elasticsearch#526)
* Added back Normalizable classes
* Added back normalization process management classes
* Added back the scores updater

Original commit: elastic/x-pack-elasticsearch@ac8edf6ed6
2016-12-12 12:40:13 +00:00
Martijn van Groningen bad8a2beb5 let prelert metadata test extend from AbstractSerializingTestCase, so that we test the writable and xcontent serialization much better.
Original commit: elastic/x-pack-elasticsearch@de8609ad59
2016-12-12 12:09:07 +01:00
Martijn van Groningen f73d22b4b2 removed unused method
Original commit: elastic/x-pack-elasticsearch@bbe4b7e932
2016-12-12 11:19:44 +01:00
Martijn van Groningen 3d8353ac6a replaced `RestActions` helper methods for checking whether there is a request body and getting the request body with getters on RestRequest itself
Original commit: elastic/x-pack-elasticsearch@857d999c8e
2016-12-12 10:51:54 +01:00
David Kyle 45c8aeb0f2 Remove the ES_TIMESTAMP constant (elastic/elasticsearch#523)
Original commit: elastic/x-pack-elasticsearch@04fa354619
2016-12-12 09:28:42 +00:00
Zachary Tong 30bbbf0f78 Convert `jobs` namespace to `anomaly_detectors` (elastic/elasticsearch#513)
This also shuffles results under /anomaly_detectors/.  Note: the cluster state still refers to
"jobs" which should probably be fixed in a separate PR

Original commit: elastic/x-pack-elasticsearch@c9e634621c
2016-12-09 11:54:56 -05:00
Martijn van Groningen a85dfcd91f changed end back to primitive long
renamed private method

Original commit: elastic/x-pack-elasticsearch@fc1849dbc6
2016-12-09 15:56:22 +01:00
Martijn van Groningen de9dbdabe1 fixed typos
Original commit: elastic/x-pack-elasticsearch@21a62161d9
2016-12-09 15:50:58 +01:00
Martijn van Groningen 431a7988fb added more tests
Original commit: elastic/x-pack-elasticsearch@871c13307e
2016-12-09 15:45:25 +01:00
Martijn van Groningen b42f9cccb0 renamed `scheduler_status` to `scheduler_state` in get job response
Original commit: elastic/x-pack-elasticsearch@a7955eb027
2016-12-09 15:36:12 +01:00
Martijn van Groningen d5412627d2 Moved scheduler status to prelertmetadata to make it more independent of job.
Removed SchedulerStats as scheduler status is all we need and start and end times are only needed in start scheduler api.

Original commit: elastic/x-pack-elasticsearch@80c563cb69
2016-12-09 15:03:53 +01:00
Martijn van Groningen e067008a21 make optional flush parameter really optional
Original commit: elastic/x-pack-elasticsearch@6129023c49
2016-12-09 10:24:16 +01:00
Martijn van Groningen 372cb7c964 Let the scheduler use the data transport action instead of directly using autodetect process manager.
Original commit: elastic/x-pack-elasticsearch@2442e222fd
2016-12-09 09:41:04 +01:00
David Roberts 65f03a8888 Use well-defined IDs for records and influencers (elastic/elasticsearch#510)
* Use well-defined IDs for records and influencers

Removes the reliance on ES autogenerated UUIDs for all types that will
be renormalized

* Address some review comments

Original commit: elastic/x-pack-elasticsearch@85fde8b957
2016-12-08 18:39:03 +00:00
David Roberts 256ab7f3e2 Fix another misuse of ParameterizedMessage
Original commit: elastic/x-pack-elasticsearch@9e36900432
2016-12-08 17:32:59 +00:00
David Roberts 3f460b030e Fix a couple of ParameterizedMessage mistakes
Original commit: elastic/x-pack-elasticsearch@0006755c8b
2016-12-08 16:56:49 +00:00
Zachary Tong 8fa17f7ea8 Add mutually-exclusive param validation to GetBuckets (elastic/elasticsearch#497)
Related elastic/elasticsearch#430

Original commit: elastic/x-pack-elasticsearch@2579efca46
2016-12-08 10:28:30 -05:00
Zachary Tong b594e93a5d Remove SingleDocument as it is now unused (elastic/elasticsearch#498)
Closes elastic/elasticsearch#314

Original commit: elastic/x-pack-elasticsearch@88d2d20bdc
2016-12-08 10:28:12 -05:00
David Kyle a55944b284 Make ModelDebugOutput a result type (elastic/elasticsearch#484)
* Make ModelDebugOutput a result type

* Delete unused ElasticsearchBatchedModelDebugOutputIterator

* Add result_type field to ModelDebugOutput

* Address review comments

Original commit: elastic/x-pack-elasticsearch@a48e4cd946
2016-12-08 15:05:06 +00:00
David Kyle d18daf0b3d Make ModelSizeStats a result type (elastic/elasticsearch#500)
* Make ModelSizeStats a result type

* Address review comments

Original commit: elastic/x-pack-elasticsearch@74de7b36d8
2016-12-08 14:44:59 +00:00
Martijn van Groningen 9c2c831996 Hooked scheduler into task api infrastructure.
The start scheduler api call will run until the scheduler has completed. Either when lookback only scheduler completes or the scheduler has been stopped.
 The start scheduler api will first update the scheduler status from STOPPED to STARTED on master node and then start running the scheduler.
 Once a scheduled job completes it updates the scheduler status from STARTED to STOPPED and then the start schedule api returns.
 The STARTING and STOPPING statuses are no longer used, so have been removed.
 The stop scheduler api is a sugar api that uses the task list and cancel apis stop the scheduler.
 Renamed ScheduledJobService to ScheduledJobRunner

Original commit: elastic/x-pack-elasticsearch@ab504fe3d9
2016-12-08 14:37:55 +01:00
Martijn van Groningen c8bda6b1d9 Collapsed JobProvider and JobResultsProvider and renamed ElasticsearchJobProvider to JobProvider
Original commit: elastic/x-pack-elasticsearch@05d5969d73
2016-12-08 10:53:31 +01:00
Dimitris Athanasiou 4990195c90 Convert field references in error messages to snake case (elastic/elasticsearch#495)
* Convert field references in error messages to snake case

Closes elastic/elasticsearch#493

Original commit: elastic/x-pack-elasticsearch@38f4cd91bc
2016-12-08 09:32:10 +00:00
Zachary Tong 4d86670772 Make jobId and from/size mutually exclusive options (elastic/elasticsearch#477)
Make jobId and from/size mutually exclusive options.  

This approach has the main properties of not allowing an invalid Request to be built, and alerting the user if they set an incorrect configuration. It has the downside that PageParams can be null so the consumer will have to check for it. Since jobId could be null before, this seemed acceptable.

Original commit: elastic/x-pack-elasticsearch@106dcdf61a
2016-12-07 12:48:33 -05:00
Zachary Tong 3c711e6dff Add delete_list endpoint (elastic/elasticsearch#409)
Adds a delete_list endpoint.  If a list is currently in use by a job, it is not allowed to be deleted

Original commit: elastic/x-pack-elasticsearch@7d9a984b3a
2016-12-07 12:40:12 -05:00
David Kyle af61a51e22 Fix results not being persisted (elastic/elasticsearch#489)
Original commit: elastic/x-pack-elasticsearch@d0ee02ccf6
2016-12-07 16:52:58 +00:00
Martijn van Groningen 7cc2b8c5ce create allocation when the job has been created instead of creating it when opening the job.
This avoids the confusing situation that a there is no allocation when a job hasn't been opened yet. Now it complains about the fact that the job status is closed.

Original commit: elastic/x-pack-elasticsearch@3159dc6954
2016-12-07 17:15:18 +01:00
David Kyle ccf8cb7e0d Refactor delete interim results (elastic/elasticsearch#470)
* Collapse ElasticsearchBulkDeleter into JobDataDeleter

* Add blocking delete to JobDataDeleter

* Delete interim results only after all the results are parsed.

* Remove unused deleteModelSizeStats and deleteModelDebugOutput methods.

Document missing javadoc tags

Original commit: elastic/x-pack-elasticsearch@1997541673
2016-12-07 11:23:27 +00:00
Martijn van Groningen 14f43af818 moved metric part to be the suffix of the path
Original commit: elastic/x-pack-elasticsearch@6fc1b861ed
2016-12-07 12:09:16 +01:00
Martijn van Groningen e396e8aa68 Changes rest actions with data namespace into the job namespace.
Also added `_status` suffic to get job api as it would otherwise clash with open/close/flush APIs.

Original commit: elastic/x-pack-elasticsearch@6e8ef0ef7d
2016-12-07 12:09:16 +01:00
Martijn van Groningen d807eda9ed replaced custom ClosableIterator with Stream
Stream is closable, which is the reason ClosableIterator was introduced.

Original commit: elastic/x-pack-elasticsearch@b5a4a37e9e
2016-12-07 12:07:59 +01:00
Martijn van Groningen 5812ef4a86 use ActionListener.wrap(...) for delegate wrappers
Original commit: elastic/x-pack-elasticsearch@f1ccdb3f40
2016-12-07 10:23:47 +01:00
David Kyle 36d6141885 Move opening braces on new line to the end of the previous line (elastic/elasticsearch#473)
Original commit: elastic/x-pack-elasticsearch@57aedab104
2016-12-06 13:05:15 +00:00
Martijn van Groningen 570cde7a6a Added open and close job APIs.
* A job now has the following statuses: OPENING, OPENED, CLOSING, CLOSED and FAILED.
* The open job and close job APIs wait until the job gets into a OPENED or CLOSED state.
* The post data api no longer lazily opens a job and fails if the job has not been opened.
* When a job gets into a failed state also the reason is recorded in the allocation.
* Removed pause and resume APIs.
* Made `max_running_jobs` setting dynamically updatedable.

Original commit: elastic/x-pack-elasticsearch@3485ec5317
2016-12-06 13:51:26 +01:00
Dimitrios Athanasiou f960eea4b1 Remove obsolete comments in SchedulerConfig
Original commit: elastic/x-pack-elasticsearch@e7fc30bb2a
2016-12-06 12:45:10 +00:00
Dimitris Athanasiou 50df0d4326 Remove unnecessary parts of scheduler config (elastic/elasticsearch#468)
* Remove credentials from SchedulerConfig

* Remove dataSource and baseUrl from SchedulerConfig

Original commit: elastic/x-pack-elasticsearch@f5b92be252
2016-12-06 11:38:39 +00:00
David Kyle d3b4261759 Fix querying for model size stats (elastic/elasticsearch#465)
* Add test to read model size stats

* Most recent model_size_stats document should have the name ‘model_size_stats’

Original commit: elastic/x-pack-elasticsearch@e192d4c34d
2016-12-05 13:35:29 +00:00
David Kyle 2785cc727d Get records & categoryDefinitions with post body (elastic/elasticsearch#438)
* Allow POST with body to get records

* Allow records endpoint to accept POST requests with body

* CategoryDefinition can accept POST requests with body parameters

Original commit: elastic/x-pack-elasticsearch@2edb7a9c47
2016-12-05 11:46:12 +00:00
Colin Goodheart-Smithe a8d2cf16b9 Removes compile warnings (elastic/elasticsearch#463)
These warnings include:
* Resource not used
* Resource leak due to not being closed

Original commit: elastic/x-pack-elasticsearch@e0fb068a0c
2016-12-05 11:24:56 +00:00
David Roberts 98eb5534ee Camel to snake case (elastic/elasticsearch#461)
Original commit: elastic/x-pack-elasticsearch@222065cc4c
2016-12-05 10:34:41 +00:00
Martijn van Groningen b5c6970209 test: removed jackson databind leftover
Original commit: elastic/x-pack-elasticsearch@0cbd5595c8
2016-12-05 08:38:33 +01:00
David Kyle 850e43028b Make persist DataCounts a non-blocking operation (elastic/elasticsearch#447)
* Make persist DataCounts a non-blocking operation

* Add trace and debug level logging to the persist data counts action listener.

Remove dead code from test

Original commit: elastic/x-pack-elasticsearch@84bbfa880a
2016-12-02 17:44:53 +00:00
Dimitris Athanasiou f10c4818e7 Move count to the top of QueryPage (elastic/elasticsearch#452)
Original commit: elastic/x-pack-elasticsearch@8973bde039
2016-12-02 17:22:08 +00:00
David Kyle 385ec37bc3 Make the bulk results deleter non-blocking (elastic/elasticsearch#456)
* Make deleting old results a non blocking operation

* Add test for ElasticsearchBulkDeleter

Original commit: elastic/x-pack-elasticsearch@9fd9fb0b02
2016-12-02 17:16:16 +00:00
Colin Goodheart-Smithe d530edc263 Centralises where the version is defined
Original commit: elastic/x-pack-elasticsearch@e822136d97
2016-12-02 15:17:49 +00:00
Zachary Tong 04445ce95f Throw 400 on unknown metrics in Job Stats (elastic/elasticsearch#446)
Closes elastic/elasticsearch#426

Original commit: elastic/x-pack-elasticsearch@86f136f5c0
2016-12-02 08:26:32 -05:00
Zachary Tong b6bdef474d Throw 403 instead of 429 when max job capacity full (elastic/elasticsearch#445)
Closes elastic/elasticsearch#444

Original commit: elastic/x-pack-elasticsearch@dfaf8dbec4
2016-12-02 08:26:19 -05:00
Colin Goodheart-Smithe 00dc347217 Build now downloads c++ dist for all platforms
Original commit: elastic/x-pack-elasticsearch@8fd9850377
2016-12-02 09:46:05 +00:00
Martijn van Groningen 1e5a12fc6a Move post data api over to task api.
Also made post data api cancellable.

Original commit: elastic/x-pack-elasticsearch@55360609de
2016-12-01 18:49:06 +01:00
Colin Goodheart-Smithe a82dc82439 remove debug code in build
Original commit: elastic/x-pack-elasticsearch@590a605c8a
2016-12-01 16:35:16 +00:00
Colin Goodheart-Smithe 8dc12d0f88 Gets ES plugin to download the cpp code if not built locally
Original commit: elastic/x-pack-elasticsearch@64cc4aeb38
2016-12-01 16:33:28 +00:00
David Roberts 14208f12d1 Change the way 3rd party licenses are distributed for the C++ components (elastic/elasticsearch#366)
Note: there is no need to offer the Eigen source code now we use it unmodified

Original commit: elastic/x-pack-elasticsearch@b971c31a20
2016-12-01 15:16:57 +00:00
Colin Goodheart-Smithe bfb72d0a96 Adds task to upload cpp distribution zip
Original commit: elastic/x-pack-elasticsearch@c4fee26b37
2016-12-01 14:19:00 +00:00
Martijn van Groningen 6fee7a21b5 applied feedback
Original commit: elastic/x-pack-elasticsearch@579fd037a4
2016-12-01 15:02:19 +01:00
Martijn van Groningen c387a3636d Make auditor index messages asyn in the background, the auditor will not let the calling thread wait.
Also collapsed the the interface into the only implementation.

Original commit: elastic/x-pack-elasticsearch@c68f77627e
2016-12-01 15:02:19 +01:00
Colin Goodheart-Smithe e5e039973e Changes build to only grab cpp zip if it was built
Original commit: elastic/x-pack-elasticsearch@24fc48fe86
2016-12-01 12:16:47 +00:00
David Kyle 53adc100ad Refactor deleting old results (elastic/elasticsearch#431)
* Refactor deleting old results

* Reinstate quiet logging when deleting interim results

Original commit: elastic/x-pack-elasticsearch@01ea95469c
2016-12-01 10:32:41 +00:00
David Kyle 2fdf848df5 Add jobid to job response (elastic/elasticsearch#434)
* Add jobId to job info responses

* Remove getJobId() accessor from job - use getId()

Original commit: elastic/x-pack-elasticsearch@faacef1217
2016-12-01 10:30:37 +00:00
Colin Goodheart-Smithe f0a968292a Makes elasticsearch plugin generation depend on cpp (elastic/elasticsearch#433)
The changes the way the Elasticsearch plugin module gets the cpp code when running the bundlePlugin task. Instead of manually going into the cpp builds output and grabbing the folders it depends on the buildZip task of the :cpp project and grabs the resource that task builds. This means that it does not matter if the cpp buildZip task is changed as long as it results in a zip being generated.

Original commit: elastic/x-pack-elasticsearch@257e5df2e7
2016-12-01 09:49:03 +00:00
Zachary Tong ee54258908 Convert RevertModel response from SingleDoc to simple, inlined model (elastic/elasticsearch#423)
Convert response from SingleDoc to simple, inlined model

Original commit: elastic/x-pack-elasticsearch@6231195b47
2016-11-30 09:52:06 -05:00
Zachary Tong 7c9f65231a Convert PutModelDescription response from SingleDoc to simple, inlined model (elastic/elasticsearch#424)
Original commit: elastic/x-pack-elasticsearch@1d28285e77
2016-11-30 09:48:49 -05:00
Dimitrios Athanasiou 211d787f33 Remove mappings for influencer fields that overlap with bucket or record
Original commit: elastic/x-pack-elasticsearch@36acf9f31b
2016-11-30 14:00:42 +00:00
Dimitrios Athanasiou 9dda1ee21a Remove redundant repetition of partition scores in mappings
Original commit: elastic/x-pack-elasticsearch@4194a16529
2016-11-30 14:00:42 +00:00
Dimitrios Athanasiou 75c36207b4 Also rename epochStart/epochEnd to start/end in BucketsQueryBuilder
Original commit: elastic/x-pack-elasticsearch@e2eaca7ba5
2016-11-30 14:00:42 +00:00
Dimitrios Athanasiou d0c0e6904e Move RestGetInfluencersAction under results package
Original commit: elastic/x-pack-elasticsearch@281d432732
2016-11-30 14:00:42 +00:00
Dimitrios Athanasiou ec5aa34d17 Rename epochStart/epochEnd to start/end in result query builders
Original commit: elastic/x-pack-elasticsearch@f4fdd64278
2016-11-30 14:00:42 +00:00
Dimitrios Athanasiou 2898e3c421 Make start and end optional params in results endpoints
Original commit: elastic/x-pack-elasticsearch@0ab5da04f9
2016-11-30 14:00:42 +00:00
Dimitrios Athanasiou 9d2ce12624 Set type to influencer while getting influencers
Original commit: elastic/x-pack-elasticsearch@c65365e3ee
2016-11-30 14:00:42 +00:00
Dimitrios Athanasiou 5455b5bbad Fix result mappings
Original commit: elastic/x-pack-elasticsearch@e63209af98
2016-11-30 14:00:42 +00:00
David Kyle 1c98d59db0 Bug 401 Fix NPE when POSTing empty JSON object to /jobs (elastic/elasticsearch#420)
Original commit: elastic/x-pack-elasticsearch@fa6db52c8c
2016-11-30 10:19:03 +00:00
Martijn van Groningen fd743cbfc6 Simplify flush listener by using computeIfAbsent(...)
Make sure CountDownLatch gets removed when it is no longer needed
Also add CountDownLatch is it is missing when we ack a flush id,
we may ack before we wait for it

Original commit: elastic/x-pack-elasticsearch@83a993b9ad
2016-11-30 10:04:42 +01:00
Zachary Tong 7f6907da8b Convert GetList from SingleDocument to QueryPage (elastic/elasticsearch#408)
Related to elastic/elasticsearch#314

Original commit: elastic/x-pack-elasticsearch@40702a3d5b
2016-11-29 13:22:54 -05:00