Class ThrottleableTransport
java.lang.Object
org.graylog2.plugin.inputs.transports.ThrottleableTransport
- All Implemented Interfaces:
Transport
- Direct Known Subclasses:
AmqpTransport
,GeneratorTransport
,KafkaTransport
,ThrottleableTransport2
Deprecated.
Placeholder class for implementing logic to throttle certain transports which support back pressure.
The built in transports that support this by reading less are the Kafka and AMQP transports.
Empty for now, since the process buffer provides natural throttling for now, but once that is async we need to supply back pressure in some other way.
Empty for now, since the process buffer provides natural throttling for now, but once that is async we need to supply back pressure in some other way.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.graylog2.plugin.inputs.transports.Transport
Transport.Factory<T extends Transport>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Deprecated.protected final com.google.common.eventbus.EventBus
Deprecated.protected final boolean
Deprecated. -
Constructor Summary
ConstructorDescriptionThrottleableTransport
(com.google.common.eventbus.EventBus eventBus, Configuration configuration) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deprecated.Blocks until the blockLatch is released.boolean
blockUntilUnthrottled
(long timeout, TimeUnit unit) Deprecated.Blocks until the blockLatch is released or until the timeout is exceeded.protected boolean
Deprecated.This method implements the default algorithm for determining whether a transport will be throttled or not.protected abstract void
doLaunch
(MessageInput input) Deprecated.Performs the same purpose aslaunch(org.graylog2.plugin.inputs.MessageInput)
but guarantees that the superclass' actions are performed.protected abstract void
doStop()
Deprecated.Performs the same purpose asstop()
but guarantees that the superclass' actions are performed.void
handleChangedThrottledState
(boolean isThrottled) Deprecated.Transports can override this to be notified when the throttled state changes.boolean
Deprecated.void
launch
(MessageInput input) Deprecated.void
stop()
Deprecated.void
updateThrottleState
(ThrottleState throttleState) Deprecated.Only executed if the Allow Throttling checkbox is set in the input's configuration.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.graylog2.plugin.inputs.transports.Transport
getMetricSet, launch, setMessageAggregator
-
Field Details
-
CK_THROTTLING_ALLOWED
Deprecated.- See Also:
-
throttlingAllowed
protected final boolean throttlingAllowedDeprecated. -
eventBus
protected final com.google.common.eventbus.EventBus eventBusDeprecated.
-
-
Constructor Details
-
ThrottleableTransport
public ThrottleableTransport(com.google.common.eventbus.EventBus eventBus, Configuration configuration) Deprecated.
-
-
Method Details
-
launch
Deprecated.- Specified by:
launch
in interfaceTransport
- Throws:
MisfireException
-
doLaunch
Deprecated.Performs the same purpose aslaunch(org.graylog2.plugin.inputs.MessageInput)
but guarantees that the superclass' actions are performed.- Parameters:
input
-- Throws:
MisfireException
-
stop
public void stop()Deprecated. -
doStop
protected abstract void doStop()Deprecated.Performs the same purpose asstop()
but guarantees that the superclass' actions are performed. -
updateThrottleState
Deprecated.Only executed if the Allow Throttling checkbox is set in the input's configuration.- Parameters:
throttleState
- current processing system state
-
handleChangedThrottledState
public void handleChangedThrottledState(boolean isThrottled) Deprecated.Transports can override this to be notified when the throttled state changes. Only called when throttled state changes.- Parameters:
isThrottled
- the current throttled state.
-
isThrottled
public boolean isThrottled()Deprecated. -
determineIfThrottled
Deprecated.This method implements the default algorithm for determining whether a transport will be throttled or not.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!- Parameters:
state
- the current state of the processing system- Returns:
- true if transport should be throttled, false if not.
-
blockUntilUnthrottled
public void blockUntilUnthrottled()Deprecated.Blocks until the blockLatch is released. -
blockUntilUnthrottled
Deprecated.Blocks until the blockLatch is released or until the timeout is exceeded.- Parameters:
timeout
- the maximum time to waitunit
- the time unit for thetimeout
argument.- Returns:
true
if the blockLatch was released before thetimeout
elapsed. andfalse
if thetimeout
was exceeded before the blockLatch was released.
-
ThrottleableTransport2
instead