public List<Experiment.ID> cleanPriorityList(Application.Name applicationName, List<Experiment.ID> experimentIDs) { // Removing duplicates from the priority list Set<Experiment.ID> experimentSet = new LinkedHashSet<>(experimentIDs); // Removing the experiment ID's from the priority list that are invalid for (Experiment.ID experimentID : experimentIDs) { Experiment experiment = experiments.getExperiment(experimentID); // Remove DELETED experiments from the priorityList // Remove experiments not belonging to the pertinent application // Remove TERMINATED experiments from the priorityList if (experiment == null || !experiment.getApplicationName().equals(applicationName) || experiment.getState().equals(TERMINATED)) { experimentSet.remove(experimentID); } } // Adding valid (DRAFT, RUNNING, PAUSED) experiments from the experiment column family to the priorityList that // are missing List<Experiment> experimentList = experiments.getExperiments(applicationName); if (experimentList.size() != experimentSet.size()) { for (Experiment experiment : experimentList) { if (!experimentSet.contains(experiment.getID())) { experimentSet.add(experiment.getID()); } } } return new ArrayList<>(experimentSet); }
if (!pairExp.getApplicationName().equals(baseExp.getApplicationName())) { tempResult.put("status", "FAILED"); tempResult.put("reason", new StringBuilder("Experiments 1 and 2 are not in the same application. ")
Role oldRole = null; for (UserRole role : userRoleList) { if (role.getApplicationName().equals(userRole.getApplicationName())) { oldRole = role.getRole(); break;
&& !updates.getApplicationName().equals(experiment.getApplicationName())) { builder.withApplicationName(updates.getApplicationName()); requiresUpdate = true;
boolean applicationNameChanged = !experiment.getApplicationName().equals(oldExperiment.getApplicationName ()); boolean segmentationRuleChanged = (experiment.getRule() != null && oldExperiment.getRule() != null) && !experiment.getRule().equals(oldExperiment.getRule());
!updates.getApplicationName().equals(experiment.getApplicationName())) { throw new IllegalArgumentException("Invalid application name \"" + updates.getApplicationName() + "\" " + "Cannot change application name when the experiment is in TERMINATED state");
/** * {@inheritDoc} */ @Override public void checkForIllegalPausedRunningUpdate(Experiment experiment, Experiment updates) { /* Throw an exception if the experiment is in RUNNING/PAUSED state and if applicationName or Label is being updated. Also, if startTime/endTime is being updated with a value that has already passed or when the established startTime/endTime has already passed. */ if (experiment.getState().equals(RUNNING) || experiment.getState().equals(PAUSED)) { if (updates.getApplicationName() != null && !updates.getApplicationName().equals(experiment.getApplicationName())) throw new IllegalArgumentException("Cannot change AppName when the experiment is not in DRAFT state"); if (updates.getLabel() != null && !updates.getLabel().equals(experiment.getLabel())) throw new IllegalArgumentException("Cannot change Label when the experiment is not in DRAFT state"); if (updates.getStartTime() != null && !updates.getStartTime().equals(experiment.getStartTime())) checkForIllegalExperimentStartTime(experiment, updates); if (updates.getEndTime() != null && !updates.getEndTime().equals(experiment.getEndTime())) checkForIllegalExperimentEndTime(experiment, updates); } }