co.cask.cdap.test.internal
Class DefaultApplicationManager

java.lang.Object
  extended by co.cask.cdap.test.internal.DefaultApplicationManager
All Implemented Interfaces:
ApplicationManager

public class DefaultApplicationManager
extends Object
implements ApplicationManager

A default implementation of ApplicationManager.


Constructor Summary
DefaultApplicationManager(org.apache.twill.filesystem.LocationFactory locationFactory, co.cask.cdap.data2.dataset2.DatasetFramework datasetFramework, co.cask.tephra.TransactionSystemClient txSystemClient, StreamWriterFactory streamWriterFactory, ProcedureClientFactory procedureClientFactory, co.cask.cdap.common.conf.CConfiguration configuration, org.apache.twill.discovery.DiscoveryServiceClient discoveryServiceClient, AppFabricHttpHandler httpHandler, ServiceHttpHandler serviceHttpHandler, org.junit.rules.TemporaryFolder tempFolder, String accountId, String applicationId, org.apache.twill.filesystem.Location deployedJar)
           
 
Method Summary
<T> DataSetManager<T>
getDataSet(String dataSetName)
          Gets an instance of DataSet of the given dataset name.
 StreamWriter getStreamWriter(String streamName)
          Gets a StreamWriter for writing data to the given stream.
 FlowManager startFlow(String flowName)
          Starts a flow.
 FlowManager startFlow(String flowName, Map<String,String> arguments)
          Starts a flow.
 MapReduceManager startMapReduce(String jobName)
          Starts a mapreduce job.
 MapReduceManager startMapReduce(String jobName, Map<String,String> arguments)
          Starts a mapreduce job.
 ProcedureManager startProcedure(String procedureName)
          Starts a procedure.
 ProcedureManager startProcedure(String procedureName, Map<String,String> arguments)
          Starts a procedure.
 ServiceManager startService(String serviceName)
          Starts a service.
 ServiceManager startService(String serviceName, Map<String,String> arguments)
          Starts a service.
 SparkManager startSpark(String jobName)
          Starts a Spark job.
 SparkManager startSpark(String jobName, Map<String,String> arguments)
          Starts a Spark job.
 WorkflowManager startWorkflow(String workflowName, Map<String,String> arguments)
          Starts a workflow.
 void stopAll()
          Stops all processors managed by this manager and clear all associated runtime metrics.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultApplicationManager

@Inject
public DefaultApplicationManager(org.apache.twill.filesystem.LocationFactory locationFactory,
                                        co.cask.cdap.data2.dataset2.DatasetFramework datasetFramework,
                                        co.cask.tephra.TransactionSystemClient txSystemClient,
                                        StreamWriterFactory streamWriterFactory,
                                        ProcedureClientFactory procedureClientFactory,
                                        co.cask.cdap.common.conf.CConfiguration configuration,
                                        org.apache.twill.discovery.DiscoveryServiceClient discoveryServiceClient,
                                        AppFabricHttpHandler httpHandler,
                                        ServiceHttpHandler serviceHttpHandler,
                                        org.junit.rules.TemporaryFolder tempFolder,
                                        String accountId,
                                        String applicationId,
                                        org.apache.twill.filesystem.Location deployedJar)
Method Detail

startFlow

public FlowManager startFlow(String flowName)
Description copied from interface: ApplicationManager
Starts a flow.

Specified by:
startFlow in interface ApplicationManager
Parameters:
flowName - Name of the flow to start.
Returns:
A FlowManager for controlling the started flow.

startFlow

public FlowManager startFlow(String flowName,
                             Map<String,String> arguments)
Description copied from interface: ApplicationManager
Starts a flow.

Specified by:
startFlow in interface ApplicationManager
Parameters:
flowName - Name of the flow to start.
arguments - Arguments to be passed while starting a flow.
Returns:
A FlowManager for controlling the started flow.

startMapReduce

public MapReduceManager startMapReduce(String jobName)
Description copied from interface: ApplicationManager
Starts a mapreduce job.

Specified by:
startMapReduce in interface ApplicationManager
Parameters:
jobName - Name of the mapreduce job to start.
Returns:
A MapReduceManager for controlling the started mapreduce job.

startMapReduce

public MapReduceManager startMapReduce(String jobName,
                                       Map<String,String> arguments)
Description copied from interface: ApplicationManager
Starts a mapreduce job.

Specified by:
startMapReduce in interface ApplicationManager
Parameters:
jobName - Name of the mapreduce job to start.
arguments - Arguments to be passed while starting a mapreduce.
Returns:
A MapReduceManager for controlling the started mapreduce job.

startSpark

public SparkManager startSpark(String jobName)
Description copied from interface: ApplicationManager
Starts a Spark job.

Specified by:
startSpark in interface ApplicationManager
Parameters:
jobName - Name of the spark job to start.
Returns:
A SparkManager for controlling the started spark job.

startSpark

public SparkManager startSpark(String jobName,
                               Map<String,String> arguments)
Description copied from interface: ApplicationManager
Starts a Spark job.

Specified by:
startSpark in interface ApplicationManager
Parameters:
jobName - Name of the spark job to start.
arguments - Arguments to be passed while starting a spark.
Returns:
A SparkManager for controlling the started spark job.

startProcedure

public ProcedureManager startProcedure(String procedureName)
Description copied from interface: ApplicationManager
Starts a procedure.

Specified by:
startProcedure in interface ApplicationManager
Parameters:
procedureName - Name of the procedure to start.
Returns:
A ProcedureManager for controlling the started procedure.

startProcedure

public ProcedureManager startProcedure(String procedureName,
                                       Map<String,String> arguments)
Description copied from interface: ApplicationManager
Starts a procedure.

Specified by:
startProcedure in interface ApplicationManager
Parameters:
procedureName - Name of the procedure to start.
arguments - Arguments to be passed while starting a procedure.
Returns:
A ProcedureManager for controlling the started procedure.

startWorkflow

public WorkflowManager startWorkflow(String workflowName,
                                     Map<String,String> arguments)
Description copied from interface: ApplicationManager
Starts a workflow.

Specified by:
startWorkflow in interface ApplicationManager
Returns:
WorkflowManager for controlling the started workflow.

startService

public ServiceManager startService(String serviceName)
Description copied from interface: ApplicationManager
Starts a service.

Specified by:
startService in interface ApplicationManager
Parameters:
serviceName - Name of the service to be started.
Returns:
ServiceManager to control the running service.

startService

public ServiceManager startService(String serviceName,
                                   Map<String,String> arguments)
Description copied from interface: ApplicationManager
Starts a service.

Specified by:
startService in interface ApplicationManager
Parameters:
serviceName - Name of the service to be started.
arguments - Arguments to be passed for the service.
Returns:
ServiceManager to control the running service.

getStreamWriter

public StreamWriter getStreamWriter(String streamName)
Description copied from interface: ApplicationManager
Gets a StreamWriter for writing data to the given stream.

Specified by:
getStreamWriter in interface ApplicationManager
Parameters:
streamName - Name of the stream to write to.
Returns:
A StreamWriter.

getDataSet

public <T> DataSetManager<T> getDataSet(String dataSetName)
Description copied from interface: ApplicationManager
Gets an instance of DataSet of the given dataset name. Operations on the returned DataSet always performed synchronously, i.e. no support for multi-operations transaction.

Specified by:
getDataSet in interface ApplicationManager
Type Parameters:
T - Type of the dataset.
Parameters:
dataSetName - Name of the dataset to retrieve.
Returns:
A DataSetManager instance.

stopAll

public void stopAll()
Description copied from interface: ApplicationManager
Stops all processors managed by this manager and clear all associated runtime metrics.

Specified by:
stopAll in interface ApplicationManager


Copyright © 2015 Cask Data, Inc. Licensed under the Apache License, Version 2.0.