Class ThrottleableTransport

java.lang.Object
org.graylog2.plugin.inputs.transports.ThrottleableTransport
All Implemented Interfaces:
Transport
Direct Known Subclasses:
AmqpTransport, GeneratorTransport, KafkaTransport, ThrottleableTransport2

@Deprecated public abstract class ThrottleableTransport extends Object implements Transport
Deprecated.
Please use ThrottleableTransport2 instead
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.
  • Field Details

    • CK_THROTTLING_ALLOWED

      public static final String CK_THROTTLING_ALLOWED
      Deprecated.
      See Also:
    • throttlingAllowed

      protected final boolean throttlingAllowed
      Deprecated.
    • eventBus

      protected final com.google.common.eventbus.EventBus eventBus
      Deprecated.
  • Constructor Details

    • ThrottleableTransport

      public ThrottleableTransport(com.google.common.eventbus.EventBus eventBus, Configuration configuration)
      Deprecated.
  • Method Details

    • launch

      public void launch(MessageInput input) throws MisfireException
      Deprecated.
      Specified by:
      launch in interface Transport
      Throws:
      MisfireException
    • doLaunch

      protected abstract void doLaunch(MessageInput input) throws MisfireException
      Deprecated.
      Performs the same purpose as launch(org.graylog2.plugin.inputs.MessageInput) but guarantees that the superclass' actions are performed.
      Parameters:
      input -
      Throws:
      MisfireException
    • stop

      public void stop()
      Deprecated.
      Specified by:
      stop in interface Transport
    • doStop

      protected abstract void doStop()
      Deprecated.
      Performs the same purpose as stop() but guarantees that the superclass' actions are performed.
    • updateThrottleState

      public void updateThrottleState(ThrottleState throttleState)
      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

      protected boolean determineIfThrottled(ThrottleState state)
      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

      public boolean blockUntilUnthrottled(long timeout, TimeUnit unit)
      Deprecated.
      Blocks until the blockLatch is released or until the timeout is exceeded.
      Parameters:
      timeout - the maximum time to wait
      unit - the time unit for the timeout argument.
      Returns:
      true if the blockLatch was released before the timeout elapsed. and false if the timeout was exceeded before the blockLatch was released.