Review Board 1.7.22


OOZIE-636: Validate fork-join

Review Request #3486 - Created Jan. 13, 2012 and submitted

Virag Kothari
trunk
OOZIE-636
Reviewers
oozie
angelo, kamrul
oozie
Validate fork and join at wf submission time
https://issues.apache.org/jira/browse/OOZIE-636

Brief description of algo:

A modified dfs algorithm is used. Two stacks, one for dfs traversal and other for maintaining fork join status, are kept.  When a fork is encountered during traversal, it is added to the forkjoin stack and number of paths associated with the fork is also stored.  When a node’s child is seen as a join, the join is added to the forkJoin stack and the no. of paths to it is updated. When the number of paths for fork and join are equal, then the fork/join pair is removed from the forkJoin stack and join is pushed to the dfsStack.

Nodes other than fork and join are only pushed to the dfs stack.
If a action node is seen, only the node's "ok-to" transition is considered


While(!stack.isEmpty()){
	Node n = DfsStack.pop()
        n.traversed =  true;
		If(n.type==fork){
			ForkJoinStack.push(new Element(n, n.paths) );
		}
		List<Node> childs = getUnvisitedChildnodes(n)	
		For(Node n: childs){
			If (n.type==join){
			Boolean b=isForkJoinCleared(ForkJoinStack)	
			If(!b){
				Continue;
			}
			stack.push(n);
			n.traversed =  true;
		}				
}

Test case to validate fork-join added
Content-Type: text/html; charset=utf-8
trunk/core/src/main/java/org/apache/oozie/ErrorCode.java
Revision 1230856 New Change
Diff currently unavailable.
Error: The file '/repos/asf/oozie/trunk/core/src/main/java/org/apache/oozie/ErrorCode.java' (r1230856) could not be found in the repository: '/repos/asf/!svn/bc/1230856/oozie/trunk/core/src/main/java/org/apache/oozie/ErrorCode.java' path not found
Details
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.22-py2.7.egg/reviewboard/diffviewer/views.py", line 117, in view_diff
    request=request)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.22-py2.7.egg/reviewboard/diffviewer/diffutils.py", line 344, in populate_diff_chunks
    chunks = generator.get_chunks()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.22-py2.7.egg/reviewboard/diffviewer/chunk_generator.py", line 137, in get_chunks
    large_data=True)
  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.7.28-py2.7.egg/djblets/util/misc.py", line 157, in cache_memoize
    data = lookup_callable()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.22-py2.7.egg/reviewboard/diffviewer/chunk_generator.py", line 136, in <lambda>
    lambda: list(self._get_chunks_uncached()),
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.22-py2.7.egg/reviewboard/diffviewer/chunk_generator.py", line 141, in _get_chunks_uncached
    old = get_original_file(self.filediff, self.request)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.22-py2.7.egg/reviewboard/diffviewer/diffutils.py", line 126, in get_original_file
    request=request)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.22-py2.7.egg/reviewboard/scmtools/models.py", line 192, in get_file
    large_data=True)[0]
  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.7.28-py2.7.egg/djblets/util/misc.py", line 157, in cache_memoize
    data = lookup_callable()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.22-py2.7.egg/reviewboard/scmtools/models.py", line 191, in <lambda>
    request)],
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.22-py2.7.egg/reviewboard/scmtools/models.py", line 287, in _get_file_uncached
    data = self.get_scmtool().get_file(path, revision)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.22-py2.7.egg/reviewboard/scmtools/svn.py", line 191, in get_file
    return self._do_on_path(get_file_data, path, revision)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.22-py2.7.egg/reviewboard/scmtools/svn.py", line 165, in _do_on_path
    raise FileNotFoundError(path, revision, detail=str(e))
FileNotFoundError: The file '/repos/asf/oozie/trunk/core/src/main/java/org/apache/oozie/ErrorCode.java' (r1230856) could not be found in the repository: '/repos/asf/!svn/bc/1230856/oozie/trunk/core/src/main/java/org/apache/oozie/ErrorCode.java' path not found
trunk/core/src/main/java/org/apache/oozie/workflow/lite/ForkJoinElement.java
New File
 
trunk/core/src/main/java/org/apache/oozie/workflow/lite/LiteWorkflowApp.java
Revision 1230856 New Change
 
trunk/core/src/main/java/org/apache/oozie/workflow/lite/LiteWorkflowAppParser.java
Revision 1230856 New Change
 
trunk/core/src/test/java/org/apache/oozie/service/TestLiteWorkflowAppService.java
Revision 1230856 New Change
 
trunk/core/src/test/java/org/apache/oozie/workflow/lite/TestLiteWorkflowApp.java
New File
 
trunk/core/src/test/resources/wf-schema-valid.xml
Revision 1230856 New Change
 
  1. trunk/core/src/main/java/org/apache/oozie/ErrorCode.java: Loading...
  2. trunk/core/src/main/java/org/apache/oozie/workflow/lite/ForkJoinElement.java: Loading...
  3. trunk/core/src/main/java/org/apache/oozie/workflow/lite/LiteWorkflowApp.java: Loading...
  4. trunk/core/src/main/java/org/apache/oozie/workflow/lite/LiteWorkflowAppParser.java: Loading...
  5. trunk/core/src/test/java/org/apache/oozie/service/TestLiteWorkflowAppService.java: Loading...
  6. trunk/core/src/test/java/org/apache/oozie/workflow/lite/TestLiteWorkflowApp.java: Loading...
  7. trunk/core/src/test/resources/wf-schema-valid.xml: Loading...