Class SessionState.ExportObject<T>

java.lang.Object
io.deephaven.util.referencecounting.ReferenceCounted
io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
io.deephaven.engine.liveness.ReferenceCountedLivenessNode
io.deephaven.engine.liveness.LivenessArtifact
io.deephaven.server.session.SessionState.ExportObject<T>
Type Parameters:
T - Is context-sensitive depending on the export.
All Implemented Interfaces:
io.deephaven.base.log.LogOutputAppendable, io.deephaven.engine.liveness.LivenessManager, io.deephaven.engine.liveness.LivenessNode, io.deephaven.engine.liveness.LivenessReferent, Serializable
Enclosing class:
SessionState

public static final class SessionState.ExportObject<T> extends io.deephaven.engine.liveness.LivenessArtifact
This class represents one unit of content exported in the session.

Note: we reuse ExportObject for non-exporting tasks that have export dependencies.

See Also:
ApiNote:
ExportId may be 0, if this is a task that has exported dependencies, but does not export anything itself. Non-exports do not publish state changes.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Releases this export; it will cancel the work and dependent exports proactively when possible.
    protected void
     
    get()
    WARNING! This method call is only safe to use in the following patterns:
    io.deephaven.proto.backplane.grpc.Ticket
     
    int
     
    io.deephaven.proto.backplane.grpc.ExportNotification.State
     
    boolean
     
    void
    Releases this export; it will wait for the work to complete before releasing.

    Methods inherited from class io.deephaven.engine.liveness.LivenessArtifact

    manageWithCurrentScope

    Methods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessNode

    getWeakReference, initializeTransientFieldsForLiveness, onReferenceCountAtZero, tryManage, tryUnmanage, tryUnmanage

    Methods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessReferent

    dropReference, tryRetainReference

    Methods inherited from class io.deephaven.util.referencecounting.ReferenceCounted

    append, decrementReferenceCount, forceReferenceCountToZero, getReferenceCountDebug, incrementReferenceCount, resetReferenceCount, toString, tryDecrementReferenceCount, tryIncrementReferenceCount

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface io.deephaven.engine.liveness.LivenessManager

    manage, unmanage, unmanage

    Methods inherited from interface io.deephaven.engine.liveness.LivenessReferent

    dropReference, getReferentDescription, retainReference, tryRetainReference
  • Method Details

    • isNonExport

      public boolean isNonExport()
      Returns:
      if this export is a session-less non-export
    • get

      public T get()
      WARNING! This method call is only safe to use in the following patterns:

      1) If an export (or non-export) SessionState.ExportBuilder.require(io.deephaven.server.session.SessionState.ExportObject<?>...)'d this export then the method is valid from within the Callable/Runnable passed to SessionState.ExportBuilder.submit(java.util.concurrent.Callable<T>).

      2) By first obtaining a reference to the SessionState.ExportObject, and then observing its state as ExportNotification.State.EXPORTED. The caller must abide by the Liveness API and dropReference.

      Example:

       
       <T> T getFromExport(ExportObject<T> export) {
           if (export.tryRetainReference()) {
               try {
                   if (export.getState() == ExportNotification.State.EXPORTED) {
                       return export.get();
                   }
               } finally {
                   export.dropReference();
               }
           }
           return null;
       }
       
       
      Returns:
      the result of the computed export
    • getState

      public io.deephaven.proto.backplane.grpc.ExportNotification.State getState()
      Returns:
      the current state of this export
    • getExportId

      public io.deephaven.proto.backplane.grpc.Ticket getExportId()
      Returns:
      the ticket for this export; note if this is a non-export the returned ticket will not resolve to anything and is considered an invalid ticket
    • getExportIdInt

      public int getExportIdInt()
      Returns:
      the export id for this export
    • release

      public void release()
      Releases this export; it will wait for the work to complete before releasing.
    • cancel

      public void cancel()
      Releases this export; it will cancel the work and dependent exports proactively when possible.
    • destroy

      @OverridingMethodsMustInvokeSuper protected void destroy()
      Overrides:
      destroy in class io.deephaven.engine.liveness.ReferenceCountedLivenessReferent