use of io.cdap.cdap.api.plugin.PluginPropertyField in project cdap by caskdata.
the class FieldCountReducibleAggregator method getPluginClass.
private static PluginClass getPluginClass() {
Map<String, PluginPropertyField> properties = new HashMap<>();
properties.put("fieldName", new PluginPropertyField("fieldName", "", "string", true, true));
properties.put("fieldType", new PluginPropertyField("fieldType", "", "string", true, true));
return PluginClass.builder().setName(NAME).setType(BatchReducibleAggregator.PLUGIN_TYPE).setDescription("").setClassName(FieldCountReducibleAggregator.class.getName()).setProperties(properties).setConfigFieldName("config").build();
}
use of io.cdap.cdap.api.plugin.PluginPropertyField in project cdap by caskdata.
the class MockAutoJoiner method getPluginClass.
private static PluginClass getPluginClass() {
Map<String, PluginPropertyField> properties = new HashMap<>();
properties.put(Conf.STAGES, new PluginPropertyField(Conf.STAGES, "", "string", true, true));
properties.put(Conf.REQUIRED, new PluginPropertyField(Conf.REQUIRED, "", "string", false, true));
properties.put(Conf.KEY, new PluginPropertyField(Conf.KEY, "", "string", false, true));
properties.put(Conf.NULL_SAFE, new PluginPropertyField(Conf.NULL_SAFE, "", "boolean", false, false));
properties.put(Conf.BROADCAST, new PluginPropertyField(Conf.BROADCAST, "", "string", false, false));
properties.put(Conf.SELECT, new PluginPropertyField(Conf.SELECT, "", "string", false, true));
properties.put(Conf.SCHEMA, new PluginPropertyField(Conf.SCHEMA, "", "string", false, true));
properties.put(Conf.DISTRIBUTION_SIZE, new PluginPropertyField(Conf.DISTRIBUTION_SIZE, "", "integer", false, false));
properties.put(Conf.DISTRIBUTION_NAME, new PluginPropertyField(Conf.DISTRIBUTION_NAME, "", "string", false, false));
properties.put(Conf.CONDITION_EXPR, new PluginPropertyField(Conf.CONDITION_EXPR, "", "string", false, false));
return PluginClass.builder().setName(NAME).setType(BatchJoiner.PLUGIN_TYPE).setDescription("").setClassName(MockAutoJoiner.class.getName()).setProperties(properties).setConfigFieldName("conf").build();
}
use of io.cdap.cdap.api.plugin.PluginPropertyField 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(PluginClass.builder().setName("name").setType("type").setDescription("desc").setClassName("classname").setProperties(ImmutableMap.of("x", new PluginPropertyField("x", "some field", "int", true, false), "y", new PluginPropertyField("y", "some other field", "string", false, false))).build()), 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 io.cdap.cdap.api.plugin.PluginPropertyField in project cdap by cdapio.
the class MockSQLEngineWithStageSettings method getPluginClass.
private static PluginClass getPluginClass() {
Map<String, PluginPropertyField> properties = new HashMap<>();
properties.put("name", new PluginPropertyField("name", "", "string", true, false));
properties.put("inputDirName", new PluginPropertyField("inputDirName", "", "string", true, false));
properties.put("outputDirName", new PluginPropertyField("outputDirName", "", "string", true, false));
properties.put("outputSchema", new PluginPropertyField("outputSchema", "", "string", true, false));
properties.put("includedStages", new PluginPropertyField("includedStages", "", "string", true, false));
properties.put("excludedStages", new PluginPropertyField("excludedStages", "", "string", true, false));
return new PluginClass(BatchSQLEngine.PLUGIN_TYPE, NAME, "", MockSQLEngineWithStageSettings.class.getName(), "config", properties);
}
use of io.cdap.cdap.api.plugin.PluginPropertyField in project cdap by cdapio.
the class MockSink method getPluginClass.
private static PluginClass getPluginClass() {
Map<String, PluginPropertyField> properties = new HashMap<>();
properties.put("tableName", new PluginPropertyField("tableName", "", "string", true, true));
properties.put("connectionConfig", new PluginPropertyField("connectionConfig", "", "connectionconfig", true, true, false, Collections.singleton("tableName")));
return PluginClass.builder().setName(NAME).setType(BatchSink.PLUGIN_TYPE).setDescription("").setClassName(MockSink.class.getName()).setProperties(properties).setConfigFieldName("config").build();
}
Aggregations