/** * Implementation of {@link DatasetModule} announces dataset types and other components to the system. */ @Beta public interface DatasetModule { /** * Registers dataset types and other components in the system. * @param registry instance of {@link DatasetDefinitionRegistry} to be used for registering components */ void register(DatasetDefinitionRegistry registry); }
/** * Classes derived from {@link AbstractCustomAction} can override this method to initialize the {@link CustomAction}. * @throws Exception if there is any error in initializing the custom action */ @TransactionPolicy(TransactionControl.IMPLICIT) protected void initialize() throws Exception { // No-op by default }
@Plugin(type = PLUGIN_TYPE) @Name("NonTransactionalPlugin") @Description(PLUGIN_DESCRIPTION) @Requirements(datasetTypes = {"req1", "req2"}) public static class NonTransactionalPlugin { private PConfig pluginConf; public double doSomething() { return pluginConf.y; } } }
/** * plugin should fail deploy. */ @Plugin(type = "invalid") @Name("invalidParamType") @Description("This is a Plugin with invalid params for method") public class InvalidPluginMethodParamType { @Path("ping") public String callMe(String input, Long timestamp) { return "hello"; } }
@Plugin(type = PLUGIN_TYPE) @Name("SingleRequirementPlugin") @Description(PLUGIN_DESCRIPTION) @Requirements(datasetTypes = Table.TYPE) public static class SingleRequirementPlugin { private PConfig pluginConf; public double doSomething() { return pluginConf.y; } }
@Plugin(type = PLUGIN_TYPE) @Name(PLUGIN_NAME) @Description(PLUGIN_DESCRIPTION) public static class AppPlugin { private PConfig pluginConf; public double doSomething() { return pluginConf.y; } }
/** * Destroy is the last thing that gets called before the program is * shutdown. So, if there are any cleanups then they can be specified here. */ @TransactionPolicy(TransactionControl.IMPLICIT) void destroy(); }
@Plugin(type = PLUGIN_TYPE) @Name("DuplicateRequirementsPlugin") @Description(PLUGIN_DESCRIPTION) @Requirements(datasetTypes = {Table.TYPE, " DupliCate ", " duplicate "}) public static class DuplicateRequirementsPlugin { private PConfig pluginConf; public double doSomething() { return pluginConf.y; } }
/** * plugin doesn't actually do anything, just for tests */ @Plugin(type = "invalid") @Name("invalidParams") @Description("This is a Plugin with invalid params for method") public class InvalidPluginMethodParams { @Path("ping") public String callMe(String input, EndpointPluginContext context, Long timestamp) { return "hello"; } }
@Plugin(type = PLUGIN_TYPE) @Name(MULTIPLE_REQUIREMENTS_PLUGIN) @Description(PLUGIN_DESCRIPTION) @Requirements(datasetTypes = {Table.TYPE, KeyValueTable.TYPE}) public static class MultipleRequirementsPlugin { private PConfig pluginConf; public double doSomething() { return pluginConf.y; } }
@Plugin(type = PLUGIN_TYPE) @Name(PLUGIN_NAME) @Description(PLUGIN_DESCRIPTION) public static class AppPlugin { private PConfig pluginConf; public double doSomething() { return pluginConf.y; } } }
@Plugin(type = PLUGIN_TYPE) @Name("EmptyRequirementPlugin") @Description(PLUGIN_DESCRIPTION) @Requirements(datasetTypes = {}) public static class EmptyRequirementPlugin { private PConfig pluginConf; public double doSomething() { return pluginConf.y; } }
/** * plugin doesn't actually do anything, just for tests */ @Plugin(type = "dummy") @Name("Plugin1") @Description("This is plugin1") public class Plugin1 { private P1Config config; public static class P1Config extends PluginConfig { private int x; @Macro private String stuff; } }
@Plugin(type = PLUGIN_TYPE) @Name("SingleEmptyRequirementPlugin") @Description(PLUGIN_DESCRIPTION) @Requirements(datasetTypes = "") public static class SingleEmptyRequirementPlugin { private PConfig pluginConf; public double doSomething() { return pluginConf.y; } }
/** * plugin doesn't actually do anything, just for tests */ @Plugin(type = "interactive") @Name("CallingPlugin") @Description("This is plugin4") public class CallingPlugin { @Path("ping") public String callMe(String input, EndpointPluginContext pluginContext) throws Exception { Class<? extends Callable> plugin3 = pluginContext.loadPluginClass("interactive", "CallablePlugin", PluginProperties.builder().build()); return plugin3.newInstance().call() + " " + input; } }
@Plugin(type = PLUGIN_TYPE) @Name("ValidAndEmptyRequirementsPlugin") @Description(PLUGIN_DESCRIPTION) @Requirements(datasetTypes = {Table.TYPE, ""}) public static class ValidAndEmptyRequirementsPlugin { private PConfig pluginConf; public double doSomething() { return pluginConf.y; } }