/** * Conf for the token writer. */ public static class Conf extends PluginConfig { @Description("The fileset to delete files from.") private String filesetName; @Description("Delete files that match this regex.") private String deleteRegex; } }
/** * Config for window plugin. */ public static class Conf extends PluginConfig { @Description("Width of the window in seconds. Must be a multiple of the pipeline's batch interval. " + "Each window generated will contain all the events from this many seconds.") long width; @Description("Sliding interval of the window in seconds. Must be a multiple of the pipeline's batch interval. " + "Every this number of seconds, a new window will be generated.") long slideInterval; } }
/** * ValidatorConfig whose list of validators and script can be configured */ public static class ValidatorConfig extends PluginConfig { @Description("Comma-separated list of validator plugins that are used in script") String validators; @Description(SCRIPT_DESCRIPTION) String validationScript; @Description("Lookup tables to use during transform. Currently supports KeyValueTable.") @Nullable String lookup; } }
/** * Base aggregator config, since almost all aggregators should support setting the number of partitions. */ public class AggregatorConfig extends PluginConfig { @Nullable @Description("Number of partitions to use when aggregating. If not specified, the execution framework " + "will decide how many to use.") protected Integer numPartitions; }
/** * Plugin Configuration */ public static class Conf extends AggregatorConfig { @Nullable @Description("Optional comma-separated list of fields to perform the distinct on. If none is given, each record " + "will be taken as is. Otherwise, only fields in this list will be considered.") private String fields; Iterable<String> getFields() { return fields == null ? Collections.emptyList() : Splitter.on(',').trimResults().split(fields); } }
/** * Config for TimePartitionedFileSetAvroSink */ public static class TPFSAvroSinkConfig extends TPFSSinkConfig { @Nullable @Description("Used to specify the compression codec to be used for the final dataset.") private String compressionCodec; public TPFSAvroSinkConfig(String name, @Nullable String basePath, @Nullable String pathFormat, @Nullable String timeZone, @Nullable String compressionCodec) { super(name, basePath, pathFormat, timeZone); this.compressionCodec = compressionCodec; } } }
public static class P2Config extends PluginConfig { @Description("value to return when called") private int v; } }
/** * Config for SnapshotFileBatchTextSink. */ public static class Conf extends SnapshotFileSetBatchSinkConfig { @Description("The Delimiter used to combine the Structured Record fields, Defaults to tab") @Nullable @Macro private String delimiter; public Conf() { this.delimiter = "\t"; } } }
/** * 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 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(PLUGIN_NAME) @Description(PLUGIN_DESCRIPTION) public static class AppPlugin { 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 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("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("DuplicateRequirementsPlugin") @Description(PLUGIN_DESCRIPTION) @Requirements(datasetTypes = {Table.TYPE, " DupliCate ", " duplicate "}) public static class DuplicateRequirementsPlugin { private PConfig pluginConf; public double doSomething() { return pluginConf.y; } }
@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(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("EmptyRequirementPlugin") @Description(PLUGIN_DESCRIPTION) @Requirements(datasetTypes = {}) public static class EmptyRequirementPlugin { private PConfig pluginConf; public double doSomething() { return pluginConf.y; } }
@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(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; } }