-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support dispatching execute task; don't dispatch ML task again (#279)
* support dispatching execute task; don't dispatch ML task again Signed-off-by: Yaliang Wu <[email protected]> * remove MLPredictTaskRunner from jacoco exclusion list Signed-off-by: Yaliang Wu <[email protected]>
- Loading branch information
Showing
15 changed files
with
267 additions
and
145 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
common/src/main/java/org/opensearch/ml/common/transport/MLTaskRequest.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,47 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.ml.common.transport; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
import org.opensearch.action.ActionRequest; | ||
import org.opensearch.action.ActionRequestValidationException; | ||
import org.opensearch.common.io.stream.StreamInput; | ||
import org.opensearch.common.io.stream.StreamOutput; | ||
|
||
import java.io.IOException; | ||
import java.util.UUID; | ||
|
||
@Getter | ||
@Setter | ||
public class MLTaskRequest extends ActionRequest { | ||
|
||
protected boolean dispatchTask; | ||
protected final String requestID; | ||
|
||
public MLTaskRequest(boolean dispatchTask) { | ||
this.dispatchTask = dispatchTask; | ||
this.requestID = UUID.randomUUID().toString(); | ||
} | ||
|
||
public MLTaskRequest(StreamInput in) throws IOException { | ||
super(in); | ||
this.requestID = in.readString(); | ||
this.dispatchTask = in.readBoolean(); | ||
} | ||
|
||
@Override | ||
public void writeTo(StreamOutput out) throws IOException { | ||
super.writeTo(out); | ||
out.writeString(requestID); | ||
out.writeBoolean(dispatchTask); | ||
} | ||
|
||
@Override | ||
public ActionRequestValidationException validate() { | ||
return null; | ||
} | ||
} |
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
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
Oops, something went wrong.