Package org.apache.storm.daemon.supervisor

# Class OnlyLatestExecutor<K>

java.lang.Object
org.apache.storm.daemon.supervisor.OnlyLatestExecutor<K>

public class OnlyLatestExecutor<K> extends Object
This allows you to submit a Runnable with a key. If the previous submission for that key has not yet run, it will be replaced with the latest one.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `OnlyLatestExecutor(Executor exec)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `execute(K key, Runnable r)`
  Run something in the future, but replace it with the latest if it is taking too long.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### OnlyLatestExecutor

    public OnlyLatestExecutor(Executor exec)

- ## Method Details

  - ### execute

    public void execute(K key, Runnable r)
    Run something in the future, but replace it with the latest if it is taking too long.
    Parameters:
      `key` - what to use to dedupe things.
      `r` - what you want to run.