public abstract class FlowNodeStorage extends Object implements org.jenkinsci.plugins.workflow.graph.FlowActionStorage
FlowNode
, for those FlowExecution
s
who want to store them within Jenkins.
A flow graph has a characteristic that it is additive.
Flow nodes may be stored in memory or directly persisted to disk at any given moment, but invoking flush()
should always guarantee that everything currently in memory is written.Constructor and Description |
---|
FlowNodeStorage() |
Modifier and Type | Method and Description |
---|---|
void |
autopersist(org.jenkinsci.plugins.workflow.graph.FlowNode n)
Flushes the node if needed, and if supported, marks it as needing to flush with EVERY write to the
FlowNode.actions . |
void |
flush()
Invoke this to insure any unwritten
FlowNode data is persisted to disk. |
void |
flushNode(org.jenkinsci.plugins.workflow.graph.FlowNode n)
Persists node fully to disk, ensuring it is written out to storage.
|
abstract org.jenkinsci.plugins.workflow.graph.FlowNode |
getNode(String id) |
boolean |
isAvoidAtomicWrite()
If true, we use non-atomic write of XML files for this storage.
|
boolean |
isPersistedFully()
Have we written everything to disk that we need to, or is there something waiting to be written by invoking
flush() ? |
void |
setAvoidAtomicWrite(boolean avoidAtomicWrite)
Set whether we should avoid using atomic write for node files (ensures valid node data if write is interrupted) or not.
|
abstract void |
storeNode(org.jenkinsci.plugins.workflow.graph.FlowNode n)
Registers node in this storage, potentially persisting to disk.
|
void |
storeNode(org.jenkinsci.plugins.workflow.graph.FlowNode n,
boolean delayWritingActions)
Register the given node to the storage, potentially flushing to disk,
and optionally marking the node as deferring writes.
|
public boolean isAvoidAtomicWrite()
AtomicFileWriter
.public void setAvoidAtomicWrite(boolean avoidAtomicWrite)
@CheckForNull public abstract org.jenkinsci.plugins.workflow.graph.FlowNode getNode(String id) throws IOException
IOException
public abstract void storeNode(@Nonnull org.jenkinsci.plugins.workflow.graph.FlowNode n) throws IOException
flushNode(FlowNode)
will guarantee it is persisted.IOException
public void storeNode(@Nonnull org.jenkinsci.plugins.workflow.graph.FlowNode n, boolean delayWritingActions) throws IOException
This should be invoked with delayWritingAction=true until you have a fully configured node to write out.
Generally autopersist(FlowNode)
should be automatically invoked before Step execution begins
unless the step is block-scoped (in which case the FlowNode will handle this).
n
- Node to storedelayWritingActions
- If true, node will avoid persisting actions except on explicit flush or when you call
autopersist(FlowNode)
.IOException
public void autopersist(@Nonnull org.jenkinsci.plugins.workflow.graph.FlowNode n) throws IOException
FlowNode.actions
.IOException
public void flushNode(@Nonnull org.jenkinsci.plugins.workflow.graph.FlowNode n) throws IOException
IOException
public void flush() throws IOException
FlowNode
data is persisted to disk.
Should be invoked by FlowExecution.notifyShutdown()
to ensure disk state is persisted.IOException
public boolean isPersistedFully()
flush()
?Copyright © 2016–2018. All rights reserved.