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 String
DEFAULT_GROUP_VALUE
static String
DEFAULT_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 void
clear()
void
clearGroup(String group)
void
clearStats()
step.plugins.events.Event
findOldestEvent()
step.plugins.events.Event
findOldestEventForGroup(String group)
step.plugins.events.Event
findYoungestEvent()
step.plugins.events.Event
findYoungestEventForGroup(String group)
step.plugins.events.Event
get(String id)
step.plugins.events.Event
get(String group, String name)
Now using a sync-free optimistic version of the group lookup as an alternative to syncGroupOnboolean
getAdvancedStatsOn()
long
getCircuitBreakerThreshold()
long
getCumulatedAttemptedGets()
long
getCumulatedAttemptedGroupGets()
long
getCumulatedGets()
long
getCumulatedPeeks()
long
getCumulatedPuts()
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)
int
getSize()
int
getSizeForGroup(String group)
int
getSizeWaterMark()
Not fully reliable due to the nature of CHMMap<String,Object>
getStats()
boolean
isUniqueGroupNameOn()
step.plugins.events.Event
peek(String id)
step.plugins.events.Event
peek(String group, String name)
Group primitives, adapted via lookup() to Id primitivesstep.plugins.events.Event
put(step.plugins.events.Event event)
Main primitives, based on idvoid
setAdvancedStatsOn(boolean statsOn)
Statsvoid
setCircuitBreakerThreshold(long circuitBreakerThreshold)
void
setUniqueGroupNameOn(boolean hashedGroupNameOn)
String
toString()
-
-
-
Method Detail
-
clear
public void clear()
- Specified by:
clear
in interfaceEventBroker
-
getIdBasedEventMap
public Map<String,step.plugins.events.Event> getIdBasedEventMap()
- Specified by:
getIdBasedEventMap
in interfaceEventBroker
-
getIdBasedEventMap
public Map<String,step.plugins.events.Event> getIdBasedEventMap(int skip, int limit)
- Specified by:
getIdBasedEventMap
in interfaceEventBroker
-
getCircuitBreakerThreshold
public long getCircuitBreakerThreshold()
- Specified by:
getCircuitBreakerThreshold
in interfaceEventBroker
-
setCircuitBreakerThreshold
public void setCircuitBreakerThreshold(long circuitBreakerThreshold)
- Specified by:
setCircuitBreakerThreshold
in interfaceEventBroker
-
isUniqueGroupNameOn
public boolean isUniqueGroupNameOn()
- Specified by:
isUniqueGroupNameOn
in interfaceEventBroker
-
setUniqueGroupNameOn
public void setUniqueGroupNameOn(boolean hashedGroupNameOn)
- Specified by:
setUniqueGroupNameOn
in interfaceEventBroker
-
getSize
public int getSize()
- Specified by:
getSize
in interfaceEventBroker
-
put
public step.plugins.events.Event put(step.plugins.events.Event event) throws Exception
Main primitives, based on id- Specified by:
put
in interfaceEventBroker
- Throws:
Exception
-
get
public step.plugins.events.Event get(String id)
- Specified by:
get
in interfaceEventBroker
-
peek
public step.plugins.events.Event peek(String id)
- Specified by:
peek
in interfaceEventBroker
-
peek
public step.plugins.events.Event peek(String group, String name)
Group primitives, adapted via lookup() to Id primitives- Specified by:
peek
in interfaceEventBroker
-
clearGroup
public void clearGroup(String group)
- Specified by:
clearGroup
in 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:
get
in interfaceEventBroker
-
setAdvancedStatsOn
public void setAdvancedStatsOn(boolean statsOn)
Stats- Specified by:
setAdvancedStatsOn
in interfaceEventBroker
-
getAdvancedStatsOn
public boolean getAdvancedStatsOn()
- Specified by:
getAdvancedStatsOn
in interfaceEventBroker
-
getCumulatedPuts
public long getCumulatedPuts()
- Specified by:
getCumulatedPuts
in interfaceEventBroker
-
getCumulatedGets
public long getCumulatedGets()
- Specified by:
getCumulatedGets
in interfaceEventBroker
-
getCumulatedAttemptedGets
public long getCumulatedAttemptedGets()
- Specified by:
getCumulatedAttemptedGets
in interfaceEventBroker
-
getCumulatedAttemptedGroupGets
public long getCumulatedAttemptedGroupGets()
- Specified by:
getCumulatedAttemptedGroupGets
in interfaceEventBroker
-
getCumulatedPeeks
public long getCumulatedPeeks()
- Specified by:
getCumulatedPeeks
in interfaceEventBroker
-
getStats
public Map<String,Object> getStats()
- Specified by:
getStats
in interfaceEventBroker
-
getGroupStats
public Map<String,Object> getGroupStats(String group)
- Specified by:
getGroupStats
in interfaceEventBroker
- Parameters:
group
-- Returns:
-
getSizeWaterMark
public int getSizeWaterMark()
Not fully reliable due to the nature of CHM- Specified by:
getSizeWaterMark
in interfaceEventBroker
-
findOldestEvent
public step.plugins.events.Event findOldestEvent()
- Specified by:
findOldestEvent
in interfaceEventBroker
-
findYoungestEvent
public step.plugins.events.Event findYoungestEvent()
- Specified by:
findYoungestEvent
in interfaceEventBroker
-
getSizeForGroup
public int getSizeForGroup(String group)
- Specified by:
getSizeForGroup
in interfaceEventBroker
-
findYoungestEventForGroup
public step.plugins.events.Event findYoungestEventForGroup(String group)
- Specified by:
findYoungestEventForGroup
in interfaceEventBroker
-
findOldestEventForGroup
public step.plugins.events.Event findOldestEventForGroup(String group)
- Specified by:
findOldestEventForGroup
in interfaceEventBroker
-
clearStats
public void clearStats()
- Specified by:
clearStats
in interfaceEventBroker
-
getGroupEvents
public Set<step.plugins.events.Event> getGroupEvents(String group)
Group access- Specified by:
getGroupEvents
in interfaceEventBroker
-
getGroupEvents
public Set<step.plugins.events.Event> getGroupEvents(String group, int skip, int limit)
- Specified by:
getGroupEvents
in interfaceEventBroker
-
getFullGroupBasedEventMap
public Map<String,Set<step.plugins.events.Event>> getFullGroupBasedEventMap()
- Specified by:
getFullGroupBasedEventMap
in interfaceEventBroker
-
getGroupBasedEventMap
public Map<String,Set<step.plugins.events.Event>> getGroupBasedEventMap(int skip, int limit)
- Specified by:
getGroupBasedEventMap
in interfaceEventBroker
-
getDistinctGroupNames
public Set<String> getDistinctGroupNames()
- Specified by:
getDistinctGroupNames
in interfaceEventBroker
-
-