diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/MonitorMetadataService.kt b/alerting/src/main/kotlin/org/opensearch/alerting/MonitorMetadataService.kt index 247f29ec0..4aa23ca39 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/MonitorMetadataService.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/MonitorMetadataService.kt @@ -49,7 +49,7 @@ import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.index.seqno.SequenceNumbers import org.opensearch.transport.RemoteTransportException -import java.util.* +import java.util.Locale private val log = LogManager.getLogger(MonitorMetadataService::class.java) @@ -224,7 +224,9 @@ object MonitorMetadataService : else null val runContext = if ( monitor.isMonitorOfStandardType() && - Monitor.MonitorType.valueOf(monitor.monitorType.uppercase(Locale.ROOT)) == Monitor.MonitorType.DOC_LEVEL_MONITOR && createWithRunContext + Monitor.MonitorType.valueOf(monitor.monitorType.uppercase(Locale.ROOT)) == + Monitor.MonitorType.DOC_LEVEL_MONITOR && + createWithRunContext ) createFullRunContext(monitorIndex) else emptyMap() diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/QueryLevelMonitorRunner.kt b/alerting/src/main/kotlin/org/opensearch/alerting/QueryLevelMonitorRunner.kt index e60cbac33..73f5ebb73 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/QueryLevelMonitorRunner.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/QueryLevelMonitorRunner.kt @@ -19,7 +19,7 @@ import org.opensearch.commons.alerting.model.Monitor import org.opensearch.commons.alerting.model.QueryLevelTrigger import org.opensearch.transport.TransportService import java.time.Instant -import java.util.* +import java.util.Locale object QueryLevelMonitorRunner : MonitorRunner() { private val logger = LogManager.getLogger(javaClass) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportExecuteMonitorAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportExecuteMonitorAction.kt index 084800c22..b6ab9daf0 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportExecuteMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportExecuteMonitorAction.kt @@ -43,7 +43,7 @@ import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.tasks.Task import org.opensearch.transport.TransportService import java.time.Instant -import java.util.* +import java.util.Locale private val log = LogManager.getLogger(TransportExecuteMonitorAction::class.java) private val scope: CoroutineScope = CoroutineScope(Dispatchers.IO) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexMonitorAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexMonitorAction.kt index b1f1ed668..94927f68d 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexMonitorAction.kt @@ -529,7 +529,8 @@ class TransportIndexMonitorAction @Inject constructor( try { if ( request.monitor.isMonitorOfStandardType() && - Monitor.MonitorType.valueOf(request.monitor.monitorType.uppercase(Locale.ROOT)) == Monitor.MonitorType.DOC_LEVEL_MONITOR + Monitor.MonitorType.valueOf(request.monitor.monitorType.uppercase(Locale.ROOT)) == + Monitor.MonitorType.DOC_LEVEL_MONITOR ) { indexDocLevelMonitorQueries(request.monitor, indexResponse.id, metadata, request.refreshPolicy) } diff --git a/sample-remote-monitor-plugin/build.gradle b/sample-remote-monitor-plugin/build.gradle index 19e681b02..c1761c0ee 100644 --- a/sample-remote-monitor-plugin/build.gradle +++ b/sample-remote-monitor-plugin/build.gradle @@ -107,12 +107,12 @@ integTest { jvmArgs '-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=8000' } } -//project.getTasks().getByName('bundlePlugin').dependsOn(rootProject.project(":alerting").tasks.getByName('build')) +project.getTasks().getByName('bundlePlugin').dependsOn(rootProject.project(":alerting").tasks.getByName('build')) Zip bundle = (Zip) project.getTasks().getByName("bundlePlugin"); -//Zip rootBundle = (Zip) rootProject.project(":alerting").getTasks().getByName("bundlePlugin"); +Zip rootBundle = (Zip) rootProject.project(":alerting").getTasks().getByName("bundlePlugin"); integTest.dependsOn(bundle) integTest.getClusters().forEach{c -> { -// c.plugin(rootProject.project(":alerting").getObjects().fileProperty().value(rootBundle.getArchiveFile())) + c.plugin(rootProject.project(":alerting").getObjects().fileProperty().value(rootBundle.getArchiveFile())) c.plugin(project.getObjects().fileProperty().value(bundle.getArchiveFile())) }} @@ -132,22 +132,6 @@ testClusters.integTest { } } setting 'path.repo', repo.absolutePath - plugin(provider({ - new RegularFile() { - @Override - File getAsFile() { - return configurations.zipArchive.asFileTree.matching { - include '**/alerting*' - }.singleFile - } - } - })) - nodes.each { node -> - def plugins = node.plugins - def firstPlugin = plugins.get(0) - plugins.remove(0) - plugins.add(firstPlugin) - } } run { diff --git a/settings.gradle b/settings.gradle index bf5b63e34..40e295126 100644 --- a/settings.gradle +++ b/settings.gradle @@ -13,4 +13,4 @@ project(":spi").name = 'alerting-spi' include 'sample-remote-monitor-plugin' project(":sample-remote-monitor-plugin").name = "alerting-sample-remote-monitor-plugin" -startParameter.excludedTaskNames=["publishPluginZipPublicationToMavenLocal", "publishPluginZipPublicationToStagingRepository"] +startParameter.excludedTaskNames=["publishPluginZipPublicationToMavenLocal", "publishPluginZipPublicationToZipStagingRepository"]