Class ImpressionAggregatorServiceTest.ImpressionAggregatorService
- java.lang.Object
-
- com.hybris.ymkt.recommendation.services.ImpressionAggregatorServiceTest.ImpressionAggregatorService
-
- Enclosing class:
- ImpressionAggregatorServiceTest
public static class ImpressionAggregatorServiceTest.ImpressionAggregatorService extends java.lang.ObjectTo be used to aggregate impressions from UI before persisting to DB.
Expected to be consumed in multi-threaded environment.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,java.util.Map<java.lang.Long,ImpressionAggregatorServiceTest.ImpressionCounter>>countersprotected intwindowprotected intwindow_2
-
Constructor Summary
Constructors Constructor Description ImpressionAggregatorService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddImpression(java.lang.String scenarioId, int itemCount)voidaddImpression(java.lang.String scenarioId, int impressionCount, int itemCount, long time)protected longkey(long time)java.util.List<ImpressionAggregatorServiceTest.Impression>remove()protected java.util.List<ImpressionAggregatorServiceTest.Impression>removeInternal(long time)
-
-
-
Field Detail
-
window
protected int window
-
window_2
protected int window_2
-
counters
protected final java.util.Map<java.lang.String,java.util.Map<java.lang.Long,ImpressionAggregatorServiceTest.ImpressionCounter>> counters
-
-
Method Detail
-
addImpression
public void addImpression(java.lang.String scenarioId, int itemCount)
-
addImpression
public void addImpression(java.lang.String scenarioId, int impressionCount, int itemCount, long time)
-
key
protected long key(long time)
-
remove
public java.util.List<ImpressionAggregatorServiceTest.Impression> remove()
- Returns:
- All aggregated
ImpressionAggregatorServiceTest.Impressionexcluding those in the current ongoing aggregationWindow.
-
removeInternal
protected java.util.List<ImpressionAggregatorServiceTest.Impression> removeInternal(long time)
-
-