Skip to content

Commit 1125076

Browse files
Support ElasticSearch v7 (cadence-workflow#3700)
1 parent c11be59 commit 1125076

30 files changed

+1549
-89
lines changed

.buildkite/pipeline.yml

+15
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,21 @@ steps:
3131
run: integration-test-cassandra
3232
config: docker/buildkite/docker-compose.yml
3333

34+
- label: ":golang: integration test with cassandra with ElasticSearch V7"
35+
agents:
36+
queue: "workers"
37+
docker: "*"
38+
command: "make cover_integration_profile"
39+
artifact_paths:
40+
- "build/coverage/*.out"
41+
retry:
42+
automatic:
43+
limit: 1
44+
plugins:
45+
- docker-compose#v3.0.0:
46+
run: integration-test-cassandra
47+
config: docker/buildkite/docker-compose-es7.yml
48+
3449
- label: ":golang: integration ndc test with cassandra"
3550
agents:
3651
queue: "workers"

common/elasticsearch/client_v6.go

+9-7
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,14 @@ type (
7676
}
7777
)
7878

79-
// TODO https://github.com/uber/cadence/issues/3686
80-
const oneMicroSecondInNano = int64(time.Microsecond / time.Nanosecond)
79+
func (c *elasticV6) IsNotFoundError(err error) bool {
80+
if elastic.IsNotFound(err) {
81+
return true
82+
}
83+
return false
84+
}
8185

82-
// NewWrapperClient returns a new implementation of Client
86+
// newV6Client returns a new implementation of GenericClient
8387
func newV6Client(
8488
connectConfig *config.ElasticSearchConfig,
8589
visibilityConfig *config.VisibilityConfig,
@@ -200,7 +204,7 @@ func (c *elasticV6) RunBulkProcessor(ctx context.Context, parameters *BulkProces
200204
}
201205

202206
afterFunc := func(executionId int64, requests []elastic.BulkableRequest, response *elastic.BulkResponse, err error) {
203-
gerr := convertToGenericError(err)
207+
gerr := convertV6ErrorToGenericError(err)
204208
parameters.AfterFunc(
205209
executionId,
206210
fromV6ToGenericBulkableRequests(requests),
@@ -220,9 +224,7 @@ func (c *elasticV6) RunBulkProcessor(ctx context.Context, parameters *BulkProces
220224
})
221225
}
222226

223-
const unknownStatusCode = -1
224-
225-
func convertToGenericError(err error) *GenericError {
227+
func convertV6ErrorToGenericError(err error) *GenericError {
226228
if err == nil {
227229
return nil
228230
}

0 commit comments

Comments
 (0)