Commit Graph

352 Commits

Author SHA1 Message Date
Martijn van Groningen d801537c9e Test: Added trigger search test
Core: Modified TriggerManager#prepareTriggerSearch to always produce a new instance.

Original commit: elastic/x-pack-elasticsearch@4041898645
2014-11-13 13:42:51 +01:00
Brian Murphy 8b2c6ba39d CORE : Add alerts stats.
This commit adds the alerts stats actions.

Original commit: elastic/x-pack-elasticsearch@c3c471de74
2014-11-13 11:25:28 +00:00
Martijn van Groningen b731f84d68 Core: Removed unused methods.
Original commit: elastic/x-pack-elasticsearch@1aac9a440e
2014-11-12 22:11:45 +01:00
Martijn van Groningen cd2c74a6a0 Core: Simplify the template helper by using the actual put index template api instead of the MetaDataIndexTemplateService directly which allows for code reuse.
Original commit: elastic/x-pack-elasticsearch@1c646f3448
2014-11-12 22:04:41 +01:00
Martijn van Groningen e0741997d0 Test: Extended malformed test to also check if the strict alert mapping in the template is active.
Original commit: elastic/x-pack-elasticsearch@dfcad46f94
2014-11-12 21:27:48 +01:00
Martijn van Groningen 4d581876bd Cleanup: removed unused field and method
Original commit: elastic/x-pack-elasticsearch@058e57f6c4
2014-11-12 18:03:17 +01:00
Martijn van Groningen 3bed2c92e2 Core: Retry shouldn't cause a new cluster state, but rather should be done in a forked thread.
Original commit: elastic/x-pack-elasticsearch@cb944ddce7
2014-11-12 18:02:15 +01:00
Brian Murphy 36dc82bcc5 AlertActions : Change the AlertActions to be simple POJOs and do the actions in the factories.
With this commit alert actions are simple pojos with the action descriptions. The actual actions are undertaken by the AlertActionFactories.

Original commit: elastic/x-pack-elasticsearch@d47b453018
2014-11-12 11:06:35 +00:00
Martijn van Groningen 3c1e31bfbf Test: move no master node test over to only use unicast zen discovery. On the build server there is no multicast enabled.
Original commit: elastic/x-pack-elasticsearch@20eab58db1
2014-11-09 23:17:20 +00:00
Martijn van Groningen e87b0a980c Test: Fixed local discovery issue when running tests for plugins
Core: synchronized initializing and stopping the scheduler to avoid scheduler stops leaving leaking threads behind

Original commit: elastic/x-pack-elasticsearch@b845651430
2014-11-09 22:21:51 +00:00
Martijn van Groningen 77fc31f815 Test: Added todo
Original commit: elastic/x-pack-elasticsearch@4267ebfe8f
2014-11-09 21:25:05 +00:00
Martijn van Groningen 0e53268bf2 Test: Don't force networking mode.
By default use local transport to increase testing speed.
Also Zen discovery is required for plugin tests otherwise Guice errors occur (so far unclear to me what is causing this).

Original commit: elastic/x-pack-elasticsearch@0de574c12f
2014-11-09 21:17:57 +00:00
Martijn van Groningen 15c1b4c56d Core: Changed the way index templates are installed
Before the index templates were installed via json files in the config directory, this commit installs templates from the classpath via the put index template api.
Also template versioning is enforced.

Original commit: elastic/x-pack-elasticsearch@22f6596015
2014-11-09 20:50:03 +01:00
Martijn van Groningen b62da0691b Core: Make sure deletes are unscheduled and no npe is returned when a alert is deleted twice
Core: When an alert searches in an index that doesn't exist it shouldn't fail

Original commit: elastic/x-pack-elasticsearch@fc4ab8f823
2014-11-08 02:13:59 +01:00
Martijn van Groningen 4b089cb157 Build: include dependencies in plugin assembly
Original commit: elastic/x-pack-elasticsearch@276e87d8f8
2014-11-08 01:47:01 +01:00
Martijn van Groningen 94cf006b8f Replaced quartz thread pool by an impl that is backed by ES thread pool
Original commit: elastic/x-pack-elasticsearch@24a055dc00
2014-11-07 23:49:44 +01:00
Martijn van Groningen b11f0bf6df Test: changed default node settings
Core: AlertManager sets itself now

Original commit: elastic/x-pack-elasticsearch@fad2318528
2014-11-07 21:47:02 +01:00
Martijn van Groningen a6bb3b533f Test: prevent npe
Original commit: elastic/x-pack-elasticsearch@8a332d22be
2014-11-07 20:32:24 +01:00
Martijn van Groningen c081a9b62c Test: assertAlertTrigger should wait for active shards in alert history index.
Original commit: elastic/x-pack-elasticsearch@bdf6370aee
2014-11-07 19:59:56 +01:00
Brian Murphy c9eae998b5 Alerts : add alert serialization test
This test tests that an alert that is serialized in and out of json is the same alert.

Original commit: elastic/x-pack-elasticsearch@58cdc6d784
2014-11-07 17:44:18 +00:00
Brian Murphy a6468781f0 Alert Trigger : add trigger unit test.
This commit adds a simple unit test for the alert triggers.

Original commit: elastic/x-pack-elasticsearch@d9f42aa913
2014-11-07 17:43:35 +00:00
Brian Murphy 7a23074c7c Actually add the new TriggerManager classes.
These should have been added in the previous commit.

Original commit: elastic/x-pack-elasticsearch@9efecc7ace
2014-11-07 17:42:43 +00:00
Brian Murphy 5d8f43225a Alerts update trigger manager.
This change changes the trigger manager to be pluggable.
Also removes the SimpleTrigger class, for now all triggers should be scripts.

Original commit: elastic/x-pack-elasticsearch@f7d0cb77e7
2014-11-07 17:40:37 +00:00
Martijn van Groningen a6bdb5f572 Test: testing framework requires lucene test jar to be before lucene core jar on the classpath
Original commit: elastic/x-pack-elasticsearch@9b043c9b5b
2014-11-07 14:29:56 +01:00
Martijn van Groningen 434ee83df6 Build: Configure randomizedtesting properly
Original commit: elastic/x-pack-elasticsearch@e7b1a4fb9c
2014-11-07 14:24:56 +01:00
Martijn van Groningen a4dbc7315a Test: Added helper method that checks if an alert has triggered
Original commit: elastic/x-pack-elasticsearch@351d26618f
2014-11-07 13:45:48 +01:00
Martijn van Groningen f2453f53ac Test: Added no master node test
Original commit: elastic/x-pack-elasticsearch@0edeaba3a7
2014-11-07 13:21:15 +01:00
Brian Murphy 387cc6fb76 Add missing license check files.
Forgot to add these on the last commit.

Original commit: elastic/x-pack-elasticsearch@4d205e191d
2014-11-07 10:57:59 +00:00
Brian Murphy 7efeffd2c2 Add License header to all files and javadocs for AlertClientInterface.
This commit adds the license header to all java files and enforces the license check on compile.
It also adds javadocs for all the methods in the AlertClientInterface

Original commit: elastic/x-pack-elasticsearch@2ec6f89b4b
2014-11-07 10:38:43 +00:00
Martijn van Groningen 1dc9021fbe Added base alerting test class
Original commit: elastic/x-pack-elasticsearch@a3d258318f
2014-11-06 23:58:30 +01:00
Martijn van Groningen 0f0436e128 Cleaned up rest layer
Original commit: elastic/x-pack-elasticsearch@cdcdc98383
2014-11-06 23:49:50 +01:00
Martijn van Groningen 22cf7f68f4 Make tests work with multiple nodes.
Original commit: elastic/x-pack-elasticsearch@68004e1d6c
2014-11-06 22:52:44 +01:00
Martijn van Groningen 8f0e454ac5 Clear alerts after each test run, so that we don't run into exceptions between wipe indices and node closing.
Improved stop logging

Original commit: elastic/x-pack-elasticsearch@195a4cb75d
2014-11-06 22:15:11 +01:00
Martijn van Groningen 5be1c5964c on going work for improving test coverage
Original commit: elastic/x-pack-elasticsearch@1ccb9c9d9b
2014-11-06 21:25:53 +01:00
Brian Murphy 89dd5e2599 Move alert execution out of scheduler thread.
This commit moves the execution of the alert trigger to the AlertActions queued thread.
Also change the states of AlertActionEntry to include SEARCH_NEEDED and ERROR and remove now uneeded states.
AlertActions now take a TriggerResult instead of an alert action entry.

Original commit: elastic/x-pack-elasticsearch@2b650ca4c1
2014-11-06 13:34:48 +00:00
Brian Murphy f86544497a Remove extraneous methods and change IndexAlertAction.NAME
This commit removes the uneeded addAlert methods in AlertManager and AlertsStore and
also changes the IndexAlertAction.NAME to "indices:data/write/alert/index"

Original commit: elastic/x-pack-elasticsearch@19013dcf3e
2014-11-06 11:14:58 +00:00
Brian Murphy bce97abc1d Refactor and rename transport layer
This commit removes the update action and renames the create action to index.
It also hides the Alert objects behind the interface rather than exposing them.
This means that all interactions should be via BytesReferences.

Original commit: elastic/x-pack-elasticsearch@87ac377d3e
2014-11-06 11:08:57 +00:00
Martijn van Groningen 0f78028190 * Update the alert version on each write
* Make AlertStore#addAlert() return a tuple<Alert, IndexResponse>

Original commit: elastic/x-pack-elasticsearch@b2f270caaf
2014-11-06 11:30:52 +01:00
Martijn van Groningen 9c81a2ab87 * Simplified add alert action logic.
* Reduce needed code to index Alert and AlertActionEntry
* Added scroll for loading action needed alert action entries

Original commit: elastic/x-pack-elasticsearch@a7b790ecc4
2014-11-06 09:40:44 +01:00
Brian Murphy 6422e8b5d5 Add IndexResponse to Update and Create Alert Responses.
This commit adds the IndexResponse if available to the Update and Create
Alert Response objects.

Original commit: elastic/x-pack-elasticsearch@5fed850c61
2014-11-05 18:08:22 +00:00
Brian Murphy 5d52c374b3 Merge branch 'master' of https://github.com/elasticsearch/elasticsearch-alerts
Original commit: elastic/x-pack-elasticsearch@d91926ebdf
2014-11-05 17:50:54 +00:00
Brian Murphy 41821c39c6 DeleteAlert : Add the delete response to the DeleteAlertResponse
This commit adds the delete response to the DeleteAlertResponse.

Original commit: elastic/x-pack-elasticsearch@a5cc31f321
2014-11-05 17:50:05 +00:00
Martijn van Groningen b07b0d497d AlertManager#stop() didn't stop, the expected and update was reversed in compareAndSet
Original commit: elastic/x-pack-elasticsearch@5b001af292
2014-11-05 16:13:22 +01:00
Martijn van Groningen 5a957ed678 Introduced dedicated alerting thread pool, which executes alert actions
Original commit: elastic/x-pack-elasticsearch@e49ecb3f7c
2014-11-05 16:08:27 +01:00
Martijn van Groningen 61a28f68e3 Upgraded to ES 1.4.0
Original commit: elastic/x-pack-elasticsearch@6685382a01
2014-11-05 16:06:36 +01:00
Brian Murphy 47a78648df Alerts : Cleanup
This commit :
1. Ensures an alert will run even if the lastFireTime is null (first time we see an alert)
2. Removes the incorrect license that existed in some of the files.
3. Cuts the BasicTest over to use the AlertsClient and deletes the alert at the end of the test
to prevent it running in a race condition.
4. Moves the execute method signatures in AlertsClient to be on a single line.

Original commit: elastic/x-pack-elasticsearch@9c3aec0127
2014-11-05 10:05:17 +00:00
Brian Murphy 9a2e594647 Merge branch 'master' of https://github.com/elasticsearch/elasticsearch-alerts
Original commit: elastic/x-pack-elasticsearch@258c047506
2014-11-04 17:24:57 +00:00
Brian Murphy 4f58b9c5ff Alerts : Forgot to add the AlertsClient package.
Sorry.

Original commit: elastic/x-pack-elasticsearch@8231a3845b
2014-11-04 17:24:18 +00:00
Brian Murphy aced6039e9 Merge pull request elastic/elasticsearch#26 from elasticsearch/add-transport-actions
adds the following actions and an AlertsClient with AlertsClientInterface.
CreateAlert : Creates an alert.
UpdateAlert : Updates an existing alert.
DeleteAlert : Deletes an existing alert.
GetAlert : Gets an existing alert.

Original commit: elastic/x-pack-elasticsearch@8638fa7e35
2014-11-04 17:12:39 +00:00
Brian Murphy 9f3f23698f Merge branch 'add-transport-actions' of https://github.com/elasticsearch/elasticsearch-alerts into add-transport-actions
Conflicts:
	src/main/java/org/elasticsearch/alerts/AlertManager.java
	src/main/java/org/elasticsearch/alerts/AlertsStore.java
	src/main/java/org/elasticsearch/alerts/transport/actions/update/TransportUpdateAlertAction.java
	src/main/java/org/elasticsearch/alerts/transport/actions/update/UpdateAlertResponse.java
	src/test/java/org/elasticsearch/alerts/actions/AlertActionsTest.java

Original commit: elastic/x-pack-elasticsearch@3f1b58a2ee
2014-11-04 17:09:40 +00:00