|
66 | 66 | import io.split.storages.SplitCache; |
67 | 67 | import io.split.storages.SplitCacheConsumer; |
68 | 68 | import io.split.storages.SplitCacheProducer; |
| 69 | +import io.split.storages.RuleBasedSegmentCacheConsumer; |
| 70 | +import io.split.storages.RuleBasedSegmentCache; |
69 | 71 | import io.split.storages.enums.OperationMode; |
70 | 72 | import io.split.storages.memory.InMemoryCacheImp; |
71 | 73 | import io.split.storages.memory.SegmentCacheInMemoryImpl; |
| 74 | +import io.split.storages.memory.RuleBasedSegmentCacheInMemoryImp; |
72 | 75 | import io.split.storages.pluggable.adapters.UserCustomEventAdapterProducer; |
73 | 76 | import io.split.storages.pluggable.adapters.UserCustomImpressionAdapterConsumer; |
74 | 77 | import io.split.storages.pluggable.adapters.UserCustomImpressionAdapterProducer; |
@@ -202,6 +205,7 @@ public SplitFactoryImpl(String apiToken, SplitClientConfig config) throws URISyn |
202 | 205 |
|
203 | 206 | // Cache Initialisations |
204 | 207 | SegmentCache segmentCache = new SegmentCacheInMemoryImpl(); |
| 208 | + RuleBasedSegmentCache ruleBasedSegmentCache = new RuleBasedSegmentCacheInMemoryImp(); |
205 | 209 | FlagSetsFilter flagSetsFilter = new FlagSetsFilterImpl(config.getSetsFilter()); |
206 | 210 | SplitCache splitCache = new InMemoryCacheImp(flagSetsFilter); |
207 | 211 | ImpressionsStorage impressionsStorage = new InMemoryImpressionsStorage(config.impressionsQueueSize()); |
@@ -244,7 +248,7 @@ public SplitFactoryImpl(String apiToken, SplitClientConfig config) throws URISyn |
244 | 248 | config.getThreadFactory()); |
245 | 249 |
|
246 | 250 | // Evaluator |
247 | | - _evaluator = new EvaluatorImp(splitCache, segmentCache); |
| 251 | + _evaluator = new EvaluatorImp(splitCache, segmentCache, ruleBasedSegmentCache); |
248 | 252 |
|
249 | 253 | // SplitClient |
250 | 254 | _client = new SplitClientImpl(this, |
@@ -333,7 +337,9 @@ protected SplitFactoryImpl(String apiToken, SplitClientConfig config, CustomStor |
333 | 337 | _gates = new SDKReadinessGates(); |
334 | 338 |
|
335 | 339 | _telemetrySynchronizer = new TelemetryConsumerSubmitter(customStorageWrapper, _sdkMetadata); |
336 | | - _evaluator = new EvaluatorImp(userCustomSplitAdapterConsumer, userCustomSegmentAdapterConsumer); |
| 340 | + // TODO Update the instance to UserCustomRuleBasedSegmentAdapterConsumer |
| 341 | + RuleBasedSegmentCacheConsumer userCustomRuleBasedSegmentAdapterConsumer = new RuleBasedSegmentCacheInMemoryImp(); |
| 342 | + _evaluator = new EvaluatorImp(userCustomSplitAdapterConsumer, userCustomSegmentAdapterConsumer, userCustomRuleBasedSegmentAdapterConsumer); |
337 | 343 | _impressionsSender = PluggableImpressionSender.create(customStorageWrapper); |
338 | 344 | _uniqueKeysTracker = createUniqueKeysTracker(config); |
339 | 345 | _impressionsManager = buildImpressionsManager(config, userCustomImpressionAdapterConsumer, |
@@ -392,6 +398,7 @@ protected SplitFactoryImpl(SplitClientConfig config) { |
392 | 398 | SegmentCache segmentCache = new SegmentCacheInMemoryImpl(); |
393 | 399 | FlagSetsFilter flagSetsFilter = new FlagSetsFilterImpl(config.getSetsFilter()); |
394 | 400 | SplitCache splitCache = new InMemoryCacheImp(flagSetsFilter); |
| 401 | + RuleBasedSegmentCache _ruleBasedSegmentCache = new RuleBasedSegmentCacheInMemoryImp(); |
395 | 402 | _splitCache = splitCache; |
396 | 403 | _gates = new SDKReadinessGates(); |
397 | 404 | _segmentCache = segmentCache; |
@@ -428,7 +435,7 @@ protected SplitFactoryImpl(SplitClientConfig config) { |
428 | 435 | _impressionsManager, null, null, null); |
429 | 436 |
|
430 | 437 | // Evaluator |
431 | | - _evaluator = new EvaluatorImp(splitCache, segmentCache); |
| 438 | + _evaluator = new EvaluatorImp(splitCache, segmentCache, _ruleBasedSegmentCache); |
432 | 439 |
|
433 | 440 | EventsStorage eventsStorage = new NoopEventsStorageImp(); |
434 | 441 |
|
|
0 commit comments