Class DbVariableState
java.lang.Object
io.camunda.zeebe.engine.state.variable.DbVariableState
- All Implemented Interfaces:
VariableState,MutableVariableState
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.zeebe.engine.state.immutable.VariableState
VariableState.Variable -
Field Summary
Fields inherited from interface io.camunda.zeebe.engine.state.immutable.VariableState
NO_PARENT -
Constructor Summary
ConstructorsConstructorDescriptionDbVariableState(ZeebeDb<ZbColumnFamilies> zeebeDb, TransactionContext transactionContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateScope(long childKey, long parentKey) longgetParentScopeKey(long childScopeKey) org.agrona.DirectBuffergetVariable(long scopeKey, org.agrona.DirectBuffer name) Find the variable with the given name.org.agrona.DirectBuffergetVariable(long scopeKey, org.agrona.DirectBuffer name, int nameOffset, int nameLength) Find the variable with the given name.getVariableInstanceLocal(long scopeKey, org.agrona.DirectBuffer name) org.agrona.DirectBuffergetVariableLocal(long scopeKey, org.agrona.DirectBuffer name) org.agrona.DirectBuffergetVariablesAsDocument(long scopeKey) org.agrona.DirectBuffergetVariablesAsDocument(long scopeKey, Collection<org.agrona.DirectBuffer> names) getVariablesLocal(long scopeKey) Returns a list of all variables at the given scope key.org.agrona.DirectBuffergetVariablesLocalAsDocument(long scopeKey) booleanisEmpty()voidremoveAllVariables(long scopeKey) voidremoveScope(long scopeKey) voidsetVariableLocal(long key, long scopeKey, long processDefinitionKey, org.agrona.DirectBuffer name, int nameOffset, int nameLength, org.agrona.DirectBuffer value, int valueOffset, int valueLength) Creates or updates the variable withnamewithin the given scope withscopeKey, setting its value to the givenvalue.voidsetVariableLocal(long key, long scopeKey, long processDefinitionKey, org.agrona.DirectBuffer name, org.agrona.DirectBuffer value) Creates or updates the variable withnamewithin the given scope withscopeKey, setting its value to the givenvalue.
-
Constructor Details
-
DbVariableState
-
-
Method Details
-
setVariableLocal
public void setVariableLocal(long key, long scopeKey, long processDefinitionKey, org.agrona.DirectBuffer name, org.agrona.DirectBuffer value) Description copied from interface:MutableVariableStateCreates or updates the variable withnamewithin the given scope withscopeKey, setting its value to the givenvalue.This method is expected to be called directly ONLY from an
EventApplieror from tests.- Specified by:
setVariableLocalin interfaceMutableVariableState- Parameters:
key- the variable keyscopeKey- the local scope of the variableprocessDefinitionKey- the associated process key, mostly for monitoring purposesname- the name of the variablevalue- the value of the variable (MsgPack encoded)
-
setVariableLocal
public void setVariableLocal(long key, long scopeKey, long processDefinitionKey, org.agrona.DirectBuffer name, int nameOffset, int nameLength, org.agrona.DirectBuffer value, int valueOffset, int valueLength) Description copied from interface:MutableVariableStateCreates or updates the variable withnamewithin the given scope withscopeKey, setting its value to the givenvalue.This method is expected to be called directly ONLY from an
EventApplieror from tests.- Specified by:
setVariableLocalin interfaceMutableVariableState- Parameters:
key- the variable keyscopeKey- the local scope of the variableprocessDefinitionKey- the associated process key, mostly for monitoring purposesname- the name of the variablenameOffset- offset at which the name starts in thenamebuffernameLength- length of the variable name in thenamebuffervalue- the value of the variable (MsgPack encoded)valueOffset- offset at which the value starts in thevaluebuffervalueLength- length of the variable value in thevaluebuffer
-
createScope
public void createScope(long childKey, long parentKey) - Specified by:
createScopein interfaceMutableVariableState
-
removeScope
public void removeScope(long scopeKey) - Specified by:
removeScopein interfaceMutableVariableState
-
removeAllVariables
public void removeAllVariables(long scopeKey) - Specified by:
removeAllVariablesin interfaceMutableVariableState
-
getVariableLocal
public org.agrona.DirectBuffer getVariableLocal(long scopeKey, org.agrona.DirectBuffer name) - Specified by:
getVariableLocalin interfaceVariableState
-
getVariable
public org.agrona.DirectBuffer getVariable(long scopeKey, org.agrona.DirectBuffer name) Find the variable with the given name. If the variable is not present in the given scope then it looks in the parent scope and continues until it is found.- Specified by:
getVariablein interfaceVariableState- Parameters:
scopeKey- the key of the variable scope to start fromname- the name of the variable- Returns:
- the value of the variable, or
nullif it is not present in the variable scope
-
getVariable
public org.agrona.DirectBuffer getVariable(long scopeKey, org.agrona.DirectBuffer name, int nameOffset, int nameLength) Find the variable with the given name. If the variable is not present in the given scope then it looks in the parent scope and continues until it is found.- Specified by:
getVariablein interfaceVariableState- Parameters:
scopeKey- the key of the variable scope to start fromname- the buffer that contains the name of the variablenameOffset- the offset of name in the buffernameLength- the length of the name in the buffer- Returns:
- the value of the variable, or
nullif it is not present in the variable scope
-
getVariablesAsDocument
public org.agrona.DirectBuffer getVariablesAsDocument(long scopeKey) - Specified by:
getVariablesAsDocumentin interfaceVariableState
-
getVariablesAsDocument
public org.agrona.DirectBuffer getVariablesAsDocument(long scopeKey, Collection<org.agrona.DirectBuffer> names) - Specified by:
getVariablesAsDocumentin interfaceVariableState
-
getVariablesLocalAsDocument
public org.agrona.DirectBuffer getVariablesLocalAsDocument(long scopeKey) - Specified by:
getVariablesLocalAsDocumentin interfaceVariableState
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceVariableState
-
getVariablesLocal
Description copied from interface:VariableStateReturns a list of all variables at the given scope key.This method differs from most other methods on this interface in that it does not traverse the scope hierarchy. It only returns variables that are directly stored at the given scope key.
- Specified by:
getVariablesLocalin interfaceVariableState- Parameters:
scopeKey- the scope key to get the variables for- Returns:
- a list of all variables at the given scope key
-
getVariableInstanceLocal
- Specified by:
getVariableInstanceLocalin interfaceVariableState
-
getParentScopeKey
public long getParentScopeKey(long childScopeKey) - Specified by:
getParentScopeKeyin interfaceVariableState- Returns:
- returns the parent scope key of the given
childScopeKey, orVariableState.NO_PARENT
-