Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali Anwar committed May 18, 2015
1 parent c870e37 commit d531596
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ public MapReduceManager startMapReduce(final String programName) {

@Override
public MapReduceManager startMapReduce(final String programName, Map<String, String> arguments) {
return new DefaultMapReduceManager(startProgram(programName, arguments, ProgramType.MAPREDUCE), this);
Id.Program programId = startProgram(programName, arguments, ProgramType.MAPREDUCE);
return new DefaultMapReduceManager(programId, this);
}

@Override
Expand Down Expand Up @@ -105,8 +106,8 @@ private Id.Program startProgram(String programName, Map<String, String> argument
@Override
public WorkflowManager startWorkflow(final String workflowName, Map<String, String> arguments) {
// currently we are using it for schedule, so not starting the workflow
Id.Program workflowId = Id.Program.from(application, ProgramType.WORKFLOW, workflowName);
return new RemoteWorkflowManager(workflowId, clientConfig, this);
Id.Program programId = Id.Program.from(application, ProgramType.WORKFLOW, workflowName);
return new RemoteWorkflowManager(programId, clientConfig, this);
}

@Override
Expand All @@ -121,14 +122,14 @@ public ServiceManager startService(final String serviceName, Map<String, String>
}

@Override
public WorkerManager startWorker(final String workerName, Map<String, String> arguments) {
final Id.Program workerId = Id.Program.from(application, ProgramType.WORKER, workerName);
return new RemoteWorkerManager(workerId, clientConfig, this);
public WorkerManager startWorker(String workerName) {
return startWorker(workerName, ImmutableMap.<String, String>of());
}

@Override
public WorkerManager startWorker(String workerName) {
return startWorker(workerName, ImmutableMap.<String, String>of());
public WorkerManager startWorker(final String workerName, Map<String, String> arguments) {
final Id.Program programId = startProgram(workerName, arguments, ProgramType.WORKER);
return new RemoteWorkerManager(programId, clientConfig, this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public AbstractProgramManager(Id.Program programId, ApplicationManager applicati
this.applicationManager = applicationManager;
this.programId = programId;
}

@Override
public void stop() {
applicationManager.stopProgram(programId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import co.cask.cdap.proto.Id;

import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

/**
* Instance of this class is for managing deployed application.
Expand Down Expand Up @@ -139,16 +137,16 @@ public interface ApplicationManager {
/**
* Starts a worker.
* @param workerName name of the worker to be started
* @param arguments arguments to be passed to the worker
* @return {@link WorkerManager} to control the running worker
*/
WorkerManager startWorker(String workerName, Map<String, String> arguments);
WorkerManager startWorker(String workerName);

/**
* Starts a worker.
* @param workerName name of the worker to be started
* @param arguments arguments to be passed to the worker
* @return {@link WorkerManager} to control the running worker
*/
WorkerManager startWorker(String workerName);
WorkerManager startWorker(String workerName, Map<String, String> arguments);

}

0 comments on commit d531596

Please sign in to comment.