java.lang.Object
org.elasticsearch.core.AbstractRefCounted
org.elasticsearch.compute.operator.SideChannel
All Implemented Interfaces:
Closeable, AutoCloseable, org.elasticsearch.core.RefCounted, org.elasticsearch.core.Releasable
Direct Known Subclasses:
SharedMinCompetitive

public abstract class SideChannel extends org.elasticsearch.core.AbstractRefCounted implements org.elasticsearch.core.Releasable
A "side channel" for the Operators running on one node. These nodes must run on the same JVM, but will not run in the same Driver.

SideChannels are RefCounted so they can release resources when the last Operator referencing them is Operator.close()d.

SideChannels are configured during physical planning. And the physical plan nodes are not RefCounted. So we can't make the actual SideChannel implementations during planning. Instead, we configure a supplier that builds the SideChannel when building the first Operator instance.

This implements Releasable as a convenience that delegates to AbstractRefCounted.decRef().

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
     
    static class 
    Builds the SideChannel on first use and returns a shared reference on the next use.
  • Field Summary

    Fields inherited from class org.elasticsearch.core.AbstractRefCounted

    ALREADY_CLOSED_MESSAGE, INVALID_DECREF_MESSAGE

    Fields inherited from interface org.elasticsearch.core.RefCounted

    ALWAYS_REFERENCED
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
     
    protected final void
     
    protected abstract void
     

    Methods inherited from class org.elasticsearch.core.AbstractRefCounted

    alreadyClosed, decRef, hasReferences, incRef, mustIncRef, of, refCount, touch, tryIncRef

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • close

      public final void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface org.elasticsearch.core.Releasable
    • closeInternal

      protected final void closeInternal()
      Specified by:
      closeInternal in class org.elasticsearch.core.AbstractRefCounted
    • closeSideChannel

      protected abstract void closeSideChannel()