use of co.cask.cdap.api.plugin.PluginClass in project cdap by caskdata.
the class MockSink method getPluginClass.
private static PluginClass getPluginClass() {
Map<String, PluginPropertyField> properties = new HashMap<>();
properties.put("tableName", new PluginPropertyField("tableName", "", "string", true, true));
return new PluginClass(BatchSink.PLUGIN_TYPE, "Mock", "", MockSink.class.getName(), "config", properties);
}
use of co.cask.cdap.api.plugin.PluginClass in project cdap by caskdata.
the class ArtifactConfigReaderTest method testRead.
@Test
public void testRead() throws IOException, InvalidArtifactException {
ArtifactConfig validConfig = new ArtifactConfig(ImmutableSet.of(new ArtifactRange(NamespaceId.SYSTEM.getNamespace(), "a", new ArtifactVersion("1.0.0"), new ArtifactVersion("2.0.0")), new ArtifactRange(NamespaceId.DEFAULT.getNamespace(), "b", new ArtifactVersion("1.0.0"), new ArtifactVersion("2.0.0"))), ImmutableSet.of(new PluginClass("type", "name", "desc", "classname", null, ImmutableMap.of("x", new PluginPropertyField("x", "some field", "int", true, false), "y", new PluginPropertyField("y", "some other field", "string", false, false)))), ImmutableMap.of("k1", "v1", "k2", "v2"));
File configFile = new File(tmpFolder.newFolder(), "r1-1.0.0.json");
try (BufferedWriter writer = Files.newWriter(configFile, Charsets.UTF_8)) {
writer.write(validConfig.toString());
}
Assert.assertEquals(validConfig, configReader.read(Id.Namespace.DEFAULT, configFile));
}
use of co.cask.cdap.api.plugin.PluginClass in project cdap by caskdata.
the class MockJoiner method getPluginClass.
private static PluginClass getPluginClass() {
Map<String, PluginPropertyField> properties = new HashMap<>();
properties.put("joinKeys", new PluginPropertyField("joinKeys", "", "string", true, false));
properties.put("requiredInputs", new PluginPropertyField("requiredInputs", "", "string", true, false));
properties.put("selectedFields", new PluginPropertyField("selectedFields", "", "string", true, false));
return new PluginClass(BatchJoiner.PLUGIN_TYPE, "MockJoiner", "", MockJoiner.class.getName(), "config", properties);
}
use of co.cask.cdap.api.plugin.PluginClass in project cdap by caskdata.
the class FieldsPrefixTransform method getPluginClass.
private static PluginClass getPluginClass() {
Map<String, PluginPropertyField> properties = new HashMap<>();
properties.put("prefix", new PluginPropertyField("prefix", "", "string", true, false));
properties.put("schemaStr", new PluginPropertyField("schemaStr", "", "string", true, false));
return new PluginClass(Transform.PLUGIN_TYPE, "FieldsPrefixTransform", "", FieldsPrefixTransform.class.getName(), "config", properties);
}
use of co.cask.cdap.api.plugin.PluginClass in project cdap by caskdata.
the class FilterErrorTransform method getPluginClass.
private static PluginClass getPluginClass() {
Map<String, PluginPropertyField> properties = new HashMap<>();
properties.put("code", new PluginPropertyField("code", "", "int", true, false));
return new PluginClass(ErrorTransform.PLUGIN_TYPE, "Filter", "", FilterErrorTransform.class.getName(), "config", properties);
}
Aggregations