Package io.deephaven.engine.util
Class NoLanguageDeephavenSession
- All Implemented Interfaces:
LogOutputAppendable,LivenessManager,LivenessNode,LivenessReferent,ScriptSession,Serializable
public class NoLanguageDeephavenSession
extends AbstractScriptSession<AbstractScriptSession.Snapshot>
ScriptSession implementation that simply allows variables to be exported. This is not intended for use in user
scripts.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.deephaven.engine.util.AbstractScriptSession
AbstractScriptSession.ScriptSessionQueryScope, AbstractScriptSession.SnapshotNested classes/interfaces inherited from interface io.deephaven.engine.util.ScriptSession
ScriptSession.Changes, ScriptSession.Listener -
Field Summary
Fields inherited from class io.deephaven.engine.util.AbstractScriptSession
classCacheDirectory, executionContext -
Constructor Summary
ConstructorsConstructorDescriptionNoLanguageDeephavenSession(UpdateGraph updateGraph, OperationInitializer operationInitializer) NoLanguageDeephavenSession(UpdateGraph updateGraph, OperationInitializer operationInitializer, String scriptType) -
Method Summary
Modifier and TypeMethodDescriptionprotected ScriptSession.ChangescreateDiff(AbstractScriptSession.Snapshot from, AbstractScriptSession.Snapshot to, RuntimeException e) protected AbstractScriptSession.Snapshotprotected voidEvaluates command in the context of the current ScriptSession.getAllValues(@Nullable Function<Object, T> valueMapper, @NotNull QueryScope.ParamFilter<T> filter) Returns a mutable map with all known variables and their values.protected <T> TgetVariable(String name) Retrieve a variable from the script session's bindings.Retrieves all variable names present in the session's scope.protected booleanhasVariable(String name) Check if the scope has the given variable name.protected ObjectsetVariable(String name, @Nullable Object newValue) Inserts a value into the script's scope.protected AbstractScriptSession.SnapshotMethods inherited from class io.deephaven.engine.util.AbstractScriptSession
applyVariableChangeToDiff, cleanup, createScriptCache, destroy, evaluateScript, evaluateScript, getExecutionContext, getQueryScope, newClassCacheLocation, observeScopeChanges, publishInitialMethods inherited from class io.deephaven.engine.liveness.LivenessArtifact
manageWithCurrentScopeMethods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessNode
getWeakReference, initializeTransientFieldsForLiveness, onReferenceCountAtZero, tryManage, tryUnmanage, tryUnmanageMethods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
dropReference, tryRetainReferenceMethods inherited from class io.deephaven.util.referencecounting.ReferenceCounted
append, decrementReferenceCount, forceReferenceCountToZero, getReferenceCountDebug, incrementReferenceCount, resetReferenceCount, toString, tryDecrementReferenceCount, tryIncrementReferenceCountMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.deephaven.engine.liveness.LivenessManager
manage, tryManage, tryUnmanage, tryUnmanage, unmanage, unmanageMethods inherited from interface io.deephaven.engine.liveness.LivenessReferent
dropReference, getReferentDescription, getWeakReference, retainReference, tryRetainReferenceMethods inherited from interface io.deephaven.engine.util.ScriptSession
evaluateScript, sanitizeThrowable, unwrapObject
-
Constructor Details
-
NoLanguageDeephavenSession
public NoLanguageDeephavenSession(UpdateGraph updateGraph, OperationInitializer operationInitializer) -
NoLanguageDeephavenSession
public NoLanguageDeephavenSession(UpdateGraph updateGraph, OperationInitializer operationInitializer, String scriptType)
-
-
Method Details
-
getVariable
Description copied from class:AbstractScriptSessionRetrieve a variable from the script session's bindings. Values may need to be unwrapped.- Specified by:
getVariablein classAbstractScriptSession<AbstractScriptSession.Snapshot>- Parameters:
name- the name of the variable to retrieve- Returns:
- the variable value
-
emptySnapshot
- Specified by:
emptySnapshotin classAbstractScriptSession<AbstractScriptSession.Snapshot>
-
takeSnapshot
- Specified by:
takeSnapshotin classAbstractScriptSession<AbstractScriptSession.Snapshot>
-
createDiff
protected ScriptSession.Changes createDiff(AbstractScriptSession.Snapshot from, AbstractScriptSession.Snapshot to, RuntimeException e) - Specified by:
createDiffin classAbstractScriptSession<AbstractScriptSession.Snapshot>
-
evaluate
Description copied from class:AbstractScriptSessionEvaluates command in the context of the current ScriptSession.- Specified by:
evaluatein classAbstractScriptSession<AbstractScriptSession.Snapshot>- Parameters:
command- the command to evaluatescriptName- an optional script name, which may be ignored by the implementation, or used improve error messages or for other internal purposes
-
getVariableNames
Description copied from class:AbstractScriptSessionRetrieves all variable names present in the session's scope.- Specified by:
getVariableNamesin classAbstractScriptSession<AbstractScriptSession.Snapshot>- Returns:
- a caller-owned mutable set of variable names
-
hasVariable
Description copied from class:AbstractScriptSessionCheck if the scope has the given variable name.- Specified by:
hasVariablein classAbstractScriptSession<AbstractScriptSession.Snapshot>- Parameters:
name- the variable name- Returns:
- True iff the scope has the given variable name
-
setVariable
Description copied from class:AbstractScriptSessionInserts a value into the script's scope.- Specified by:
setVariablein classAbstractScriptSession<AbstractScriptSession.Snapshot>- Parameters:
name- the variable name to setnewValue- the new value of the variable- Returns:
- the old value for this name, if any. As with
AbstractScriptSession.getVariable(String), may need to be unwrapped.
-
getAllValues
protected <T> Map<String,T> getAllValues(@Nullable @Nullable Function<Object, T> valueMapper, @NotNull QueryScope.ParamFilter<T> filter) Description copied from class:AbstractScriptSessionReturns a mutable map with all known variables and their values.Callers may want to pass in a valueMapper of
ScriptSession.unwrapObject(Object)which would unwrap values before filtering. The returned map is owned by the caller.- Specified by:
getAllValuesin classAbstractScriptSession<AbstractScriptSession.Snapshot>- 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 mapped values. As with
AbstractScriptSession.getVariable(String), values may need to be unwrapped.
-
scriptType
- Returns:
- a textual description of this script session's language for use in messages.
-