Interface MerlinDatabaseService.WriterRole
- All Known Subinterfaces:
MerlinDatabaseService.OwnerRole
- All Known Implementing Classes:
GraphQLMerlinDatabaseService
- Enclosing interface:
MerlinDatabaseService
public static interface MerlinDatabaseService.WriterRole
-
Method Summary
Modifier and TypeMethodDescriptionvoidclearPlanActivityDirectives(PlanId planId) delete all the activity instances stored in the target plan container the plan revision will change!Map<gov.nasa.jpl.aerie.types.ActivityDirectiveId, gov.nasa.jpl.aerie.types.ActivityDirectiveId> createAllPlanActivityDirectives(PlanId planId, gov.nasa.jpl.aerie.scheduler.model.Plan plan, Map<gov.nasa.jpl.aerie.scheduler.model.SchedulingActivity, gov.nasa.jpl.aerie.scheduler.model.GoalId> activityToGoalId, gov.nasa.jpl.aerie.merlin.protocol.model.SchedulerModel schedulerModel) create activity instances in the target plan container for each activity in the input plan does not attempt to resolve id clashes or do activity instance updates the plan revision will change!createEmptyPlan(String name, long modelId, Instant startTime, gov.nasa.jpl.aerie.merlin.protocol.types.Duration duration) create a new empty plan container based on specifications does not attach a scheduling specification to the plan!org.apache.commons.lang3.tuple.Pair<PlanId, Map<gov.nasa.jpl.aerie.types.ActivityDirectiveId, gov.nasa.jpl.aerie.types.ActivityDirectiveId>> createNewPlanWithActivityDirectives(PlanMetadata planMetadata, gov.nasa.jpl.aerie.scheduler.model.Plan plan, Map<gov.nasa.jpl.aerie.scheduler.model.SchedulingActivity, gov.nasa.jpl.aerie.scheduler.model.GoalId> activityToGoalId, gov.nasa.jpl.aerie.merlin.protocol.model.SchedulerModel schedulerModel) create an entirely new plan container in aerie and synchronize the in-memory plan to it does not mutate the original plan, so metadata remains valid for the original planstoreSimulationResults(PlanMetadata planMetadata, gov.nasa.jpl.aerie.merlin.driver.SimulationResults results, Map<gov.nasa.jpl.aerie.types.ActivityDirectiveId, gov.nasa.jpl.aerie.types.ActivityDirectiveId> uploadIdMap) Stores the simulation results produced during schedulingMap<gov.nasa.jpl.aerie.types.ActivityDirectiveId, gov.nasa.jpl.aerie.types.ActivityDirectiveId> updatePlanActivityDirectives(PlanId planId, MerlinPlan initialPlan, gov.nasa.jpl.aerie.scheduler.model.Plan plan, Map<gov.nasa.jpl.aerie.scheduler.model.SchedulingActivity, gov.nasa.jpl.aerie.scheduler.model.GoalId> activityToGoalId, gov.nasa.jpl.aerie.merlin.protocol.model.SchedulerModel schedulerModel) synchronize the in-memory plan back over to aerie data stores via update operations the plan revision will change!
-
Method Details
-
createNewPlanWithActivityDirectives
org.apache.commons.lang3.tuple.Pair<PlanId,Map<gov.nasa.jpl.aerie.types.ActivityDirectiveId, createNewPlanWithActivityDirectivesgov.nasa.jpl.aerie.types.ActivityDirectiveId>> (PlanMetadata planMetadata, gov.nasa.jpl.aerie.scheduler.model.Plan plan, Map<gov.nasa.jpl.aerie.scheduler.model.SchedulingActivity, gov.nasa.jpl.aerie.scheduler.model.GoalId> activityToGoalId, gov.nasa.jpl.aerie.merlin.protocol.model.SchedulerModel schedulerModel) throws IOException, NoSuchPlanException, MerlinServiceExceptioncreate an entirely new plan container in aerie and synchronize the in-memory plan to it does not mutate the original plan, so metadata remains valid for the original plan- Parameters:
planMetadata- identifying details of a plan to emulate in creating new container. id is ignored.plan- plan with all activity instances that should be stored to target merlin plan container- Returns:
- the database id of the newly created aerie plan container
- Throws:
NoSuchPlanException- when the plan container could not be found in aerie after creationIOExceptionMerlinServiceException
-
createEmptyPlan
PlanId createEmptyPlan(String name, long modelId, Instant startTime, gov.nasa.jpl.aerie.merlin.protocol.types.Duration duration) throws IOException, NoSuchPlanException, MerlinServiceException create a new empty plan container based on specifications does not attach a scheduling specification to the plan!- Parameters:
name- the human legible label for the new plan container to createmodelId- the database identifier of the mission model to associate with the planstartTime- the absolute start time of the new plan containerduration- the duration of the new plan container- Returns:
- the database id of the newly created aerie plan container
- Throws:
NoSuchPlanException- when the plan container could not be found in aerie after creationIOExceptionMerlinServiceException
-
updatePlanActivityDirectives
Map<gov.nasa.jpl.aerie.types.ActivityDirectiveId,gov.nasa.jpl.aerie.types.ActivityDirectiveId> updatePlanActivityDirectives(PlanId planId, MerlinPlan initialPlan, gov.nasa.jpl.aerie.scheduler.model.Plan plan, Map<gov.nasa.jpl.aerie.scheduler.model.SchedulingActivity, gov.nasa.jpl.aerie.scheduler.model.GoalId> activityToGoalId, gov.nasa.jpl.aerie.merlin.protocol.model.SchedulerModel schedulerModel) throws IOException, NoSuchPlanException, MerlinServiceException, NoSuchActivityInstanceExceptionsynchronize the in-memory plan back over to aerie data stores via update operations the plan revision will change!- Parameters:
planId- aerie database identifier of the target plan to synchronize intoplan- plan with all activity instances that should be stored to target merlin plan container- Returns:
- Throws:
NoSuchPlanException- when the plan container does not exist in aerieIOExceptionMerlinServiceExceptionNoSuchActivityInstanceException
-
clearPlanActivityDirectives
void clearPlanActivityDirectives(PlanId planId) throws IOException, NoSuchPlanException, MerlinServiceException delete all the activity instances stored in the target plan container the plan revision will change!- Parameters:
planId- the database id of the plan container to clear- Throws:
NoSuchPlanException- when the plan container does not exist in aerieIOExceptionMerlinServiceException
-
createAllPlanActivityDirectives
Map<gov.nasa.jpl.aerie.types.ActivityDirectiveId,gov.nasa.jpl.aerie.types.ActivityDirectiveId> createAllPlanActivityDirectives(PlanId planId, gov.nasa.jpl.aerie.scheduler.model.Plan plan, Map<gov.nasa.jpl.aerie.scheduler.model.SchedulingActivity, gov.nasa.jpl.aerie.scheduler.model.GoalId> activityToGoalId, gov.nasa.jpl.aerie.merlin.protocol.model.SchedulerModel schedulerModel) throws IOException, NoSuchPlanException, MerlinServiceExceptioncreate activity instances in the target plan container for each activity in the input plan does not attempt to resolve id clashes or do activity instance updates the plan revision will change!- Parameters:
planId- the database id of the plan container to populate with new activity instancesplan- the plan from which to copy all activity instances into aerie- Returns:
- Throws:
NoSuchPlanException- when the plan container does not exist in aerieIOExceptionMerlinServiceException
-
storeSimulationResults
DatasetId storeSimulationResults(PlanMetadata planMetadata, gov.nasa.jpl.aerie.merlin.driver.SimulationResults results, Map<gov.nasa.jpl.aerie.types.ActivityDirectiveId, gov.nasa.jpl.aerie.types.ActivityDirectiveId> uploadIdMap) throws MerlinServiceException, IOExceptionStores the simulation results produced during scheduling- Parameters:
planMetadata- the plan metadataresults- the simulation results- Throws:
MerlinServiceExceptionIOException
-