forked from opensearch-project/opensearch-migrations
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stashing changes on branch for Mikayla
Signed-off-by: Chris Helma <chelma+github@amazon.com>
- Loading branch information
Showing
9 changed files
with
173 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
...a/org/opensearch/migrations/bulkload/version_es_6_8/OpenSearchWorkCoordinator_ES_6_8.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
package org.opensearch.migrations.bulkload.version_es_6_8; | ||
|
||
import java.time.Clock; | ||
import java.util.function.Consumer; | ||
|
||
import org.opensearch.migrations.bulkload.workcoordination.AbstractedHttpClient; | ||
import org.opensearch.migrations.bulkload.workcoordination.OpenSearchWorkCoordinator; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
|
||
public class OpenSearchWorkCoordinator_ES_6_8 extends OpenSearchWorkCoordinator { | ||
public OpenSearchWorkCoordinator_ES_6_8( | ||
AbstractedHttpClient httpClient, | ||
long tolerableClientServerClockDifferenceSeconds, | ||
String workerId | ||
) { | ||
super(httpClient, tolerableClientServerClockDifferenceSeconds, workerId); | ||
} | ||
|
||
public OpenSearchWorkCoordinator_ES_6_8( | ||
AbstractedHttpClient httpClient, | ||
long tolerableClientServerClockDifferenceSeconds, | ||
String workerId, | ||
Clock clock | ||
) { | ||
super(httpClient, tolerableClientServerClockDifferenceSeconds, workerId, clock); | ||
} | ||
|
||
|
||
public OpenSearchWorkCoordinator_ES_6_8( | ||
AbstractedHttpClient httpClient, | ||
long tolerableClientServerClockDifferenceSeconds, | ||
String workerId, | ||
Clock clock, | ||
Consumer<WorkItemAndDuration> workItemConsumer | ||
) { | ||
super(httpClient, tolerableClientServerClockDifferenceSeconds, workerId, clock, workItemConsumer); | ||
} | ||
|
||
protected String getCoordinationIndexSettingsBody(){ | ||
return "{\n" | ||
+ " \"settings\": {\n" | ||
+ " \"index\": {" | ||
+ " \"number_of_shards\": 1,\n" | ||
+ " \"number_of_replicas\": 1\n" | ||
+ " }\n" | ||
+ " },\n" | ||
+ " \"mappings\": {\n" | ||
+ " \"doc\": {\n" | ||
+ " \"properties\": {\n" | ||
+ " \"" + EXPIRATION_FIELD_NAME + "\": {\n" | ||
+ " \"type\": \"long\"\n" | ||
+ " },\n" | ||
+ " \"" + COMPLETED_AT_FIELD_NAME + "\": {\n" | ||
+ " \"type\": \"long\"\n" | ||
+ " },\n" | ||
+ " \"leaseHolderId\": {\n" | ||
+ " \"type\": \"keyword\",\n" | ||
+ " \"norms\": false\n" | ||
+ " },\n" | ||
+ " \"status\": {\n" | ||
+ " \"type\": \"keyword\",\n" | ||
+ " \"norms\": false\n" | ||
+ " },\n" | ||
+ " \"" + SUCCESSOR_ITEMS_FIELD_NAME + "\": {\n" | ||
+ " \"type\": \"keyword\",\n" | ||
+ " \"norms\": false\n" | ||
+ " }\n" | ||
+ " }\n" | ||
+ " }\n" | ||
+ " }\n" | ||
+ "}\n"; | ||
} | ||
|
||
protected String getPathForUpdates(String workItemId) { | ||
return INDEX_NAME + "/doc/" + workItemId + "/_update"; | ||
} | ||
|
||
protected String getPathForGets(String workItemId) { | ||
return INDEX_NAME + "/doc/" + workItemId; | ||
} | ||
|
||
protected String getPathForSearches() { | ||
return INDEX_NAME + "/doc/_search"; | ||
} | ||
|
||
protected int getTotalHitsFromSearchResponse(JsonNode searchResponse) { | ||
return searchResponse.path("hits").path("total").intValue(); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters