Skip to content

Commit add1239

Browse files
committed
updated vars in engine/impressions/unique_keys_tracker
1 parent d683efa commit add1239

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

splitio/engine/impressions/unique_keys_tracker.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class BaseUniqueKeysTracker(object, metaclass=abc.ABCMeta):
99
"""Unique Keys Tracker interface."""
1010

1111
@abc.abstractmethod
12-
def track(self, key, feature_name):
12+
def track(self, key, feature_flag_name):
1313
"""
1414
Return a boolean flag
1515
@@ -33,23 +33,23 @@ def __init__(self, cache_size=30000):
3333
self._queue_full_hook = None
3434
self._current_cache_size = 0
3535

36-
def track(self, key, feature_name):
36+
def track(self, key, feature_flag_name):
3737
"""
3838
Return a boolean flag
3939
4040
:param key: key to be added to MTK list
4141
:type key: int
42-
:param feature_name: split name associated with the key
43-
:type feature_name: str
42+
:param feature_flag_name: feature flag name associated with the key
43+
:type feature_flag_name: str
4444
4545
:return: True if successful
4646
:rtype: boolean
4747
"""
4848
with self._lock:
49-
if self._filter.contains(feature_name+key):
49+
if self._filter.contains(feature_flag_name+key):
5050
return False
51-
self._add_or_update(feature_name, key)
52-
self._filter.add(feature_name+key)
51+
self._add_or_update(feature_flag_name, key)
52+
self._filter.add(feature_flag_name+key)
5353
self._current_cache_size += 1
5454

5555
if self._current_cache_size > self._cache_size:
@@ -61,20 +61,20 @@ def track(self, key, feature_name):
6161
self._queue_full_hook()
6262
return True
6363

64-
def _add_or_update(self, feature_name, key):
64+
def _add_or_update(self, feature_flag_name, key):
6565
"""
6666
Add the feature_name+key to both bloom filter and dictionary.
6767
68-
:param feature_name: split name associated with the key
69-
:type feature_name: str
68+
:param feature_flag_name: feature flag name associated with the key
69+
:type feature_flag_name: str
7070
:param key: key to be added to MTK list
7171
:type key: int
7272
"""
7373

7474
with self._lock:
75-
if feature_name not in self._cache:
76-
self._cache[feature_name] = set()
77-
self._cache[feature_name].add(key)
75+
if feature_flag_name not in self._cache:
76+
self._cache[feature_flag_name] = set()
77+
self._cache[feature_flag_name].add(key)
7878

7979
def set_queue_full_hook(self, hook):
8080
"""

0 commit comments

Comments
 (0)