Package step.plugins.event
Class EventBrokerImpl
- java.lang.Object
-
- step.plugins.event.EventBrokerImpl
-
- All Implemented Interfaces:
EventBroker
public class EventBrokerImpl extends Object implements EventBroker
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_GROUP_VALUEstatic StringDEFAULT_NAME_VALUE
-
Constructor Summary
Constructors Constructor Description EventBrokerImpl()EventBrokerImpl(long circuitBreakerThreshold, boolean advancedStatsOn, boolean hashedGroupNameOn)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()voidclearGroup(String group)voidclearStats()step.plugins.events.EventfindOldestEvent()step.plugins.events.EventfindOldestEventForGroup(String group)step.plugins.events.EventfindYoungestEvent()step.plugins.events.EventfindYoungestEventForGroup(String group)step.plugins.events.Eventget(String id)step.plugins.events.Eventget(String group, String name)Now using a sync-free optimistic version of the group lookup as an alternative to syncGroupOnbooleangetAdvancedStatsOn()longgetCircuitBreakerThreshold()longgetCumulatedAttemptedGets()longgetCumulatedAttemptedGroupGets()longgetCumulatedGets()longgetCumulatedPeeks()longgetCumulatedPuts()Set<String>getDistinctGroupNames()Map<String,Set<step.plugins.events.Event>>getFullGroupBasedEventMap()Map<String,Set<step.plugins.events.Event>>getGroupBasedEventMap(int skip, int limit)Set<step.plugins.events.Event>getGroupEvents(String group)Group accessSet<step.plugins.events.Event>getGroupEvents(String group, int skip, int limit)Map<String,Object>getGroupStats(String group)Map<String,step.plugins.events.Event>getIdBasedEventMap()Map<String,step.plugins.events.Event>getIdBasedEventMap(int skip, int limit)intgetSize()intgetSizeForGroup(String group)intgetSizeWaterMark()Not fully reliable due to the nature of CHMMap<String,Object>getStats()booleanisUniqueGroupNameOn()step.plugins.events.Eventpeek(String id)step.plugins.events.Eventpeek(String group, String name)Group primitives, adapted via lookup() to Id primitivesstep.plugins.events.Eventput(step.plugins.events.Event event)Main primitives, based on idvoidsetAdvancedStatsOn(boolean statsOn)StatsvoidsetCircuitBreakerThreshold(long circuitBreakerThreshold)voidsetUniqueGroupNameOn(boolean hashedGroupNameOn)StringtoString()
-
-
-
Method Detail
-
clear
public void clear()
- Specified by:
clearin interfaceEventBroker
-
getIdBasedEventMap
public Map<String,step.plugins.events.Event> getIdBasedEventMap()
- Specified by:
getIdBasedEventMapin interfaceEventBroker
-
getIdBasedEventMap
public Map<String,step.plugins.events.Event> getIdBasedEventMap(int skip, int limit)
- Specified by:
getIdBasedEventMapin interfaceEventBroker
-
getCircuitBreakerThreshold
public long getCircuitBreakerThreshold()
- Specified by:
getCircuitBreakerThresholdin interfaceEventBroker
-
setCircuitBreakerThreshold
public void setCircuitBreakerThreshold(long circuitBreakerThreshold)
- Specified by:
setCircuitBreakerThresholdin interfaceEventBroker
-
isUniqueGroupNameOn
public boolean isUniqueGroupNameOn()
- Specified by:
isUniqueGroupNameOnin interfaceEventBroker
-
setUniqueGroupNameOn
public void setUniqueGroupNameOn(boolean hashedGroupNameOn)
- Specified by:
setUniqueGroupNameOnin interfaceEventBroker
-
getSize
public int getSize()
- Specified by:
getSizein interfaceEventBroker
-
put
public step.plugins.events.Event put(step.plugins.events.Event event) throws ExceptionMain primitives, based on id- Specified by:
putin interfaceEventBroker- Throws:
Exception
-
get
public step.plugins.events.Event get(String id)
- Specified by:
getin interfaceEventBroker
-
peek
public step.plugins.events.Event peek(String id)
- Specified by:
peekin interfaceEventBroker
-
peek
public step.plugins.events.Event peek(String group, String name)
Group primitives, adapted via lookup() to Id primitives- Specified by:
peekin interfaceEventBroker
-
clearGroup
public void clearGroup(String group)
- Specified by:
clearGroupin interfaceEventBroker
-
get
public step.plugins.events.Event get(String group, String name)
Now using a sync-free optimistic version of the group lookup as an alternative to syncGroupOn- Specified by:
getin interfaceEventBroker
-
setAdvancedStatsOn
public void setAdvancedStatsOn(boolean statsOn)
Stats- Specified by:
setAdvancedStatsOnin interfaceEventBroker
-
getAdvancedStatsOn
public boolean getAdvancedStatsOn()
- Specified by:
getAdvancedStatsOnin interfaceEventBroker
-
getCumulatedPuts
public long getCumulatedPuts()
- Specified by:
getCumulatedPutsin interfaceEventBroker
-
getCumulatedGets
public long getCumulatedGets()
- Specified by:
getCumulatedGetsin interfaceEventBroker
-
getCumulatedAttemptedGets
public long getCumulatedAttemptedGets()
- Specified by:
getCumulatedAttemptedGetsin interfaceEventBroker
-
getCumulatedAttemptedGroupGets
public long getCumulatedAttemptedGroupGets()
- Specified by:
getCumulatedAttemptedGroupGetsin interfaceEventBroker
-
getCumulatedPeeks
public long getCumulatedPeeks()
- Specified by:
getCumulatedPeeksin interfaceEventBroker
-
getStats
public Map<String,Object> getStats()
- Specified by:
getStatsin interfaceEventBroker
-
getGroupStats
public Map<String,Object> getGroupStats(String group)
- Specified by:
getGroupStatsin interfaceEventBroker- Parameters:
group-- Returns:
-
getSizeWaterMark
public int getSizeWaterMark()
Not fully reliable due to the nature of CHM- Specified by:
getSizeWaterMarkin interfaceEventBroker
-
findOldestEvent
public step.plugins.events.Event findOldestEvent()
- Specified by:
findOldestEventin interfaceEventBroker
-
findYoungestEvent
public step.plugins.events.Event findYoungestEvent()
- Specified by:
findYoungestEventin interfaceEventBroker
-
getSizeForGroup
public int getSizeForGroup(String group)
- Specified by:
getSizeForGroupin interfaceEventBroker
-
findYoungestEventForGroup
public step.plugins.events.Event findYoungestEventForGroup(String group)
- Specified by:
findYoungestEventForGroupin interfaceEventBroker
-
findOldestEventForGroup
public step.plugins.events.Event findOldestEventForGroup(String group)
- Specified by:
findOldestEventForGroupin interfaceEventBroker
-
clearStats
public void clearStats()
- Specified by:
clearStatsin interfaceEventBroker
-
getGroupEvents
public Set<step.plugins.events.Event> getGroupEvents(String group)
Group access- Specified by:
getGroupEventsin interfaceEventBroker
-
getGroupEvents
public Set<step.plugins.events.Event> getGroupEvents(String group, int skip, int limit)
- Specified by:
getGroupEventsin interfaceEventBroker
-
getFullGroupBasedEventMap
public Map<String,Set<step.plugins.events.Event>> getFullGroupBasedEventMap()
- Specified by:
getFullGroupBasedEventMapin interfaceEventBroker
-
getGroupBasedEventMap
public Map<String,Set<step.plugins.events.Event>> getGroupBasedEventMap(int skip, int limit)
- Specified by:
getGroupBasedEventMapin interfaceEventBroker
-
getDistinctGroupNames
public Set<String> getDistinctGroupNames()
- Specified by:
getDistinctGroupNamesin interfaceEventBroker
-
-