use of co.cask.cdap.api.plugin.PluginClass in project cdap by caskdata.
the class MockRuntimeDatasetSink method getPluginClass.
private static PluginClass getPluginClass() {
Map<String, PluginPropertyField> properties = new HashMap<>();
properties.put("tableName", new PluginPropertyField("tableName", "", "string", true, true));
properties.put("runtimeDatasetName", new PluginPropertyField("runtimeDatasetName", "", "string", true, true));
return new PluginClass(BatchSink.PLUGIN_TYPE, "MockRuntime", "", MockRuntimeDatasetSink.class.getName(), "config", properties);
}
use of co.cask.cdap.api.plugin.PluginClass in project cdap by caskdata.
the class NullAlertTransform method getPluginClass.
private static PluginClass getPluginClass() {
Map<String, PluginPropertyField> properties = new HashMap<>();
properties.put("field", new PluginPropertyField("field", "", "string", true, false));
return new PluginClass(Transform.PLUGIN_TYPE, NAME, "", NullAlertTransform.class.getName(), "conf", properties);
}
use of co.cask.cdap.api.plugin.PluginClass in project cdap by caskdata.
the class GroupFilterAggregator method getPluginClass.
private static PluginClass getPluginClass() {
Map<String, PluginPropertyField> properties = new HashMap<>();
properties.put("field", new PluginPropertyField("field", "", "string", true, false));
properties.put("value", new PluginPropertyField("value", "", "string", true, false));
return new PluginClass(BatchAggregator.PLUGIN_TYPE, "GroupFilter", "", GroupFilterAggregator.class.getName(), "config", properties);
}
use of co.cask.cdap.api.plugin.PluginClass in project cdap by caskdata.
the class DupeFlagger method getPluginClass.
private static PluginClass getPluginClass() {
Map<String, PluginPropertyField> properties = new HashMap<>();
properties.put("keep", new PluginPropertyField("keep", "input to keep", "string", true, false));
properties.put("flagField", new PluginPropertyField("flagField", "name of the flag field", "string", false, true));
return new PluginClass(BatchJoiner.PLUGIN_TYPE, DupeFlagger.NAME, "", DupeFlagger.class.getName(), "config", properties);
}
use of co.cask.cdap.api.plugin.PluginClass in project cdap by caskdata.
the class PluginClassDeserializer method deserialize.
@Override
public PluginClass deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
if (!json.isJsonObject()) {
throw new JsonParseException("PluginClass should be a JSON Object");
}
JsonObject jsonObj = json.getAsJsonObject();
String type = jsonObj.has("type") ? jsonObj.get("type").getAsString() : Plugin.DEFAULT_TYPE;
String name = getRequired(jsonObj, "name").getAsString();
String description = jsonObj.has("description") ? jsonObj.get("description").getAsString() : "";
String className = getRequired(jsonObj, "className").getAsString();
Set<String> endpointsSet = new HashSet<>();
if (jsonObj.has("endpoints")) {
endpointsSet = context.deserialize(jsonObj.get("endpoints"), ENDPOINTS_TYPE);
}
Map<String, PluginPropertyField> properties = jsonObj.has("properties") ? context.<Map<String, PluginPropertyField>>deserialize(jsonObj.get("properties"), PROPERTIES_TYPE) : ImmutableMap.<String, PluginPropertyField>of();
return new PluginClass(type, name, description, className, null, properties, endpointsSet);
}
Aggregations