Skip to content

Commit

Permalink
Added workflow step for ReIndex Step (opensearch-project#718)
Browse files Browse the repository at this point in the history
* Initial commit for reindex workflow step with extra params

Signed-off-by: owaiskazi19 <[email protected]>

* Addressed PR comments

Signed-off-by: owaiskazi19 <[email protected]>

* Changed request per second to Float

Signed-off-by: owaiskazi19 <[email protected]>

* Addressed string array for source indices and removed state index entry

Signed-off-by: owaiskazi19 <[email protected]>

* Minor comments

Signed-off-by: owaiskazi19 <[email protected]>

---------

Signed-off-by: owaiskazi19 <[email protected]>
  • Loading branch information
owaiskazi19 authored and martinpkr committed Jun 2, 2024
1 parent 7d599cf commit 9f92614
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.opensearch.ExceptionsHelper;
import org.opensearch.action.support.PlainActionFuture;
import org.opensearch.client.Client;
import org.opensearch.common.Booleans;
import org.opensearch.core.action.ActionListener;
import org.opensearch.core.common.Strings;
import org.opensearch.core.rest.RestStatus;
Expand Down Expand Up @@ -90,9 +91,11 @@ public PlainActionFuture<WorkflowData> execute(

String sourceIndices = (String) inputs.get(SOURCE_INDEX);
String destinationIndex = (String) inputs.get(DESTINATION_INDEX);
Boolean refresh = ParseUtils.parseIfExists(inputs, REFRESH, Boolean.class);
Float requestsPerSecond = ParseUtils.parseIfExists(inputs, REQUESTS_PER_SECOND, Float.class);
Boolean requireAlias = ParseUtils.parseIfExists(inputs, REQUIRE_ALIAS, Boolean.class);
Boolean refresh = inputs.containsKey(REFRESH) ? Booleans.parseBoolean(inputs.get(REFRESH).toString()) : null;
Float requestsPerSecond = inputs.containsKey(REQUESTS_PER_SECOND)
? Float.parseFloat(inputs.get(REQUESTS_PER_SECOND).toString())
: null;
Boolean requireAlias = inputs.containsKey(REQUIRE_ALIAS) ? Booleans.parseBoolean(inputs.get(REQUIRE_ALIAS).toString()) : null;
Integer slices = (Integer) inputs.get(SLICES);
Integer maxDocs = (Integer) inputs.get(MAX_DOCS);

Expand Down

0 comments on commit 9f92614

Please sign in to comment.