use of co.cask.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);
}
use of co.cask.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);
}
use of co.cask.cdap.internal.specification.PropertyFieldExtractor in project cdap by caskdata.
the class DefaultSparkConfigurer method createSpecification.
public SparkSpecification createSpecification() {
Preconditions.checkArgument(mainClassName != null, "Spark main class is not set. Make sure setMainClass or setMainClassName is called.");
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);
}
use of co.cask.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);
}
Aggregations