Skip to content

Commit

Permalink
fix ci for scheduler on nexus branch
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Kao <[email protected]>
  • Loading branch information
seankao-az committed Oct 30, 2024
1 parent 582d06d commit 826e53d
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 62 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"dynamic": false,
"properties": {
"accountId": {
"type": "keyword"
},
"jobId": {
"type": "keyword"
},
"dataSource": {
"type": "keyword"
},
"scheduledQuery": {
"type": "text"
},
"queryLang": {
"type": "keyword"
},
"lastUpdateTime": {
"type": "date",
"format": "epoch_millis"
},
"enabledTime": {
"type": "date",
"format": "epoch_millis"
},
"schedule": {
"properties": {
"initialDelay": {
"type": "long"
},
"interval": {
"properties": {
"start_time": {
"type": "date",
"format": "strict_date_time||epoch_millis"
},
"period": {
"type": "integer"
},
"unit": {
"type": "keyword"
}
}
}
}
},
"enabled": {
"type": "boolean"
},
"lockDurationSeconds": {
"type": "long",
"null_value": -1
},
"jitter": {
"type": "double",
"null_value": 0.0
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"index": {
"number_of_shards": "1",
"auto_expand_replicas": "0-2",
"number_of_replicas": "0"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
*/
public class OpenSearchAsyncQueryScheduler implements AsyncQueryScheduler {
public static final String SCHEDULER_INDEX_NAME = ".async-query-scheduler";
private static final String SCHEDULER_INDEX_MAPPING_FILE_NAME = "async-query-scheduler-index-mapping.yml";
private static final String SCHEDULER_INDEX_SETTINGS_FILE_NAME = "async-query-scheduler-index-settings.yml";
private static final String SCHEDULER_INDEX_MAPPING_FILE_NAME = "async-query-scheduler-index-mapping.json";
private static final String SCHEDULER_INDEX_SETTINGS_FILE_NAME = "async-query-scheduler-index-settings.json";
private static final Logger LOG = LogManager.getLogger(OpenSearchAsyncQueryScheduler.class);

private static final ObjectMapper mapper = new ObjectMapper();
Expand Down Expand Up @@ -110,8 +110,8 @@ void createAsyncQuerySchedulerIndex(IRestHighLevelClient client) {
InputStream settingsFileStream = getResourceAsStream(SCHEDULER_INDEX_SETTINGS_FILE_NAME)) {

CreateIndexRequest createIndexRequest = new CreateIndexRequest(SCHEDULER_INDEX_NAME)
.mapping(IOUtils.toString(mappingFileStream, StandardCharsets.UTF_8), XContentType.YAML)
.settings(IOUtils.toString(settingsFileStream, StandardCharsets.UTF_8), XContentType.YAML);
.mapping(IOUtils.toString(mappingFileStream, StandardCharsets.UTF_8), XContentType.JSON)
.settings(IOUtils.toString(settingsFileStream, StandardCharsets.UTF_8), XContentType.JSON);

CreateIndexResponse createIndexResponse = client.createIndex(createIndexRequest, RequestOptions.DEFAULT);
if (!createIndexResponse.isAcknowledged()) {
Expand Down

0 comments on commit 826e53d

Please sign in to comment.