@@ -194,10 +194,14 @@ class CountBasedEvictionPolicy(VirtualTableEvictionPolicy):
194
194
15 # eviction threshold for count based eviction policy. 0 means no eviction
195
195
)
196
196
decay_rate : float = 0.99 # default decay by default
197
- inference_eviction_threshold : int = (
198
- eviction_threshold # eviction threshold for inference count based eviction policy. 0 means no eviction
197
+ inference_eviction_threshold : Optional [ int ] = (
198
+ None # eviction threshold for inference count based eviction policy. 0 means no eviction
199
199
)
200
200
201
+ def __post_init__ (self ) -> None :
202
+ if self .inference_eviction_threshold is None :
203
+ self .inference_eviction_threshold = self .eviction_threshold
204
+
201
205
202
206
@dataclass
203
207
class TimestampBasedEvictionPolicy (VirtualTableEvictionPolicy ):
@@ -206,7 +210,11 @@ class TimestampBasedEvictionPolicy(VirtualTableEvictionPolicy):
206
210
"""
207
211
208
212
eviction_ttl_mins : int = 24 * 60 # 1 day. 0 means no eviction
209
- inference_eviction_ttl_mins : int = eviction_ttl_mins # 0 means no eviction
213
+ inference_eviction_ttl_mins : Optional [int ] = None # 0 means no eviction
214
+
215
+ def __post_init__ (self ) -> None :
216
+ if self .inference_eviction_ttl_mins is None :
217
+ self .inference_eviction_ttl_mins = self .eviction_ttl_mins
210
218
211
219
212
220
@dataclass
@@ -220,14 +228,21 @@ class CountTimestampMixedEvictionPolicy(VirtualTableEvictionPolicy):
220
228
)
221
229
decay_rate : float = 0.99 # default decay by default
222
230
eviction_ttl_mins : int = 24 * 60 # 1 day. 0 means no eviction based on timestamp
223
- inference_eviction_threshold : int = (
224
- eviction_threshold # eviction threshold for inference count based eviction policy. 0 means no eviction based on count
231
+ inference_eviction_threshold : Optional [ int ] = (
232
+ None # eviction threshold for inference count based eviction policy. 0 means no eviction based on count
225
233
)
226
234
227
- inference_eviction_ttl_mins : int = (
228
- eviction_ttl_mins # 0 means no eviction based on timestamp
235
+ inference_eviction_ttl_mins : Optional [ int ] = (
236
+ None # 0 means no eviction based on timestamp
229
237
)
230
238
239
+ def __post_init__ (self ) -> None :
240
+ if self .inference_eviction_ttl_mins is None :
241
+ self .inference_eviction_ttl_mins = self .eviction_ttl_mins
242
+
243
+ if self .inference_eviction_threshold is None :
244
+ self .inference_eviction_threshold = self .eviction_threshold
245
+
231
246
232
247
@dataclass
233
248
class FeatureL2NormBasedEvictionPolicy (VirtualTableEvictionPolicy ):
@@ -238,7 +253,11 @@ class FeatureL2NormBasedEvictionPolicy(VirtualTableEvictionPolicy):
238
253
eviction_threshold : float = (
239
254
0.0 # eviction threshold for feature l2 norm based eviction policy. 0.0 means no eviction
240
255
)
241
- inference_eviction_threshold : float = eviction_threshold
256
+ inference_eviction_threshold : Optional [float ] = None
257
+
258
+ def __post_init__ (self ) -> None :
259
+ if self .inference_eviction_threshold is None :
260
+ self .inference_eviction_threshold = self .eviction_threshold
242
261
243
262
244
263
@dataclass
0 commit comments