T
- Config
config class that represents the configuration of the Application.public abstract class AbstractApplication<T extends Config> extends AbstractPluginConfigurable<ApplicationConfigurer> implements Application<T>
Applications
which reduces repetition and results in
a more readable configuration.
Implement the configure()
method to define your application.
io.cdap.cdap.api.app
Constructor and Description |
---|
AbstractApplication() |
Modifier and Type | Method and Description |
---|---|
protected void |
addMapReduce(MapReduce mapReduce) |
protected void |
addService(Service service) |
protected void |
addService(String name,
HttpServiceHandler handler,
HttpServiceHandler... handlers)
Adds a
Service that consists of the given HttpServiceHandler . |
protected void |
addSpark(Spark spark) |
protected void |
addWorker(Worker worker) |
protected void |
addWorkflow(Workflow workflow) |
protected ScheduleBuilder |
buildSchedule(String scheduleName,
ProgramType programType,
String programName)
Get a ScheduleBuilder for the specified program.
|
abstract void |
configure()
Override this method to declare and configure the application.
|
void |
configure(ApplicationConfigurer configurer,
ApplicationContext<T> context)
Configures the Application.
|
protected T |
getConfig()
Get the configuration object.
|
protected ApplicationConfigurer |
getConfigurer() |
protected ApplicationContext<T> |
getContext() |
protected TriggerFactory |
getTriggerFactory()
Get a TriggerFactory to get triggers.
|
protected void |
schedule(ScheduleCreationSpec scheduleCreationSpec)
Schedules a program, using the given scheduleCreationSpec.
|
protected void |
setDescription(String description) |
protected void |
setName(String name) |
usePlugin, usePlugin, usePluginClass, usePluginClass
addDatasetModule, addDatasetType, createDataset, createDataset, createDataset, createDataset
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isUpdateSupported, updateConfig
public abstract void configure()
public final void configure(ApplicationConfigurer configurer, ApplicationContext<T> context)
Application
configure
in interface Application<T extends Config>
configurer
- Collects the Application configurationcontext
- Used to access the environment, application configuration, and application (deployment) argumentsprotected ApplicationConfigurer getConfigurer()
getConfigurer
in class AbstractPluginConfigurable<ApplicationConfigurer>
ApplicationConfigurer
used to configure the Application
protected final ApplicationContext<T> getContext()
ApplicationContext
of the Application
protected T getConfig()
protected void setName(String name)
ApplicationConfigurer.setName(String)
protected void setDescription(String description)
protected void addMapReduce(MapReduce mapReduce)
protected void addSpark(Spark spark)
ApplicationConfigurer.addSpark(Spark)
protected void addWorkflow(Workflow workflow)
protected void addService(Service service)
protected void addWorker(Worker worker)
ApplicationConfigurer.addWorker(Worker)
protected void addService(String name, HttpServiceHandler handler, HttpServiceHandler... handlers)
Service
that consists of the given HttpServiceHandler
.name
- Name of the Servicehandler
- handler for the Servicehandlers
- more handlers for the Serviceprotected ScheduleBuilder buildSchedule(String scheduleName, ProgramType programType, String programName)
scheduleName
- the name of the scheduleprogramType
- the type of the program; currently, only ProgramType.WORKFLOW can be scheduledprogramName
- the name of the programScheduleBuilder
used to build the scheduleprotected void schedule(ScheduleCreationSpec scheduleCreationSpec)
scheduleCreationSpec
- defines the schedule.protected TriggerFactory getTriggerFactory()
TriggerFactory
used to get triggersCopyright © 2021 Cask Data, Inc. Licensed under the Apache License, Version 2.0.