public abstract class ThrottleableTransport extends Object implements Transport
| Modifier and Type | Class and Description |
|---|---|
static class |
ThrottleableTransport.Config |
Transport.Factory<T extends Transport>| Modifier and Type | Field and Description |
|---|---|
static String |
CK_THROTTLING_ALLOWED |
| Constructor and Description |
|---|
ThrottleableTransport(com.google.common.eventbus.EventBus eventBus,
Configuration configuration) |
| Modifier and Type | Method and Description |
|---|---|
void |
blockUntilUnthrottled() |
protected boolean |
determineIfThrottled(ThrottleState state)
This method implements the default algorithm for determining whether a transport will be throttled or not.
|
protected abstract void |
doLaunch(MessageInput input)
Performs the same purpose as
launch(org.graylog2.plugin.inputs.MessageInput) but guarantees that the superclass'
actions are performed. |
protected abstract void |
doStop()
Performs the same purpose as
stop() but guarantees that the superclass' actions are performed. |
boolean |
isThrottled() |
void |
launch(MessageInput input) |
void |
stop() |
void |
updateThrottleState(ThrottleState throttleState)
Only executed if this input is allowed to be throttled at all
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetMetricSet, setMessageAggregatorpublic static final String CK_THROTTLING_ALLOWED
public ThrottleableTransport(com.google.common.eventbus.EventBus eventBus,
Configuration configuration)
public void launch(MessageInput input) throws MisfireException
launch in interface TransportMisfireExceptionprotected abstract void doLaunch(MessageInput input) throws MisfireException
launch(org.graylog2.plugin.inputs.MessageInput) but guarantees that the superclass'
actions are performed.input - MisfireExceptionprotected abstract void doStop()
stop() but guarantees that the superclass' actions are performed.public void updateThrottleState(ThrottleState throttleState)
throttleState - current processing system statepublic boolean isThrottled()
protected boolean determineIfThrottled(ThrottleState state)
Override this method in your subclass if you need to customize the decision.
If the transport was started without the throttling_allowed flag enabled, this method will not be called!
state - the current state of the processing systempublic void blockUntilUnthrottled()
Copyright © 2012-2016 Graylog, Inc.. All Rights Reserved.