Skip to content

Commit

Permalink
Addressing review comments [javadoc, simplfying the map iteration]
Browse files Browse the repository at this point in the history
  • Loading branch information
anuchandy committed Jun 22, 2016
1 parent 7a6f3a8 commit 18ef366
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected CreatableImpl(String name, InnerModelT innerObject) {
}

/**
* add a creatable resource dependency for this resource.
* Add a creatable resource dependency for this resource.
*
* @param creatableResource the creatable dependency.
*/
Expand All @@ -58,6 +58,7 @@ protected Resource createdResource(String key) {

/**
* Default implementation of create().
*
* @return the created resource
* @throws Exception when anything goes wrong
*/
Expand Down Expand Up @@ -116,7 +117,7 @@ public ServiceCall createAsync(ServiceCallback<FluentModelT> callback) {
protected abstract void createResource() throws Exception;

/**
* Creates this resource. asynchronously
* Creates this resource asynchronously.
*
* @throws Exception when anything goes wrong
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public CreatableTaskGroup(String key, CreatableTaskItem rootTask, RootResourceCr
/**
* Gets a resource created by a creatable task in this group.
* <p>
* this method can null if the resource has not yet created that happens if the responsible task is not
* yet selected for execution or it's it progress
* This method can return null if the resource has not yet created that happens if the responsible task
* is not yet selected for execution or it's it progress
*
* @param key the resource id
* @return the created resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ List<String> dependentKeys() {
}

/**
* mark the node identified by the given key as dependent of this node.
* Mark the node identified by the given key as dependent of this node.
*
* @param key the id of the dependent node
*/
Expand All @@ -56,7 +56,7 @@ public List<String> dependencyKeys() {
}

/**
* mark the node identified by the given key as this node's dependency.
* Mark the node identified by the given key as this node's dependency.
*
* @param dependencyKey the id of the dependency node
*/
Expand Down Expand Up @@ -88,7 +88,7 @@ public boolean isPreparer() {
}

/**
* initialize the node so that traversal can be performed on the parent DAG.
* Initialize the node so that traversal can be performed on the parent DAG.
*/
public void initialize() {
this.toBeResolved = this.dependencyKeys().size();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public boolean isPreparer() {
/**
* Merge this DAG with another DAG.
* <p>
* this will mark this DAG as a child DAG, the dependencies of nodes in this DAG will be merged
* This will mark this DAG as a child DAG, the dependencies of nodes in this DAG will be merged
* with (copied to) the parent DAG
*
* @param parent the parent DAG
Expand All @@ -86,11 +86,11 @@ public void merge(DAGraph<T, U> parent) {
*/
public void prepare() {
if (isPreparer()) {
for (Map.Entry<String, U> entry : graph.entrySet()) {
for (U node : graph.values()) {
// Prepare each node for traversal
entry.getValue().initialize();
node.initialize();
// Mark other sub-DAGs are non-preparer
entry.getValue().setPreparer(false);
node.setPreparer(false);
}
initializeDependentKeys();
initializeQueue();
Expand All @@ -101,7 +101,7 @@ public void prepare() {
* Gets next node in the DAG which has no dependency or all of it's dependencies are resolved and
* ready to be consumed.
* <p>
* null will be returned when all the nodes are explored
* Null will be returned when all the nodes are explored
*
* @return next node

This comment has been minimized.

Copy link
@martinsawicki

martinsawicki Jun 22, 2016

hmm,the "Null" explanation feels like it would belong in the @return section, no?
for example:
@return next node or null if all the nodes have been explored

*/
Expand Down Expand Up @@ -139,7 +139,7 @@ public void reportedCompleted(U completed) {
/**
* Initializes dependents of all nodes.
* <p>
* the DAG will be explored in DFS order and all node's dependents will be identified,
* The DAG will be explored in DFS order and all node's dependents will be identified,
* this prepares the DAG for traversal using getNext method, each call to getNext returns next node
* in the DAG with no dependencies.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* Type representing a directed graph data structure.
* <p>
* each node in a graph is represented by {@link Node}
* Each node in a graph is represented by {@link Node}
*
* @param <T> the type of the data stored in the graph's nodes
* @param <U> the type of the nodes in the graph
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ public T taskResult(String taskId) {
}

/**
* executes the root task in this group.
* Executes the root task in this group.
* <p>
* this method will be invoked when all the task dependencies of the root task are finished
* This method will be invoked when all the task dependencies of the root task are finished
* executing, at this point root task can be executed by consuming the result of tasks it
* depends on.
*
Expand All @@ -97,9 +97,9 @@ public T taskResult(String taskId) {
public abstract void executeRootTask(TaskItem<T> task) throws Exception;

/**
* executes the root task in this group asynchronously.
* Executes the root task in this group asynchronously.
* <p>
* this method will be invoked when all the task dependencies of the root task are finished
* This method will be invoked when all the task dependencies of the root task are finished
* executing, at this point root task can be executed by consuming the result of tasks it
* depends on.
*
Expand Down

0 comments on commit 18ef366

Please sign in to comment.