Package io.deephaven.engine.context
Class PoisonedQueryScope
java.lang.Object
io.deephaven.engine.context.PoisonedQueryScope
- All Implemented Interfaces:
LogOutputAppendable,QueryScope,LivenessManager,LivenessNode,LivenessReferent
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.engine.context.QueryScope
QueryScope.MissingVariableException, QueryScope.ParamFilter<T> -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescription<T> QueryScopeParam<T>createParam(String name) Get a QueryScopeParam by name.voidDrop a previously-retained reference to this referent.Get all known scope variable names.WeakReference<? extends LivenessReferent>Get aWeakReferenceto this referent.booleanhasParamName(String name) Check if the scope has the given name.<T> voidAdd a parameter to the scope.<T> TreadParamValue(String name) Get the value of a given scope parameter by name.<T> TreadParamValue(String name, T defaultValue) Get the value of a given scope parameter by name.toMap(@NotNull QueryScope.ParamFilter<Object> filter) Returns a mutable map with all objects in the scope.toMap(@NotNull Function<Object, T> valueMapper, @NotNull QueryScope.ParamFilter<T> filter) Returns a mutable map with all objects in the scope.booleantryManage(@NotNull LivenessReferent referent) Attempt to addreferentto this manager.booleanIf this referent is "live", behave asLivenessReferent.retainReference()and return true.booleantryUnmanage(@NotNull LivenessReferent referent) If this manager manages referent one or more times, drop one such reference.booleantryUnmanage(@NotNull Stream<? extends LivenessReferent> referents) For each referent in referents, if this manager manages referent one or more times, drop one such reference.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.deephaven.engine.liveness.LivenessManager
manage, unmanage, unmanageMethods inherited from interface io.deephaven.engine.liveness.LivenessReferent
getReferentDescription, retainReferenceMethods inherited from interface io.deephaven.engine.context.QueryScope
append, getParams, unwrapObject
-
Field Details
-
INSTANCE
-
-
Method Details
-
getParamNames
Description copied from interface:QueryScopeGet all known scope variable names.- Specified by:
getParamNamesin interfaceQueryScope- Returns:
- A caller-owned mutable collection of scope variable names.
-
hasParamName
Description copied from interface:QueryScopeCheck if the scope has the given name.- Specified by:
hasParamNamein interfaceQueryScope- Parameters:
name- param name- Returns:
- True iff the scope has the given param name
-
createParam
Description copied from interface:QueryScopeGet a QueryScopeParam by name.- Specified by:
createParamin interfaceQueryScope- Parameters:
name- parameter name- Returns:
- newly-constructed QueryScopeParam (name + value-snapshot pair).
- Throws:
QueryScope.MissingVariableException- If any of the named scope variables does not exist.
-
readParamValue
Description copied from interface:QueryScopeGet the value of a given scope parameter by name. Callers may want to unwrap language-specific values usingQueryScope.unwrapObject(Object)before using them.- Specified by:
readParamValuein interfaceQueryScope- Parameters:
name- parameter name.- Returns:
- parameter value.
- Throws:
QueryScope.MissingVariableException- If no such scope parameter exists.
-
readParamValue
Description copied from interface:QueryScopeGet the value of a given scope parameter by name. Callers may want to unwrap language-specific values usingQueryScope.unwrapObject(Object)before using them.- Specified by:
readParamValuein interfaceQueryScope- Parameters:
name- parameter name.defaultValue- default parameter value.- Returns:
- parameter value, or the default parameter value, if the value is not present.
-
putParam
Description copied from interface:QueryScopeAdd a parameter to the scope. Objects passed in will have their liveness managed by the scope.- Specified by:
putParamin interfaceQueryScope- Parameters:
name- parameter name.value- parameter value.
-
toMap
Description copied from interface:QueryScopeReturns a mutable map with all objects in the scope. Callers may want to unwrap language-specific values usingQueryScope.unwrapObject(Object)before using them. This returned map is owned by the caller.- Specified by:
toMapin interfaceQueryScope- Parameters:
filter- a predicate to filter the map entries- Returns:
- a caller-owned mutable map with all known variables and their values.
-
toMap
public <T> Map<String,T> toMap(@NotNull @NotNull Function<Object, T> valueMapper, @NotNull @NotNull QueryScope.ParamFilter<T> filter) Description copied from interface:QueryScopeReturns a mutable map with all objects in the scope.Callers may want to pass in a valueMapper of
QueryScope.unwrapObject(Object)which would unwrap values before filtering. The returned map is owned by the caller.- Specified by:
toMapin interfaceQueryScope- Type Parameters:
T- the type of the mapped values- Parameters:
valueMapper- a function to map the valuesfilter- a predicate to filter the map entries- Returns:
- a caller-owned mutable map with all known variables and their values.
-
tryManage
Description copied from interface:LivenessManagerAttempt to addreferentto this manager. Will succeed ifreferentis live and if this manager is not aLivenessReferentor is live.- Specified by:
tryManagein interfaceLivenessManager- Parameters:
referent- The referent to add- Returns:
- Whether the referent was in fact added
-
tryUnmanage
Description copied from interface:LivenessManagerIf this manager manages referent one or more times, drop one such reference. If this manager is also aLivenessReferent, then this method is a no-op ifthisis not live.Strongly prefer using
LivenessManager.tryUnmanage(Stream)} when multiple referents should be unmanaged.- Specified by:
tryUnmanagein interfaceLivenessManager- Parameters:
referent- The referent to drop- Returns:
- If this node is also a
LivenessReferent, whether this node was live and thus in fact tried to drop a reference. Else always returnstrueif dropping a reference via this method is supported by the implementation.
-
tryUnmanage
Description copied from interface:LivenessManagerFor each referent in referents, if this manager manages referent one or more times, drop one such reference. If this manager is also aLivenessReferent, then this method is a no-op ifthisis not live.- Specified by:
tryUnmanagein interfaceLivenessManager- Parameters:
referents- The referents to drop- Returns:
- If this node is also a
LivenessReferent, whether this node was live and thus in fact tried to drop the references. Else always returnstrueif dropping a reference via this method is supported by the implementation.
-
tryRetainReference
public boolean tryRetainReference()Description copied from interface:LivenessReferentIf this referent is "live", behave asLivenessReferent.retainReference()and return true. Otherwise, returns false rather than throwing an exception.- Specified by:
tryRetainReferencein interfaceLivenessReferent- Returns:
- True if this referent was retained, false otherwise
-
dropReference
public void dropReference()Description copied from interface:LivenessReferentDrop a previously-retained reference to this referent.- Specified by:
dropReferencein interfaceLivenessReferent
-
getWeakReference
Description copied from interface:LivenessReferentGet aWeakReferenceto this referent. This may be cached, or newly created.- Specified by:
getWeakReferencein interfaceLivenessReferent- Returns:
- A new or cached reference to this referent
-