org.knime.core.node.workflow.virtual
Class ParallelizedChunkContentMaster

java.lang.Object
  extended by org.knime.core.node.workflow.virtual.ParallelizedChunkContentMaster
All Implemented Interfaces:
NodeStateChangeListener

public class ParallelizedChunkContentMaster
extends Object
implements NodeStateChangeListener

Represents all parallel chunks (@see{ParallelChunkContext}) together and also encapsulating metanode.

Author:
M. Berthold, University of Konstanz

Field Summary
(package private)  ParallelizedChunkContent[] m_chunks
          individual chunks
(package private)  LoopEndParallelizeNode m_endNode
          end node waiting for chunks
(package private)  WorkflowManager m_manager
          metanode container for all chunks
 
Constructor Summary
ParallelizedChunkContentMaster(WorkflowManager wfm, LoopEndParallelizeNode endNode, int chunkCount)
          Create new chunk object master - also knows Workflowmanager the chunks are located in.
 
Method Summary
 void addParallelChunk(int index, ParallelizedChunkContent pcc)
          Add a new chunk to the list.
 void cancelChunkExecution()
          Trigger cancelation of chunk execution
 void cleanupChunks()
          Clean up chunks (and containing WFM).
 void executeChunks()
          Start execution of all chunks.
 ParallelizedChunkContent getChunk(int i)
           
 int nrChunks()
           
 int nrExecutedChunks()
           
 int nrExecutingChunks()
           
 int nrFailedChunks()
           
 void stateChanged(NodeStateEvent state)
          Callback from node, indicating that the given node has changed its state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_chunks

ParallelizedChunkContent[] m_chunks
individual chunks


m_manager

WorkflowManager m_manager
metanode container for all chunks


m_endNode

LoopEndParallelizeNode m_endNode
end node waiting for chunks

Constructor Detail

ParallelizedChunkContentMaster

public ParallelizedChunkContentMaster(WorkflowManager wfm,
                                      LoopEndParallelizeNode endNode,
                                      int chunkCount)
Create new chunk object master - also knows Workflowmanager the chunks are located in.

Parameters:
wfm - the workflowmanager holding the chunks
endNode - corresponding end node of the loop
chunkCount - the number of chunks.
Method Detail

addParallelChunk

public void addParallelChunk(int index,
                             ParallelizedChunkContent pcc)
Add a new chunk to the list.

Parameters:
index - of chunk
pcc - content of chunk

nrChunks

public int nrChunks()
Returns:
number of chunks

getChunk

public ParallelizedChunkContent getChunk(int i)
Parameters:
i - index
Returns:
chunk of given index

executeChunks

public void executeChunks()
Start execution of all chunks.


nrExecutedChunks

public int nrExecutedChunks()
Returns:
number of executed chunks

nrExecutingChunks

public int nrExecutingChunks()
Returns:
number of executing chunks

nrFailedChunks

public int nrFailedChunks()
Returns:
number of failed (==IDLE) chunks

cancelChunkExecution

public void cancelChunkExecution()
Trigger cancelation of chunk execution


cleanupChunks

public void cleanupChunks()
Clean up chunks (and containing WFM).


stateChanged

public void stateChanged(NodeStateEvent state)
Callback from node, indicating that the given node has changed its state. Clients may observe the node in order to get the current state.

Specified by:
stateChanged in interface NodeStateChangeListener
Parameters:
state - Indicates the change of this node.


Copyright, 2003 - 2012. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.