Commit Graph

326 Commits

Author SHA1 Message Date
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
Brian Murphy 85655ac16d Alerts : Alert Transport Layer
This commit fixes the test and tests to make sure the alert we get back from
the alertsstore isn't null in execute alert since it may have been deleted.

Original commit: elastic/x-pack-elasticsearch@7a57dd090a
2014-11-04 17:03:03 +00:00
Brian Murphy a05fc88f0d Alerts: Transport actions
Add the UpdateAction (oops) and fix the test.

Original commit: elastic/x-pack-elasticsearch@ead7d446d7
2014-11-04 16:49:56 +00:00
Brian Murphy 75ce20ecff Alerting transport layer.
This commit adds the transport layer to the alerting plugin.

Original commit: elastic/x-pack-elasticsearch@a99dce9411
2014-11-04 16:49:56 +00:00
Martijn van Groningen 669203b2a1 Removed checks for creating alert & history index from code and use index templates instead
Original commit: elastic/x-pack-elasticsearch@c81134701f
2014-11-04 17:23:05 +01:00
Brian Murphy 69942c6c79 Alerting transport layer.
This commit adds the transport layer to the alerting plugin.

Original commit: elastic/x-pack-elasticsearch@0b6cb4760f
2014-11-04 16:21:57 +00:00
Martijn van Groningen c8c30f9b28 Properly resolve the place holders in the request source
Original commit: elastic/x-pack-elasticsearch@0d19c920d1
2014-11-04 16:01:20 +01:00
Martijn van Groningen 8ba9c1c609 Cleared up the alert / alert action entry classes and how the search request in the trigger manager gets prepared.
Original commit: elastic/x-pack-elasticsearch@52b16abb53
2014-11-04 11:27:58 +01:00
Martijn van Groningen 4373330a28 Changed the alert manager starting logic to move the loading logic down to alert store and alert action manager
Moved logic around from alert scheduler to action manager and trigger manager.

Original commit: elastic/x-pack-elasticsearch@8cba72b005
2014-10-31 10:28:42 +01:00
Martijn van Groningen 3e45310877 make more readable
Original commit: elastic/x-pack-elasticsearch@c7727618ac
2014-10-29 14:08:06 +01:00
Martijn van Groningen 12a6de0a57 Moved alert loading to use scan scroll instead of a single normal search
Original commit: elastic/x-pack-elasticsearch@06e70836ec
2014-10-29 10:20:36 +01:00
Martijn van Groningen 1e7fc84f06 Forgot to parse field
Original commit: elastic/x-pack-elasticsearch@23512bce74
2014-10-29 09:46:39 +01:00
Martijn van Groningen 3625b5bc91 Moved over the streaming parsing.
Original commit: elastic/x-pack-elasticsearch@10bd127df5
2014-10-29 00:54:18 +01:00
Martijn van Groningen 6b2fbe400e Introduced AlertsStore that is responsible for maintaining / storing / parsing etc of alerts
Original commit: elastic/x-pack-elasticsearch@40aae7dc30
2014-10-28 18:49:23 +01:00
Martijn van Groningen 34c359281a Added a todo
Original commit: elastic/x-pack-elasticsearch@56f5b1326b
2014-10-28 16:35:41 +01:00
Brian Murphy 879d88edac Merge pull request elastic/elasticsearch#21 from elasticsearch/alerthistory/jobqueue
Alerthistory/jobqueue

Original commit: elastic/x-pack-elasticsearch@87154dca40
2014-10-28 13:55:14 +00:00
Brian Murphy 4da8f9fec7 AlertActionManager: Add alert action job queue
This change adds the AlertActionManager and AlertActionEntry. The old AlertActionManager has become the AlertActionRegistry.
This means that now the results of Alerts are queued up in a job queue and executed in separate threads.
The AlertActionManager is a composite member of the AlertManager.
Change the BasicTest to just run on a single node to fix the action registration if the action happens on a different node.
Threads are not directly constructed but now the threadpool is used.
The ClusterStateListener in AlertManager is responsible now for starting the job queue.

Original commit: elastic/x-pack-elasticsearch@a73c6b60f8
2014-10-28 13:49:04 +00:00
Martijn van Groningen a23487cd38 Fixed build by:
* Using cluster state listener to clear alerts when .alerts index is removed. (when running on multiple nodes the .alerts index is scattered so indices listener doesn't work).
* Remove the starting / loading thread and move the initial loading to cluster state listener.

Original commit: elastic/x-pack-elasticsearch@b8f41db2ea
2014-10-25 23:37:05 +02:00
Bill Hwang 266a53d913 [CI] Add jacoco coverage profile
Original commit: elastic/x-pack-elasticsearch@1f9a665e8f
2014-10-24 10:16:03 -07:00
Martijn van Groningen 449edcda1d * Throw a understandle error if an alert action doesn't exist
* Moved over to a copy on write map instead of a hash map that is protected by synchronized blocks

Original commit: elastic/x-pack-elasticsearch@285515d585
2014-10-24 18:50:47 +02:00
Martijn van Groningen 39182616c7 Added slf4j log4j bindings for quartz :(
Original commit: elastic/x-pack-elasticsearch@2bc5bda9ed
2014-10-24 18:18:42 +02:00
Martijn van Groningen 1a32243781 Changes to AlertManager:
* Made use of IndicesLifecycle, to catch when the .alerts index gets deleted, so we can clear the alerts
* Moved to concurrent hashmap in favour over normal hashmap with synchronized blocks

Original commit: elastic/x-pack-elasticsearch@5599d01c78
2014-10-24 16:51:12 +02:00
Martijn van Groningen 16a7991d6d Rename and move the plugin class.
Original commit: elastic/x-pack-elasticsearch@b6f7a0490e
2014-10-24 14:31:20 +02:00
Brian Murphy 686f83ebb8 Merge pull request elastic/elasticsearch#14 from GaelTadh/change-packages
Alerting: Split alerting into packages

Original commit: elastic/x-pack-elasticsearch@68f2b86cb0
2014-10-24 13:22:15 +01:00
Brian Murphy ac979c880d Alerting : rename alerting package to alerts and fix test.
This commit renames the alerting package to alerts and will create the
alerts index on addAlert if needed.

Original commit: elastic/x-pack-elasticsearch@7cd691bd9b
2014-10-24 13:01:45 +01:00
Brian Murphy db9fae8021 Alerting: Split alerting into packages
This commit adds separate packages for actions,triggers,rest, and the scheduler.

Original commit: elastic/x-pack-elasticsearch@e104bbc521
2014-10-24 12:32:18 +01:00
Martijn van Groningen 9b7b2214c0 Removed duplicate dependency
Original commit: elastic/x-pack-elasticsearch@58a9068b61
2014-10-24 13:13:59 +02:00