@@ -120,53 +120,53 @@ class DefaultBucketer: OPTBucketer {
120
120
return DecisionResponse ( result: nil , reasons: reasons)
121
121
}
122
122
123
- func bucketToEntityId( bucketingId: String ,
124
- experiment: Experiment ,
125
- trafficAllocation: [ TrafficAllocation ] ,
126
- group: Group ? ) -> DecisionResponse < String > {
127
- let reasons = DecisionReasons ( )
128
-
129
- if let group = group, group. policy == . random {
130
- let hashId = makeHashIdFromBucketingId ( bucketingId: bucketingId, entityId: group. id)
131
- let bucketValue = self . generateBucketValue ( bucketingId: hashId)
132
-
133
- var matched = false
134
- for allocation in group. trafficAllocation {
135
- if bucketValue < allocation. endOfRange {
136
- matched = true
137
- if allocation. entityId != experiment. id {
138
- let info = LogMessage . userNotBucketedIntoExperimentInGroup ( bucketingId, experiment. key, group. id)
139
- reasons. addInfo ( info)
140
- return DecisionResponse ( result: nil , reasons: reasons)
141
- }
142
-
143
- let info = LogMessage . userBucketedIntoExperimentInGroup ( bucketingId, experiment. key, group. id)
144
- reasons. addInfo ( info)
145
- break
146
- }
147
- }
148
-
149
- if !matched {
150
- let info = LogMessage . userNotBucketedIntoAnyExperimentInGroup ( bucketingId, group. id)
151
- reasons. addInfo ( info)
152
- return DecisionResponse ( result: nil , reasons: reasons)
153
- }
154
- }
155
-
156
- let hashId = makeHashIdFromBucketingId ( bucketingId: bucketingId, entityId: experiment. id)
157
- let bucketValue = self . generateBucketValue ( bucketingId: hashId)
158
-
159
- for allocation in trafficAllocation {
160
- if bucketValue < allocation. endOfRange {
161
- let info = LogMessage . userBucketedIntoEntity ( allocation. entityId)
162
- reasons. addInfo ( info)
163
- return DecisionResponse ( result: allocation. entityId, reasons: reasons)
164
- }
165
- }
166
- let info = LogMessage . userNotBucketedIntoAnyEntity
167
- reasons. addInfo ( info)
168
- return DecisionResponse ( result: nil , reasons: reasons)
169
- }
123
+ // func bucketToEntityId(bucketingId: String,
124
+ // experiment: Experiment,
125
+ // trafficAllocation: [TrafficAllocation],
126
+ // group: Group?) -> DecisionResponse<String> {
127
+ // let reasons = DecisionReasons()
128
+ //
129
+ // if let group = group, group.policy == .random {
130
+ // let hashId = makeHashIdFromBucketingId(bucketingId: bucketingId, entityId: group.id)
131
+ // let bucketValue = self.generateBucketValue(bucketingId: hashId)
132
+ //
133
+ // var matched = false
134
+ // for allocation in group.trafficAllocation {
135
+ // if bucketValue < allocation.endOfRange {
136
+ // matched = true
137
+ // if allocation.entityId != experiment.id {
138
+ // let info = LogMessage.userNotBucketedIntoExperimentInGroup(bucketingId, experiment.key, group.id)
139
+ // reasons.addInfo(info)
140
+ // return DecisionResponse(result: nil, reasons: reasons)
141
+ // }
142
+ //
143
+ // let info = LogMessage.userBucketedIntoExperimentInGroup(bucketingId, experiment.key, group.id)
144
+ // reasons.addInfo(info)
145
+ // break
146
+ // }
147
+ // }
148
+ //
149
+ // if !matched {
150
+ // let info = LogMessage.userNotBucketedIntoAnyExperimentInGroup(bucketingId, group.id)
151
+ // reasons.addInfo(info)
152
+ // return DecisionResponse(result: nil, reasons: reasons)
153
+ // }
154
+ // }
155
+ //
156
+ // let hashId = makeHashIdFromBucketingId(bucketingId: bucketingId, entityId: experiment.id)
157
+ // let bucketValue = self.generateBucketValue(bucketingId: hashId)
158
+ //
159
+ // for allocation in trafficAllocation {
160
+ // if bucketValue < allocation.endOfRange {
161
+ // let info = LogMessage.userBucketedIntoEntity(allocation.entityId)
162
+ // reasons.addInfo(info)
163
+ // return DecisionResponse(result: allocation.entityId, reasons: reasons)
164
+ // }
165
+ // }
166
+ // let info = LogMessage.userNotBucketedIntoAnyEntity
167
+ // reasons.addInfo(info)
168
+ // return DecisionResponse(result: nil, reasons: reasons)
169
+ // }
170
170
171
171
func bucketToVariation( experiment: ExperimentCore ,
172
172
bucketingId: String ) -> DecisionResponse < Variation > {
0 commit comments