Package step.plugins.event
Class EventBrokerImpl
- java.lang.Object
-
- step.plugins.event.EventBrokerImpl
-
- All Implemented Interfaces:
EventBroker
public class EventBrokerImpl extends java.lang.Object implements EventBroker
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_GROUP_VALUE
static java.lang.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(java.lang.String group)
void
clearStats()
step.plugins.events.Event
findOldestEvent()
step.plugins.events.Event
findOldestEventForGroup(java.lang.String group)
step.plugins.events.Event
findYoungestEvent()
step.plugins.events.Event
findYoungestEventForGroup(java.lang.String group)
step.plugins.events.Event
get(java.lang.String id)
step.plugins.events.Event
get(java.lang.String group, java.lang.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()
java.util.Set<java.lang.String>
getDistinctGroupNames()
java.util.Map<java.lang.String,java.util.Set<step.plugins.events.Event>>
getFullGroupBasedEventMap()
java.util.Map<java.lang.String,java.util.Set<step.plugins.events.Event>>
getGroupBasedEventMap(int skip, int limit)
java.util.Set<step.plugins.events.Event>
getGroupEvents(java.lang.String group)
Group accessjava.util.Set<step.plugins.events.Event>
getGroupEvents(java.lang.String group, int skip, int limit)
java.util.Map<java.lang.String,java.lang.Object>
getGroupStats(java.lang.String group)
java.util.Map<java.lang.String,step.plugins.events.Event>
getIdBasedEventMap()
java.util.Map<java.lang.String,step.plugins.events.Event>
getIdBasedEventMap(int skip, int limit)
int
getSize()
int
getSizeForGroup(java.lang.String group)
int
getSizeWaterMark()
Not fully reliable due to the nature of CHMjava.util.Map<java.lang.String,java.lang.Object>
getStats()
boolean
isUniqueGroupNameOn()
step.plugins.events.Event
peek(java.lang.String id)
step.plugins.events.Event
peek(java.lang.String group, java.lang.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)
java.lang.String
toString()
-
-
-
Method Detail
-
clear
public void clear()
- Specified by:
clear
in interfaceEventBroker
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getIdBasedEventMap
public java.util.Map<java.lang.String,step.plugins.events.Event> getIdBasedEventMap()
- Specified by:
getIdBasedEventMap
in interfaceEventBroker
-
getIdBasedEventMap
public java.util.Map<java.lang.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 java.lang.Exception
Main primitives, based on id- Specified by:
put
in interfaceEventBroker
- Throws:
java.lang.Exception
-
get
public step.plugins.events.Event get(java.lang.String id)
- Specified by:
get
in interfaceEventBroker
-
peek
public step.plugins.events.Event peek(java.lang.String id)
- Specified by:
peek
in interfaceEventBroker
-
peek
public step.plugins.events.Event peek(java.lang.String group, java.lang.String name)
Group primitives, adapted via lookup() to Id primitives- Specified by:
peek
in interfaceEventBroker
-
clearGroup
public void clearGroup(java.lang.String group)
- Specified by:
clearGroup
in interfaceEventBroker
-
get
public step.plugins.events.Event get(java.lang.String group, java.lang.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 java.util.Map<java.lang.String,java.lang.Object> getStats()
- Specified by:
getStats
in interfaceEventBroker
-
getGroupStats
public java.util.Map<java.lang.String,java.lang.Object> getGroupStats(java.lang.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(java.lang.String group)
- Specified by:
getSizeForGroup
in interfaceEventBroker
-
findYoungestEventForGroup
public step.plugins.events.Event findYoungestEventForGroup(java.lang.String group)
- Specified by:
findYoungestEventForGroup
in interfaceEventBroker
-
findOldestEventForGroup
public step.plugins.events.Event findOldestEventForGroup(java.lang.String group)
- Specified by:
findOldestEventForGroup
in interfaceEventBroker
-
clearStats
public void clearStats()
- Specified by:
clearStats
in interfaceEventBroker
-
getGroupEvents
public java.util.Set<step.plugins.events.Event> getGroupEvents(java.lang.String group)
Group access- Specified by:
getGroupEvents
in interfaceEventBroker
-
getGroupEvents
public java.util.Set<step.plugins.events.Event> getGroupEvents(java.lang.String group, int skip, int limit)
- Specified by:
getGroupEvents
in interfaceEventBroker
-
getFullGroupBasedEventMap
public java.util.Map<java.lang.String,java.util.Set<step.plugins.events.Event>> getFullGroupBasedEventMap()
- Specified by:
getFullGroupBasedEventMap
in interfaceEventBroker
-
getGroupBasedEventMap
public java.util.Map<java.lang.String,java.util.Set<step.plugins.events.Event>> getGroupBasedEventMap(int skip, int limit)
- Specified by:
getGroupBasedEventMap
in interfaceEventBroker
-
getDistinctGroupNames
public java.util.Set<java.lang.String> getDistinctGroupNames()
- Specified by:
getDistinctGroupNames
in interfaceEventBroker
-
-