Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Execute monitor upon indexing & various fixes. #93

Conversation

lucaswin-amzn
Copy link
Contributor

Changes

  1. Make index monitor execute monitor to check for no errors. (Don't allow users to create monitors that will error out on the first execution, in particular don't allow users to create monitors on data they do not have access to when alerting is used with security).
  2. Use coroutines in index monitor.
  3. Update tests to reflect this.
  4. Port ElasticThreadContextElement to opendistro-1.1 and use a cleaner version.
  5. Fix imports

Build output

lucaswin$ ./gradlew clean

> Configure project :alerting
=======================================
Elasticsearch Build Hamster says Hello!
  Gradle Version        : 5.2.1
  OS Info               : Mac OS X 10.14.6 (x86_64)
  JDK Version           : 12 (Oracle Corporation 12.0.2 [Java HotSpot(TM) 64-Bit Server VM 12.0.2+10])
  JAVA_HOME             : /Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home
  Random Testing Seed   : C9B0BED24A3F3C54
=======================================

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.2.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 3s
4 actionable tasks: 4 executed
8c8590216cf4:alerting lucaswin$ ./gradlew build

> Configure project :alerting
=======================================
Elasticsearch Build Hamster says Hello!
  Gradle Version        : 5.2.1
  OS Info               : Mac OS X 10.14.6 (x86_64)
  JDK Version           : 12 (Oracle Corporation 12.0.2 [Java HotSpot(TM) 64-Bit Server VM 12.0.2+10])
  JAVA_HOME             : /Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home
  Random Testing Seed   : E620C62AE58F95A1
=======================================

> Task :alerting-notification:compileJava
Note: /Users/lucaswin/Desktop/github/alerting-backend/alerting/notification/src/main/java/com/amazon/opendistroforelasticsearch/alerting/destination/Notification.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :alerting:compileKotlin
w: /Users/lucaswin/Desktop/github/alerting-backend/alerting/alerting/src/main/kotlin/com/amazon/opendistroforelasticsearch/alerting/util/IndexUtils.kt: (105, 52): Unchecked cast: Any? to kotlin.collections.HashMap<String, *> /* = java.util.HashMap<String, *> */

> Task :alerting-notification:test
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.easymock.cglib.core.ReflectUtils$1 (file:/Users/lucaswin/.gradle/caches/modules-2/files-2.1/org.easymock/easymock/4.0.1/26f1c39bd323b6ac7fe0c4c8e33bfdffcdde03a2/easymock-4.0.1.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.easymock.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.2.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 2m 20s
50 actionable tasks: 49 executed, 1 up-to-date

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@lucaswin-amzn lucaswin-amzn requested review from a user, dbbaughe and jinsoor-amzn August 14, 2019 02:24
@lucaswin-amzn lucaswin-amzn merged commit bf2f6a1 into opendistro-for-elasticsearch:opendistro-1.1 Aug 20, 2019
@lucaswin-amzn lucaswin-amzn deleted the execute-before-index branch August 20, 2019 17:04
lucaswin-amzn added a commit to lucaswin-amzn/alerting that referenced this pull request Dec 13, 2019
…opendistro-for-elasticsearch#93)

* Update execute API to keep thread context. (opendistro-for-elasticsearch#90)

* Use the ElasticThreadContextElement when executing a monitor to preserve the context variables needed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants