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

Commit

Permalink
Update to OpenDistro Version 1.3 (#125)
Browse files Browse the repository at this point in the history
* Update to OD 1.3 -> ES 7.3.2, fix broken stats API. Update release docs.
  • Loading branch information
lucaswin-amzn authored Nov 14, 2019
1 parent fc59367 commit c72a267
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 21 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildscript {
apply from: 'build-tools/repositories.gradle'

ext {
es_version = '7.2.0'
es_version = '7.3.2'
kotlin_version = '1.3.21'
}

Expand All @@ -41,7 +41,7 @@ apply plugin: 'jacoco'
apply from: 'build-tools/merged-coverage.gradle'

ext {
opendistroVersion = '1.2.0'
opendistroVersion = '1.3.0'
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class ScheduledJobStats : BaseNodeResponse, ToXContentFragment {
lateinit var status: ScheduleStatus
var jobSweeperMetrics: JobSweeperMetrics? = null
var jobInfos: Array<JobSchedulerMetrics>? = null
val nodeRoles = node.roles.map { it.roleName().toUpperCase() }

constructor()

Expand Down Expand Up @@ -83,7 +84,7 @@ class ScheduledJobStats : BaseNodeResponse, ToXContentFragment {
override fun toXContent(builder: XContentBuilder, params: ToXContent.Params): XContentBuilder {
builder.field("name", node.name)
builder.field("schedule_status", status)
builder.field("roles", node.roles.toTypedArray())
builder.field("roles", nodeRoles)
if (jobSweeperMetrics != null) {
builder.startObject(RestScheduledJobStatsHandler.JOB_SCHEDULING_METRICS)
jobSweeperMetrics!!.toXContent(builder, params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,22 @@

package com.amazon.opendistroforelasticsearch.alerting.core.action.node

import org.elasticsearch.action.Action
import org.elasticsearch.action.ActionType
import org.elasticsearch.common.io.stream.Writeable

class ScheduledJobsStatsAction : Action<ScheduledJobsStatsResponse>(NAME) {
class ScheduledJobsStatsAction : ActionType<ScheduledJobsStatsResponse>(NAME, reader) {
companion object {
val INSTANCE = ScheduledJobsStatsAction()
const val NAME = "cluster:admin/opendistro/_scheduled_jobs/stats"

val reader = Writeable.Reader {
val response = ScheduledJobsStatsResponse()
response.readFrom(it)
response
}
}

override fun newResponse(): ScheduledJobsStatsResponse {
return ScheduledJobsStatsResponse()
override fun getResponseReader(): Writeable.Reader<ScheduledJobsStatsResponse> {
return reader
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ScheduledJobsStatsResponse : BaseNodesResponse<ScheduledJobStats>, ToXCont
}

override fun readNodesFrom(si: StreamInput): MutableList<ScheduledJobStats> {
return si.readList<ScheduledJobStats> { ScheduledJobStats.readScheduledJobStatus(it) }
return si.readList { ScheduledJobStats.readScheduledJobStatus(it) }
}

override fun toXContent(builder: XContentBuilder, params: ToXContent.Params): XContentBuilder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ class ScheduledJobsStatsTransportAction : TransportNodesAction<ScheduledJobsStat
this.scheduledJobIndices = scheduledJobIndices
}

override fun newNodeRequest(nodeId: String, request: ScheduledJobsStatsRequest): ScheduledJobStatusRequest {
return ScheduledJobStatusRequest(nodeId, request)
override fun newNodeRequest(request: ScheduledJobsStatsRequest): ScheduledJobStatusRequest {
return ScheduledJobStatusRequest(request)
}

override fun newNodeResponse(): ScheduledJobStats {
Expand Down Expand Up @@ -128,7 +128,7 @@ class ScheduledJobsStatsTransportAction : TransportNodesAction<ScheduledJobsStat
lateinit var request: ScheduledJobsStatsRequest

constructor() : super()
constructor(nodeId: String, request: ScheduledJobsStatsRequest) : super(nodeId) {
constructor(request: ScheduledJobsStatsRequest) : super() {
this.request = request
}

Expand Down
31 changes: 21 additions & 10 deletions opendistro-elasticsearch-alerting.release-notes.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,61 @@
## Version 1.2.0 (Current)
## Version 1.3.0.0 (Current)

## Bug Fixes
* Fixes allowing interval to be set with 0 or negative values - [PR #92](https://github.com/opendistro-for-elasticsearch/alerting/pull/92)
* Cleanup ElasticThreadContextElement - [PR #95](https://github.com/opendistro-for-elasticsearch/alerting/pull/95)

## 2019-09-24, Version 1.2.0.1

### Bug Fixes
* Updated execute API to keep thread context - [PR #90](https://github.com/opendistro-for-elasticsearch/alerting/pull/90)

## 2019-09-20, Version 1.2.0.0

### New Features
* Adds support for Elasticsearch 7.2.0 - [PR #89](https://github.com/opendistro-for-elasticsearch/alerting/pull/89)

### Bug fixes
### Bug Fixes
* Fixes integTestRunner build task - [PR #83](https://github.com/opendistro-for-elasticsearch/alerting/pull/83)

## 2019-07-25, Version 1.1.0
## 2019-07-25, Version 1.1.0.0

### New Features
* Adds support for Elasticsearch 7.1.1 - [PR #74](https://github.com/opendistro-for-elasticsearch/alerting/pull/74)
* Return stack trace for errors in Groovy/Painless script in UI when creating a trigger - [PR #72](https://github.com/opendistro-for-elasticsearch/alerting/pull/72)

## 2019-06-25, Version 1.0.0
## 2019-06-25, Version 1.0.0.0

### New Features
* Adds support for Elasticsearch 7.0.1 - [PR #41](https://github.com/opendistro-for-elasticsearch/alerting/pull/41)
* Adds support for throttling on actions - [PR #48](https://github.com/opendistro-for-elasticsearch/alerting/pull/48)

### Bug fixes
### Bug Fixes
* Validate all 2XX status code in Webhook response - [PR #50](https://github.com/opendistro-for-elasticsearch/alerting/pull/50)
* Allows encoding while constructing HTTP request for sending notification - [PR #35](https://github.com/opendistro-for-elasticsearch/alerting/pull/35)
* Convert AlertMover/MonitorRunner to coroutines - [PR #11](https://github.com/opendistro-for-elasticsearch/alerting/pull/11)

## 2019-04-24, Version 0.9.0
## 2019-04-24, Version 0.9.0.0

### New Features
* Adds support for Elasticsearch 6.7.1 - #19
* Add http proxy support to outgoing notifications - #23
* Allow encoding while constructing HTTP request for sending notification - [PR #35](https://github.com/opendistro-for-elasticsearch/alerting/pull/35)
* Add build for Debian - #36

### Bug fixes
### Bug Fixes
* Fix update LastFullSweepTime if the index doesn't exist - #17
* Adds more alert properties to templateArgs for context variable - #26

## 2019-04-02, Version 0.8.0
## 2019-04-02, Version 0.8.0.0

### New Features
* Adds support for Elasticsearch 6.6.2 - [PR #8](https://github.com/opendistro-for-elasticsearch/alerting/pull/8)
* Upgrade to latest Kotlin version - [PR #7](https://github.com/opendistro-for-elasticsearch/alerting/pull/7)

### Bug fixes
### Bug Fixes
* Fixed task name in build instructions - [PR #12](https://github.com/opendistro-for-elasticsearch/alerting/pull/12)

## 2019-01-31, Version 0.7.0
## 2019-01-31, Version 0.7.0.0

### New Features

Expand Down

0 comments on commit c72a267

Please sign in to comment.