Map<Pair<Application.Name, Page.Name>, ListenableFuture<Result<PageExperimentByAppNamePage>>> expFutureMap = new HashMap<>(); appAndPagePairs.forEach(pair -> { expFutureMap.put(pair, pageExperimentIndexAccessor.asyncSelectBy(pair.getLeft().toString(), pair.getRight().toString())); });
/** * {@inheritDoc} */ @Override public Map<Application.Name, Set<String>> getTagListForApplications(Collection<Application.Name> applicationNames) { LOGGER.debug("Retrieving Experiment Tags for applications {}", applicationNames); try { List<ListenableFuture<Result<ExperimentTagsByApplication>>> futures = new ArrayList<>(); for (Application.Name appName : applicationNames) { ListenableFuture<Result<ExperimentTagsByApplication>> resultSetFuture = experimentTagAccessor .getExperimentTagsAsync(appName.toString()); futures.add(resultSetFuture); } Map<Application.Name, Set<String>> result = new HashMap<>(); for (ListenableFuture<Result<ExperimentTagsByApplication>> future : futures) { List<ExperimentTagsByApplication> expTagApplication = future.get().all(); Set<String> allTagsForApplication = new TreeSet<>(); for (ExperimentTagsByApplication expTagsByApp : expTagApplication) { allTagsForApplication.addAll(expTagsByApp.getTags()); } if (!expTagApplication.isEmpty()) result.put(Application.Name.valueOf(expTagApplication.get(0).getAppName()), allTagsForApplication); } return result; } catch (Exception e) { LOGGER.error("Error while retieving ExperimentTags for {}", applicationNames, e); throw new RepositoryException("Unable to get ExperimentTags for applications: \"" + applicationNames.toString() + "\"" + e); } }
&& !updates.getApplicationName().equals(experiment.getApplicationName())) { builder.withApplicationName(updates.getApplicationName()); requiresUpdate = true;
return "changed label from " + entry.getBefore() + " to " + entry.getAfter(); case "applicationName": return "moved experiment to application " + entry.getApplicationName().toString(); case "rule": return StringUtils.isBlank(entry.getAfter()) ? "removed segmentation rule" : "changed segmentation rule to " + entry.getAfter();
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. ")
DRAFT.name(), newExperiment.getLabel().toString(), newExperiment.getApplicationName().toString(), NOW, NOW, batchStmt.add(applicationListAccessor.insert(newExperiment.getApplicationName().toString())); batchStmt.add(prioritiesAccessor.appendToPriorities(newArrayList(newExperiment.getId().getRawID()), newExperiment.getApplicationName().toString())); newExperiment.getStartTime(), newExperiment.getEndTime(), DRAFT.name(), newExperiment.getApplicationName().toString(), newExperiment.getLabel().toString()));
boolean applicationNameChanged = !experiment.getApplicationName().equals(oldExperiment.getApplicationName ()); boolean segmentationRuleChanged = (experiment.getRule() != null && oldExperiment.getRule() != null) && !experiment.getRule().equals(oldExperiment.getRule());
experimentsFutureMap.put(appName, experimentAccessor.asyncGetExperimentByAppName(appName.toString())); LOGGER.debug("Sent experimentAccessor.asyncGetExperimentByAppName({})", appName); prioritiesFutureMap.put(appName, prioritiesAccessor.asyncGetPriorities(appName.toString())); LOGGER.debug("Sent prioritiesAccessor.asyncGetPriorities ({})", appName); });
experiment.getState().name(), experiment.getLabel().toString(), experiment.getApplicationName().toString(), NOW, experiment.getIsPersonalizationEnabled(),
appName.toString(), experimentLabel.toString(), State.DELETED.toString()); .withStartTime((Date) experimentMap.get("start_time")) .withCreationTime((Date) experimentMap.get("creation_time")) .withApplicationName(Application.Name.valueOf((String) experimentMap.get("app_name"))) .withSamplingPercent((Double) experimentMap.get("sampling_percent")) .build();
.withStartTime((Date) experimentMap.get("start_time")) .withCreationTime((Date) experimentMap.get("creation_time")) .withApplicationName(Application.Name.valueOf((String) experimentMap.get("app_name"))) .withSamplingPercent((Double) experimentMap.get("sampling_percent")) .build();
!updates.getApplicationName().equals(experiment.getApplicationName())) { throw new IllegalArgumentException("Invalid application name \"" + updates.getApplicationName() + "\" " + "Cannot change application name when the experiment is in TERMINATED state");
applicationName, priorityIds); try { prioritiesAccessor.deletePriorities(applicationName.toString()); } catch (Exception e) { LOGGER.error( + applicationName.toString() + "\"" + e); applicationName.toString()); } catch (Exception e) { LOGGER.error( "Unable to modify the priority list " + experimentIds + " for application: \"" + applicationName.toString() + "\"" + e);
experimentsFuture = experimentAccessor.asyncGetExperimentByAppName(appName.toString()); if (LOGGER.isDebugEnabled()) LOGGER.debug("Sent experimentAccessor.asyncGetExperimentByAppName({})", appName); applicationFuture = prioritiesAccessor.asyncGetPriorities(appName.toString()); if (LOGGER.isDebugEnabled()) LOGGER.debug("Sent prioritiesAccessor.asyncGetPriorities({})", appName); userAssignmentsFuture = experimentUserIndexAccessor.asyncSelectBy(userID.toString(), appName.toString(), context.toString()); if (LOGGER.isDebugEnabled()) LOGGER.debug("Sent experimentUserIndexAccessor.asyncSelectBy({}, {}, {})", userID, appName, context);
final String authorizationHeader) { try { if (newExperiment.getApplicationName() == null || isBlank(newExperiment.getApplicationName().toString())) { throw new IllegalArgumentException("Experiment application name cannot be null or an empty string");
eventJson.put("applicationName", applicationName != null ? applicationName.toString(): null); eventJson.put("experimentLabel", experimentLabel != null ? experimentLabel.toString(): null); eventJson.put("userID",
throw new RepositoryException( "Unable to retrieve the priority list for application: \"" + applicationName.toString() + "\"" + e);