use of co.cask.cdap.api.Resources in project cdap by caskdata.
the class WordCount method configure.
@Override
public void configure() {
setMapperResources(new Resources(1024));
setReducerResources(new Resources(1024));
}
use of co.cask.cdap.api.Resources in project cdap by caskdata.
the class ClicksAndViewsMapReduce method configure.
@Override
public void configure() {
setName(NAME);
setMapperResources(new Resources(1024));
setReducerResources(new Resources(1024));
}
use of co.cask.cdap.api.Resources in project cdap by caskdata.
the class PurchaseHistoryService method configure.
@Override
protected void configure() {
setName(SERVICE_NAME);
setDescription("A service to retrieve a customer's purchase history");
addHandler(new PurchaseHistoryServiceHandler());
setResources(new Resources(1024));
}
use of co.cask.cdap.api.Resources in project cdap by caskdata.
the class ServiceSpecificationCodec method serialize.
@Override
public JsonElement serialize(ServiceSpecification spec, Type typeOfSrc, JsonSerializationContext context) {
JsonObject object = new JsonObject();
object.addProperty("className", spec.getClassName());
object.addProperty("name", spec.getName());
object.addProperty("description", spec.getDescription());
object.add("handlers", serializeMap(spec.getHandlers(), context, HttpServiceHandlerSpecification.class));
object.add("resources", context.serialize(spec.getResources(), Resources.class));
object.addProperty("instances", spec.getInstances());
return object;
}
use of co.cask.cdap.api.Resources in project cdap by caskdata.
the class SparkWikipediaClustering method configure.
@Override
protected void configure() {
if ("lda".equals(appConfig.clusteringAlgorithm)) {
setDescription("A Spark program that analyzes wikipedia data using Latent Dirichlet Allocation (LDA).");
setMainClass(ScalaSparkLDA.class);
} else if ("kmeans".equals(appConfig.clusteringAlgorithm)) {
setDescription("A Spark program that analyzes wikipedia data using K-Means.");
setMainClass(ScalaSparkKMeans.class);
} else {
throw new IllegalArgumentException("Only 'lda' and 'kmeans' are supported as clustering algorithms. " + "Found " + appConfig.clusteringAlgorithm);
}
setName(NAME + "-" + appConfig.clusteringAlgorithm.toUpperCase());
setDriverResources(new Resources(1024));
setExecutorResources(new Resources(1024));
}
Aggregations