Commit Graph

38 Commits

Author SHA1 Message Date
Alexander Reelsen e8c1e7f9d8 Watcher: Dont hide exceptions during watch execution
When a painless exception is raised in the script condition, it was not bubbled up due to
catching exceptions on during execution. This removes the different catching of exceptions
and allows the watch record construct to contain an exception that is also serialized correctly
so that it can be stored in the watch history but also returned in the execute watch API.

This also updates the watch history template, so that exceptions are not indexed, but logged.

Relates elastic/elasticsearch#2587

Original commit: elastic/x-pack-elasticsearch@4dffb672bf
2016-07-05 09:33:44 +02:00
Jason Tedor 1cd53c41e2 Do not catch throwable
Today throughout the codebase, catch throwable is used with reckless
abandon. This is dangerous because the throwable could be a fatal
virtual machine error resulting from an internal error in the JVM, or an
out of memory error or a stack overflow error that leaves the virtual
machine in an unstable and unpredictable state. This commit removes
catch throwable from the codebase and removes the temptation to use it
by modifying listener APIs to receive instances of Exception instead of
the top-level Throwable.

Relates elastic/elasticsearch#2694

Original commit: elastic/x-pack-elasticsearch@7ecdd7d978
2016-07-04 08:41:08 -04:00
Ryan Ernst 2d0055de35 Make script service a cluster state listener
Original commit: elastic/x-pack-elasticsearch@dc763f3d66
2016-06-28 14:06:53 -07:00
Alexander Reelsen 5883efc976 Watcher: Remove support for _timestamp field in index action (elastic/elasticsearch#2575)
The watch index action was using the _timestamp field by default.
This functionality now needs to be configured explicitely for a special
field that is part of that document which is going to be indexed.

Relates elastic/elasticsearchelastic/elasticsearch#18980

Original commit: elastic/x-pack-elasticsearch@dfa4cf2296
2016-06-22 14:31:27 +02:00
jaymode c024dbfc49 security: remove use of shield in files and directory names
This commit removes as much of the use of shield as possible in the source code.

See elastic/elasticsearch#2383

Original commit: elastic/x-pack-elasticsearch@00009cc06e
2016-06-20 10:26:10 -04:00
Simon Willnauer 36ad326483 Simplify ScriptModule and script registration elastic/elasticsearchelastic/elasticsearch#18903 (elastic/elasticsearch#2535)
follow up PR for elastic/elasticsearchelastic/elasticsearch#18903

Original commit: elastic/x-pack-elasticsearch@d6ab3ab141
2016-06-16 09:35:16 +02:00
Jason Tedor 576a543a28 Register watcher thread pool
This commit register the watcher thread pool in the thread pool module
in core, and also makes the necessary changes to reflect a refactoring
that took place in core.

Relates elastic/elasticsearch#2397

Original commit: elastic/x-pack-elasticsearch@be298a7578
2016-06-06 22:09:58 -04:00
Areek Zillur e996b78b04 Revert "move trigger package to top-level x-pack"
This reverts commit elastic/x-pack@bb0add9416.

Original commit: elastic/x-pack-elasticsearch@fc20c8c307
2016-06-01 21:30:08 -04:00
Areek Zillur a7aa18aa17 move trigger package to top-level x-pack
Original commit: elastic/x-pack-elasticsearch@4f955a0c4a
2016-06-01 14:31:22 -04:00
Robert Muir 21b2494c5b ScriptException -> GeneralScriptException (https://github.com/elastic/elasticsearch/pull/18600)
Original commit: elastic/x-pack-elasticsearch@0536fe9222
2016-05-26 17:51:46 -04:00
Lee Hinman 91f2e94ac7 Fix scripting engines for singular type
Original commit: elastic/x-pack-elasticsearch@ed014cefc3
2016-05-13 09:29:37 -06:00
Alexander Reelsen 1aedda3627 X-Pack: Create notification module
In order to move things from watcher to x-pack this created a notification module in x-pack.
This also means that the HTTPClient was moved up and settings have changed from
`xpack.watcher.http` to just `xpack.http`.

Further things done:

* Move http under o.e.xpack.common
* Moved secret service to o.e.xpack.common, initializing in XpackPlugin
* Moved text template to o.e.xpack.common.text
* Moved http client initialization into xpack plugin
* Renamed xpack.watcher.encrypt_sensitive_data setting, moved into Watch class
* Moved script service proxy to common

Original commit: elastic/x-pack-elasticsearch@41eb6e6946
2016-05-04 08:53:29 +02:00
Alexander Reelsen 74edbe6332 Watcher: Refactoring, move to org.elasticsearch.xpack
This refactors the org.elasticsearch.watcher over to
org.elasticsearch.xpack.watcher

This also adds all watcher actions to the KnownActionsTests,
as watcher actions had not been taken care of until here.

Original commit: elastic/x-pack-elasticsearch@a046dc7c6a
2016-05-02 10:58:34 +02:00
Martijn van Groningen 4650592150 Remove LazyInitializable from ScriptServiceProxy
Closes elastic/elasticsearch#2062

Original commit: elastic/x-pack-elasticsearch@4eaf323158
2016-04-22 14:31:02 +02:00
Martijn van Groningen b9515357fa Migrated from indexed scripts to store scripts
Original commit: elastic/x-pack-elasticsearch@a0218f1c9e
2016-04-22 13:43:55 +02:00
Alexander Reelsen 98feb695ff Tests: Fixing failing history transform tests after mapping changes
Original commit: elastic/x-pack-elasticsearch@b1b13c52b0
2016-04-19 13:56:50 +02:00
Adrien Grand 5b57727b34 Replace usage of settingsBuilder with just builder.
Original commit: elastic/x-pack-elasticsearch@fe038bbc49
2016-04-08 18:09:02 +02:00
Adrien Grand 216874881f Don't rely on fielddata being enabled by default.
See elastic/elasticsearchelastic/elasticsearch#17386.

Original commit: elastic/x-pack-elasticsearch@361af3931a
2016-03-30 14:34:54 +02:00
Nik Everett c7796d5cb7 Rename more tests to match naming conventions
Original commit: elastic/x-pack-elasticsearch@d76c217bd9
2016-02-25 15:20:41 -05:00
Colin Goodheart-Smithe 197b8fe56f X-Plugin changes due to the changes in the Aggregations Java API
Original commit: elastic/x-pack-elasticsearch@b983d0a00f
2016-02-12 12:06:06 +00:00
uboness ffe339ae31 Refactoring for 5.0 - phase 5
- Moved all settings in Marvel from `marvel.*` to `xpack.monitoring.*`
- Cleaned up marvel settings in general - they're all now under `MarvelSettings` class
- fixed some integration tests along the way (they were configured wrong and never actually tested anything)
- Updated the docs accordingly
- Added `migration-5_0.asciidoc` under the Marvel docs to explain how to migrate from Marvel 2.x to XPack 5.0.
- Replaced all `marvel` mentions in the logs to `monitoring`
- Removed the `xpack.monitoring.template.version` setting from the templates
- renamed the templates to `monitoring-es-data.json` and `monitoring-es.json`
- monitoring indices are now `.monitoring-es-<version>-data` and `.monitoring-es-<version>-<timestamp>`

Original commit: elastic/x-pack-elasticsearch@17f2abe17d
2016-02-11 21:34:38 +01:00
Alexander Reelsen e8ad8cbb36 Watcher: Load versioned index template for watch history
This loads an index template for the watch history to make sure,
that field changes are taken into account.

Also, the dynamic mapping for the watch history template has been
changed from strict to false.

This means that new fields can be included in a document, but they
will not indexed and are not searchable.

In addition the index names have been changed from .watch_history-$date to
.watcher-history-$template-$date - using dashes to be more consistent.

Closes elastic/elasticsearch#1299

Original commit: elastic/x-pack-elasticsearch@794f982234
2016-02-09 09:39:07 +01:00
Alexander Reelsen e6784d5c7d Checkstyle: Adhere to checkstyle in all xpack .java files
In elastic/elasticsearch#1442 checkstyle checks were added, but also some files were freed from this.
If we have support for checkstyle, we should check this for all files and not allow
exceptions. This commit removes the file list to ignore any files and fixes all the
java files.

Original commit: elastic/x-pack-elasticsearch@99e6cbc5be
2016-02-05 16:57:41 +01:00
Martijn van Groningen e617d8365f watcher: Removed custom xmustache script and use mustache script engine in lang-mustache module
The lang-mustache module has been extended to meet Watcher's needs:
* The ability to refer the specific slots in arrays.
* An `content_type` option controls whether json string escaping is used. Otherwise there is no escaping.

Closes elastic/elasticsearch#1116

Other changes:
* I changed tests that were just using mustache just because it was around to not use mustache
* I moved tests to `test-xpack-with-mustache` module that were testing mustache with Watcher
* added smoke test for watcher and mustache
* moved some tests around
* instead of using DefaultTextTemplateEngine in watcher tests use MockTextTemplateEngine
* added a mock mustache script engine
* Cleanup some messy tests to not rely on mustache and move them back into xpack module
* moved array access test to smoke test watcher with mustache module
* test: simplified the condition search test to take the time component out of it, while still simulation a condition
* removed the mustache dependency in the messy-test-watcher-with-groovy module

Original commit: elastic/x-pack-elasticsearch@6a2a4e885f
2016-02-03 09:18:50 +01:00
Jason Tedor e13a5e695a Uppercase ells ('L') in long literals
This commit removes all lowercase ells ('l') in long literals because
they are often hard to distinguish from the digit representing one
('1').

Closes elastic/elasticsearch#1414

Original commit: elastic/x-pack-elasticsearch@98b38705fb
2016-01-30 22:18:02 -05:00
Boaz Leskes dfb9068e33 Update Index usage to elasticsearchelastic/elasticsearch#16217
elasticsearchelastic/elasticsearch#16217 changed the Index class to also include index UUIDs . This commit adapts the code for it.

Closes elastic/elasticsearch#1377

Original commit: elastic/x-pack-elasticsearch@87c909c15a
2016-01-28 08:38:44 +01:00
Jason Tedor 8eb97c5509 Script settings
This commit is the x-plugins side of the refactoring of script settings.

Relates elastic/elasticsearchelastic/elasticsearch#16197

Original commit: elastic/x-pack-elasticsearch@4c429933b9
2016-01-26 21:13:29 -05:00
Jason Tedor 19c87bd143 Add Groovy closure Watcher test
This commit adds an integration test for Watcher that tests Groovy
closures.

Closes elastic/elasticsearch#1362, relates elastic/elasticsearchelastic/elasticsearch#16196

Original commit: elastic/x-pack-elasticsearch@1a6b1a3e07
2016-01-26 13:04:36 -05:00
Ryan Ernst c86e8b9c2e Remove wildcard imports
Original commit: elastic/x-pack-elasticsearch@65b2fee336
2015-12-18 14:15:06 -08:00
Zachary Tong 9db8c73025 Fix compile due to change in InternalSearchResponse signature
Original commit: elastic/x-pack-elasticsearch@a442dc5efe
2015-12-17 16:24:15 -05:00
Adrien Grand a14dc4c5bf Fix compilation.
Original commit: elastic/x-pack-elasticsearch@f9c3fe924f
2015-12-17 18:56:52 +01:00
Robert Muir 5c480e118c fix x-pack compile/tests to work with https://github.com/elastic/elasticsearch/pull/15328
Squashed commit of the following:

commit 54de841112778b01e817e465d2f59840970bb4f3
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Dec 10 08:47:12 2015 -0500

    see exactly how far MessyTestPlugin can go (unit tests depend on both groovy and mustache!)

commit 743b5a4e0cc9a05e307339dfcb4569feed31f337
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Dec 10 08:35:03 2015 -0500

    fix x-pack compile/tests to work with https://github.com/elastic/elasticsearch/pull/15328

Original commit: elastic/x-pack-elasticsearch@4307bb163b
2015-12-10 08:47:55 -05:00
Ryan Ernst b6ce09a361 Switch messy watcher+groovy tests to messy-test plugin
Original commit: elastic/x-pack-elasticsearch@8163f0f129
2015-12-08 19:52:22 -08:00
Ryan Ernst 4bbd4c25b0 Enable security manager for messy groovy tests
Original commit: elastic/x-pack-elasticsearch@4b2b256a04
2015-12-08 17:26:53 -08:00
Robert Muir f3fd72c9d0 Use Date instead of System in groovy script... its absurd to expect scripts can use System
Original commit: elastic/x-pack-elasticsearch@9b32e621c7
2015-12-05 22:13:50 -05:00
Ryan Ernst 2521e567f1 Merge branch 'master' into jigsaw
Original commit: elastic/x-pack-elasticsearch@c7534cfcf0
2015-12-04 11:39:33 -08:00
jaymode 9b2dd0c11d fixes after rebase
Original commit: elastic/x-pack-elasticsearch@6896b88829
2015-12-03 16:24:40 +01:00
jaymode e5b0e7f5cb reorganize directory layout
See elastic/elasticsearch#1022

Original commit: elastic/x-pack-elasticsearch@3ee8761312
2015-12-03 16:22:37 +01:00