Search in sources :

Example 1 with DataSetFieldExtractor

use of co.cask.cdap.internal.specification.DataSetFieldExtractor in project cdap by caskdata.

the class DefaultCustomActionConfigurer method createSpecification.

private DefaultCustomActionSpecification createSpecification() {
    Set<String> datasets = new HashSet<>();
    Reflections.visit(customAction, customAction.getClass(), new PropertyFieldExtractor(properties), new DataSetFieldExtractor(datasets));
    return new DefaultCustomActionSpecification(customAction.getClass().getName(), name, description, properties, datasets);
}
Also used : PropertyFieldExtractor(co.cask.cdap.internal.specification.PropertyFieldExtractor) DataSetFieldExtractor(co.cask.cdap.internal.specification.DataSetFieldExtractor) DefaultCustomActionSpecification(co.cask.cdap.internal.customaction.DefaultCustomActionSpecification) HashSet(java.util.HashSet)

Example 2 with DataSetFieldExtractor

use of co.cask.cdap.internal.specification.DataSetFieldExtractor in project cdap by caskdata.

the class DefaultHttpServiceHandlerConfigurer method createSpecification.

/**
 * Creates a {@link HttpServiceHandlerSpecification} from the parameters stored in this class.
 *
 * @return a new specification from the parameters stored in this instance
 */
public HttpServiceHandlerSpecification createSpecification() {
    List<ServiceHttpEndpoint> endpoints = new ArrayList<>();
    // Inspect the handler to grab all @UseDataset, @Property and endpoints.
    Reflections.visit(handler, handler.getClass(), new DataSetFieldExtractor(datasets), new PropertyFieldExtractor(properties), new ServiceEndpointExtractor(endpoints));
    return new HttpServiceHandlerSpecification(handler.getClass().getName(), name, "", properties, datasets, endpoints);
}
Also used : ServiceHttpEndpoint(co.cask.cdap.api.service.http.ServiceHttpEndpoint) ArrayList(java.util.ArrayList) DataSetFieldExtractor(co.cask.cdap.internal.specification.DataSetFieldExtractor) PropertyFieldExtractor(co.cask.cdap.internal.specification.PropertyFieldExtractor) HttpServiceHandlerSpecification(co.cask.cdap.api.service.http.HttpServiceHandlerSpecification)

Example 3 with DataSetFieldExtractor

use of co.cask.cdap.internal.specification.DataSetFieldExtractor in project cdap by caskdata.

the class DefaultSparkConfigurer method createSpecification.

public SparkSpecification createSpecification() {
    Set<String> datasets = new HashSet<>();
    // Grab all @Property and @Dataset fields
    Reflections.visit(spark, spark.getClass(), new PropertyFieldExtractor(properties), new DataSetFieldExtractor(datasets));
    return new SparkSpecification(spark.getClass().getName(), name, description, mainClassName, datasets, properties, clientResources, driverResources, executorResources, getHandlers());
}
Also used : SparkSpecification(co.cask.cdap.api.spark.SparkSpecification) PropertyFieldExtractor(co.cask.cdap.internal.specification.PropertyFieldExtractor) DataSetFieldExtractor(co.cask.cdap.internal.specification.DataSetFieldExtractor) HashSet(java.util.HashSet)

Example 4 with DataSetFieldExtractor

use of co.cask.cdap.internal.specification.DataSetFieldExtractor in project cdap by caskdata.

the class DefaultMapReduceConfigurer method createSpecification.

public MapReduceSpecification createSpecification() {
    Set<String> datasets = new HashSet<>();
    Reflections.visit(mapReduce, mapReduce.getClass(), new PropertyFieldExtractor(properties), new DataSetFieldExtractor(datasets));
    return new MapReduceSpecification(mapReduce.getClass().getName(), name, description, inputDataset, outputDataset, datasets, properties, driverResources, mapperResources, reducerResources);
}
Also used : MapReduceSpecification(co.cask.cdap.api.mapreduce.MapReduceSpecification) PropertyFieldExtractor(co.cask.cdap.internal.specification.PropertyFieldExtractor) DataSetFieldExtractor(co.cask.cdap.internal.specification.DataSetFieldExtractor) HashSet(java.util.HashSet)

Example 5 with DataSetFieldExtractor

use of co.cask.cdap.internal.specification.DataSetFieldExtractor in project cdap by caskdata.

the class DefaultConditionConfigurer method createSpecification.

private DefaultConditionSpecification createSpecification() {
    Set<String> datasets = new HashSet<>();
    Reflections.visit(condition, condition.getClass(), new PropertyFieldExtractor(properties), new DataSetFieldExtractor(datasets));
    return new DefaultConditionSpecification(condition.getClass().getName(), name, description, properties, datasets);
}
Also used : DefaultConditionSpecification(co.cask.cdap.internal.workflow.condition.DefaultConditionSpecification) PropertyFieldExtractor(co.cask.cdap.internal.specification.PropertyFieldExtractor) DataSetFieldExtractor(co.cask.cdap.internal.specification.DataSetFieldExtractor) HashSet(java.util.HashSet)

Aggregations

DataSetFieldExtractor (co.cask.cdap.internal.specification.DataSetFieldExtractor)5 PropertyFieldExtractor (co.cask.cdap.internal.specification.PropertyFieldExtractor)5 HashSet (java.util.HashSet)4 MapReduceSpecification (co.cask.cdap.api.mapreduce.MapReduceSpecification)1 HttpServiceHandlerSpecification (co.cask.cdap.api.service.http.HttpServiceHandlerSpecification)1 ServiceHttpEndpoint (co.cask.cdap.api.service.http.ServiceHttpEndpoint)1 SparkSpecification (co.cask.cdap.api.spark.SparkSpecification)1 DefaultCustomActionSpecification (co.cask.cdap.internal.customaction.DefaultCustomActionSpecification)1 DefaultConditionSpecification (co.cask.cdap.internal.workflow.condition.DefaultConditionSpecification)1 ArrayList (java.util.ArrayList)1