Interface SolverWorkerFacade
public interface SolverWorkerFacade
Facade used by the REST layer to interact with dataset storage and the solver worker,
without depending on storage or messaging internals directly.
-
Method Summary
Modifier and TypeMethodDescription<Score_, ModelConfigurationOverrides_ extends ModelConfigOverrides>
Metadata<Score_> createAndSolveDataset(String id, DatasetSelector select, String runName, Set<String> tags, Configuration<ModelConfigurationOverrides_> configuration) Creates a new dataset derived from an existing one (identified byid) and immediately schedules it to be solved after validation/compute completes.<Score_, ModelConfigurationOverrides_ extends ModelConfigOverrides>
Metadata<Score_> createAndSolveDataset(String runName, Set<String> tags, ModelInput modelInput, Configuration<ModelConfigurationOverrides_> configuration) Creates a new dataset from the providedModelInputand immediately schedules it to be solved after validation/compute completes.<Score_, ModelConfigurationOverrides_ extends ModelConfigOverrides>
Metadata<Score_> createDataset(String id, DatasetSelector select, String runName, Set<String> tags, Configuration<ModelConfigurationOverrides_> configuration) Creates a new dataset derived from an existing one (identified byid) without starting the solving process.<Score_, ModelConfigurationOverrides_ extends ModelConfigOverrides>
Metadata<Score_> createDataset(String runName, Set<String> tags, ModelInput modelInput, Configuration<ModelConfigurationOverrides_> configuration) Creates a new dataset from the providedModelInputwithout starting the solving process.<ModelConfigurationOverrides_ extends ModelConfigOverrides>
Configuration<ModelConfigurationOverrides_> Returns the effective (processed)Configurationof the given dataset.Returns the solver logs associated with the given dataset.<Score_> Metadata<Score_> getMetadata(String id) Returns theMetadatafor the given dataset, ornullif none exists.getModelInput(String id) Returns theModelInputoriginally submitted for the given dataset.<ModelInput_ extends ModelInput, ModelConfigurationOverrides_ extends ModelConfigOverrides>
ModelRequest<ModelInput_, ModelConfigurationOverrides_> Returns the originalModelRequestfor the given dataset.<Score_, ModelOutput_ extends ModelOutput, InputMetrics_ extends ModelInputMetrics, OutputMetrics_ extends ModelOutputMetrics>
ModelResponse<Score_, ModelOutput_, InputMetrics_, OutputMetrics_> Returns theModelResponsefor the given dataset.Returns theModelInputrepresenting the solved state of the given dataset (i.e. planning entities updated with the best solution).<ModelConfigurationOverrides_ extends ModelConfigOverrides>
Configuration<ModelConfigurationOverrides_> Returns the original (unprocessed)Configurationof the given dataset, as it was supplied by the caller before any post-processing.listRuns(int pageNumber, int pageSize) Returns a paginated list of dataset runs.<Score_, ModelConfigurationOverrides_ extends ModelConfigOverrides>
Metadata<Score_> patchAndSolveDataset(String id, DatasetSelector select, String runName, ModelInputPatchRequest<ModelConfigurationOverrides_> modelInputPatchRequest) Creates a new dataset by applying a JSON patch to an existing dataset'sModelInputand immediately schedules it to be solved after validation/compute completes.<Score_, ModelConfigurationOverrides_ extends ModelConfigOverrides>
Metadata<Score_> patchDataset(String id, DatasetSelector select, String runName, ModelInputPatchRequest<ModelConfigurationOverrides_> modelInputPatchRequest) Creates a new dataset by applying a JSON patch to an existing dataset'sModelInput, without starting the solving process.<Score_> Metadata<Score_> solveDataset(String id) Starts solving an existing dataset identified by the given id.<Score_, ModelOutput_ extends ModelOutput, InputMetrics_ extends ModelInputMetrics, OutputMetrics_ extends ModelOutputMetrics>
ModelResponse<Score_, ModelOutput_, InputMetrics_, OutputMetrics_> Terminates the ongoing solve for the given dataset (if any) and returns the current model response
-
Method Details
-
solveDataset
Starts solving an existing dataset identified by the given id.- Parameters:
id- the dataset identifier- Returns:
- the
Metadataassociated with the dataset that will be solved - Throws:
ItemNotFoundException- if no dataset exists for the given id
-
createDataset
<Score_, ModelConfigurationOverrides_ extends ModelConfigOverrides> Metadata<Score_> createDataset(String id, DatasetSelector select, String runName, Set<String> tags, Configuration<ModelConfigurationOverrides_> configuration) Creates a new dataset derived from an existing one (identified byid) without starting the solving process. The resulting dataset is validated and computed asynchronously.- Parameters:
id- the identifier of the source (parent) dataset.select- whether to derive from the unsolved input or the solved output of the parentrunName- a human-readable name for the new runtags- the set of tags to attach to the new datasetconfiguration- the configuration to apply; ifnull, the parent's configuration is reused- Returns:
- the
Metadataof the newly created dataset
-
createAndSolveDataset
<Score_, ModelConfigurationOverrides_ extends ModelConfigOverrides> Metadata<Score_> createAndSolveDataset(String id, DatasetSelector select, String runName, Set<String> tags, Configuration<ModelConfigurationOverrides_> configuration) Creates a new dataset derived from an existing one (identified byid) and immediately schedules it to be solved after validation/compute completes.- Parameters:
id- the identifier of the source (parent) datasetselect- whether to derive from the unsolved input or the solved output of the parentrunName- a human-readable name for the new runtags- the set of tags to attach to the new datasetconfiguration- the configuration to apply; ifnull, the parent's configuration is reused- Returns:
- the
Metadataof the newly created dataset
-
createDataset
<Score_, ModelConfigurationOverrides_ extends ModelConfigOverrides> Metadata<Score_> createDataset(String runName, Set<String> tags, ModelInput modelInput, Configuration<ModelConfigurationOverrides_> configuration) Creates a new dataset from the providedModelInputwithout starting the solving process. The resulting dataset is validated and computed asynchronously.- Parameters:
runName- a human-readable name for the new runtags- the set of tags to attach to the new datasetmodelInput- the model input to store as the dataset problemconfiguration- the configuration to apply to the dataset- Returns:
- the
Metadataof the newly created dataset
-
createAndSolveDataset
<Score_, ModelConfigurationOverrides_ extends ModelConfigOverrides> Metadata<Score_> createAndSolveDataset(String runName, Set<String> tags, ModelInput modelInput, Configuration<ModelConfigurationOverrides_> configuration) Creates a new dataset from the providedModelInputand immediately schedules it to be solved after validation/compute completes.- Parameters:
runName- a human-readable name for the new runtags- the set of tags to attach to the new datasetmodelInput- the model input to store as the dataset problemconfiguration- the configuration to apply to the dataset- Returns:
- the
Metadataof the newly created dataset
-
patchDataset
<Score_, ModelConfigurationOverrides_ extends ModelConfigOverrides> Metadata<Score_> patchDataset(String id, DatasetSelector select, String runName, ModelInputPatchRequest<ModelConfigurationOverrides_> modelInputPatchRequest) Creates a new dataset by applying a JSON patch to an existing dataset'sModelInput, without starting the solving process. The resulting dataset is validated and computed asynchronously.- Parameters:
id- the identifier of the source (parent) datasetselect- whether to derive from the unsolved input or the solved output of the parentrunName- a human-readable name for the new runmodelInputPatchRequest- the patch request containing the JSON patch operations and an optionalConfigurationoverride- Returns:
- the
Metadataof the newly created dataset - Throws:
ItemNotFoundException- if no dataset exists for the given id
-
patchAndSolveDataset
<Score_, ModelConfigurationOverrides_ extends ModelConfigOverrides> Metadata<Score_> patchAndSolveDataset(String id, DatasetSelector select, String runName, ModelInputPatchRequest<ModelConfigurationOverrides_> modelInputPatchRequest) Creates a new dataset by applying a JSON patch to an existing dataset'sModelInputand immediately schedules it to be solved after validation/compute completes.- Parameters:
id- the identifier of the source (parent) datasetselect- whether to derive from the unsolved input or the solved output of the parentrunName- a human-readable name for the new runmodelInputPatchRequest- the patch request containing the JSON patch operations and an optionalConfigurationoverride- Returns:
- the
Metadataof the newly created dataset - Throws:
ItemNotFoundException- if no dataset exists for the given id
-
terminate
<Score_, ModelOutput_ extends ModelOutput, InputMetrics_ extends ModelInputMetrics, OutputMetrics_ extends ModelOutputMetrics> ModelResponse<Score_, ModelOutput_, InputMetrics_, OutputMetrics_> terminate(String id) Terminates the ongoing solve for the given dataset (if any) and returns the current model response- Parameters:
id- the dataset identifier- Returns:
- the
ModelResponsefor the dataset after termination
-
getMetadata
-
getConfiguration
<ModelConfigurationOverrides_ extends ModelConfigOverrides> Configuration<ModelConfigurationOverrides_> getConfiguration(String id) Returns the effective (processed)Configurationof the given dataset.- Parameters:
id- the dataset identifier- Returns:
- the effective configuration, or
nullif not found
-
getUnprocessedConfiguration
<ModelConfigurationOverrides_ extends ModelConfigOverrides> Configuration<ModelConfigurationOverrides_> getUnprocessedConfiguration(String id) Returns the original (unprocessed)Configurationof the given dataset, as it was supplied by the caller before any post-processing.- Parameters:
id- the dataset identifier- Returns:
- the unprocessed configuration, or
nullif not found
-
getModelInput
Returns theModelInputoriginally submitted for the given dataset.- Parameters:
id- the dataset identifier- Returns:
- the model input, or
nullif not found
-
getSolvedModelInput
Returns theModelInputrepresenting the solved state of the given dataset (i.e. planning entities updated with the best solution).- Parameters:
id- the dataset identifier- Returns:
- the solved model input, or
nullif not available
-
listRuns
-
getModelResponse
<Score_, ModelOutput_ extends ModelOutput, InputMetrics_ extends ModelInputMetrics, OutputMetrics_ extends ModelOutputMetrics> ModelResponse<Score_, ModelOutput_, InputMetrics_, OutputMetrics_> getModelResponse(String id) Returns theModelResponsefor the given dataset.- Parameters:
id- the dataset identifier- Returns:
- the model response, or
nullif not available
-
getModelRequest
<ModelInput_ extends ModelInput, ModelConfigurationOverrides_ extends ModelConfigOverrides> ModelRequest<ModelInput_, ModelConfigurationOverrides_> getModelRequest(String id) Returns the originalModelRequestfor the given dataset.- Parameters:
id- the dataset identifier- Returns:
- the model request, or
nullif not found
-
getLogs
Returns the solver logs associated with the given dataset. The result combines the currently running pod's log file (if present) with any previously persisted log content- Parameters:
id- the dataset identifier- Returns:
- the aggregated
LogInfo, ornullif no logs are available
-