Class SideChannel.Supplier<T extends SideChannel>

java.lang.Object
org.elasticsearch.compute.operator.SideChannel.Supplier<T>
Direct Known Subclasses:
SharedMinCompetitive.Supplier
Enclosing class:
SideChannel

public abstract static class SideChannel.Supplier<T extends SideChannel> extends Object
Builds the SideChannel on first use and returns a shared reference on the next use.
  • Constructor Details

    • Supplier

      public Supplier()
  • Method Details

    • build

      protected abstract T build()
    • get

      public final T get()
      Get the SideChannel, building it if this is the first call and incrementing its reference it if it has already been built.

      This will only ever build one channel at a time. There are 3 possible states:

      1. v contains null - create a new channel
      2. v contains a side channel, but it is closed - the thread that closed it will clear v. Loop until v contains null.
      3. v contains a side channel and successfully AbstractRefCounted.tryIncRef() it - return it.