Skip to content

Commit

Permalink
initial removal of user-assignment and user-assignment-index accessors
Browse files Browse the repository at this point in the history
  • Loading branch information
felixgao committed Jan 6, 2017
1 parent 169002b commit 3823ac1
Show file tree
Hide file tree
Showing 14 changed files with 205 additions and 752 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public Assignment getSingleAssignment(User.ID userID, Application.Name applicati
Assignment.Status.EXPERIMENT_EXPIRED);
}

Assignment assignment = assignmentsRepository.getAssignment(experimentID, userID, context);
Assignment assignment = assignmentsRepository.getAssignment(experimentID, applicationName, userID, context);
if (assignment == null) {
if (createAssignment) {
if (experiment.getState() == Experiment.State.PAUSED) {
Expand Down Expand Up @@ -536,7 +536,7 @@ public Assignment putAssignment(User.ID userID, Application.Name applicationName
}

//throw exception if assignment already exists for user unless overwrite == true
Assignment currentAssignment = assignmentsRepository.getAssignment(experimentID, userID, context);
Assignment currentAssignment = assignmentsRepository.getAssignment(experimentID, applicationName, userID, context);
if (!overwrite && currentAssignment != null && !currentAssignment.isBucketEmpty()) {
throw new AssignmentExistsException(userID, applicationName, experimentLabel);
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Table<Experiment.ID, Experiment.Label, String> getAssignments(User.ID userID, Ap
* @param context Environment context
* @return Assignment
*/
Assignment getAssignment(Experiment.ID experimentID, User.ID userID, Context context);
Assignment getAssignment(Experiment.ID experimentID, Application.Name appName, User.ID userID, Context context);

/**
* Delete assignment for experiment, user and application
Expand All @@ -107,6 +107,7 @@ void deleteAssignment(Experiment experiment, User.ID userID, Context context, Ap
* @param date Date of assignment
* @return Assignment
*/
@Deprecated
Assignment assignUserToOld(Assignment assignment, Date date);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ protected void configure() {
bind(ExperimentPageAccessor.class).toProvider(ExperimentPageAccessorProvider.class).in(Singleton.class);
bind(PrioritiesAccessor.class).toProvider(PrioritiesAccessorProvider.class).in(Singleton.class);
bind(StagingAccessor.class).toProvider(StagingAccessorProvider.class).in(Singleton.class);
bind(UserAssignmentAccessor.class).toProvider(UserAssignmentAccessorProvider.class).in(Singleton.class);
bind(UserFeedbackAccessor.class).toProvider(UserFeedbackAccessorProvider.class).in(Singleton.class);
bind(UserInfoAccessor.class).toProvider(UserInfoAccessorProvider.class).in(Singleton.class);
bind(UserRoleAccessor.class).toProvider(UserRoleAccessorProvider.class).in(Singleton.class);
Expand All @@ -88,7 +87,6 @@ protected void configure() {
bind(ExperimentUserIndexAccessor.class).toProvider(ExperimentUserIndexAccessorProvider.class).in(Singleton.class);
bind(PageExperimentIndexAccessor.class).toProvider(PageExperimentIndexAccessorProvider.class).in(Singleton.class);
bind(StateExperimentIndexAccessor.class).toProvider(StateExperimentIndexAccessorProvider.class).in(Singleton.class);
bind(UserAssignmentIndexAccessor.class).toProvider(UserAssignmentIndexAccessorProvider.class).in(Singleton.class);
bind(UserBucketIndexAccessor.class).toProvider(UserBucketIndexAccessorProvider.class).in(Singleton.class);
//Bind those audit
bind(AuditLogAccessor.class).toProvider(AuditLogAccessorProvider.class).in(Singleton.class);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public interface ExperimentUserIndexAccessor {
@Query("select * from experiment_user_index where user_id = ? and app_name = ? and context = ?")
Result<ExperimentUserByUserIdContextAppNameExperimentId> selectBy(String userId, String appName, String context);

@Query("select * from experiment_user_index where user_id = ? and app_name = ? and context = ? and experiment_id = ?")
Result<ExperimentUserByUserIdContextAppNameExperimentId> selectBy(String userId, String appName, String context, UUID experimentId);

@Query("delete from experiment_user_index where user_id = ? and experiment_id = ? and context = ? and app_name = ?")
ResultSet deleteBy(String userId, UUID experimentId, String context, String appName);

Expand Down

This file was deleted.

0 comments on commit 3823ac1

Please sign in to comment.