Search in sources :

Example 1 with PropertyFieldExtractor

use of io.cdap.cdap.internal.specification.PropertyFieldExtractor 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(io.cdap.cdap.internal.workflow.condition.DefaultConditionSpecification) PropertyFieldExtractor(io.cdap.cdap.internal.specification.PropertyFieldExtractor) DataSetFieldExtractor(io.cdap.cdap.internal.specification.DataSetFieldExtractor) HashSet(java.util.HashSet)

Example 2 with PropertyFieldExtractor

use of io.cdap.cdap.internal.specification.PropertyFieldExtractor 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, getPlugins());
}
Also used : MapReduceSpecification(io.cdap.cdap.api.mapreduce.MapReduceSpecification) PropertyFieldExtractor(io.cdap.cdap.internal.specification.PropertyFieldExtractor) DataSetFieldExtractor(io.cdap.cdap.internal.specification.DataSetFieldExtractor) HashSet(java.util.HashSet)

Example 3 with PropertyFieldExtractor

use of io.cdap.cdap.internal.specification.PropertyFieldExtractor 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(io.cdap.cdap.internal.specification.PropertyFieldExtractor) DataSetFieldExtractor(io.cdap.cdap.internal.specification.DataSetFieldExtractor) DefaultCustomActionSpecification(io.cdap.cdap.internal.customaction.DefaultCustomActionSpecification) HashSet(java.util.HashSet)

Example 4 with PropertyFieldExtractor

use of io.cdap.cdap.internal.specification.PropertyFieldExtractor 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(io.cdap.cdap.api.service.http.ServiceHttpEndpoint) ArrayList(java.util.ArrayList) DataSetFieldExtractor(io.cdap.cdap.internal.specification.DataSetFieldExtractor) PropertyFieldExtractor(io.cdap.cdap.internal.specification.PropertyFieldExtractor) HttpServiceHandlerSpecification(io.cdap.cdap.api.service.http.HttpServiceHandlerSpecification)

Example 5 with PropertyFieldExtractor

use of io.cdap.cdap.internal.specification.PropertyFieldExtractor 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(), getPlugins());
}
Also used : SparkSpecification(io.cdap.cdap.api.spark.SparkSpecification) PropertyFieldExtractor(io.cdap.cdap.internal.specification.PropertyFieldExtractor) DataSetFieldExtractor(io.cdap.cdap.internal.specification.DataSetFieldExtractor) HashSet(java.util.HashSet)

Aggregations

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