本文整理汇总了Java中org.embulk.spi.FilterPlugin.Control方法的典型用法代码示例。如果您正苦于以下问题:Java FilterPlugin.Control方法的具体用法?Java FilterPlugin.Control怎么用?Java FilterPlugin.Control使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.embulk.spi.FilterPlugin
的用法示例。
在下文中一共展示了FilterPlugin.Control方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: transaction
import org.embulk.spi.FilterPlugin; //导入方法依赖的package包/类
@Override
public void transaction(ConfigSource config, Schema inputSchema, FilterPlugin.Control control)
{
PluginTask task = config.loadConfig(PluginTask.class);
String columnName = task.getQueryStringColumnName();
Schema.Builder builder = Schema.builder();
for (Column inputColumn : inputSchema.getColumns()) {
if (columnName.equals(inputColumn.getName())) {
insertColumns(builder, task.getExpandedColumns());
}
else {
builder.add(inputColumn.getName(), inputColumn.getType());
}
}
control.run(task.dump(), builder.build());
}
示例2: transaction
import org.embulk.spi.FilterPlugin; //导入方法依赖的package包/类
@Override
public void transaction(ConfigSource config, Schema inputSchema,
FilterPlugin.Control control)
{
PluginTask task = config.loadConfig(PluginTask.class);
String json_template = task.getJsonColumn().getTemplate();
BuildJsonConfigChecker checker = new BuildJsonConfigChecker(json_template,inputSchema);
checker.validateJSON();
Schema outputSchema = buildOutputSchema(task, inputSchema);
for (Column column : outputSchema.getColumns()) {
logger.debug("OutputSchema: {}", column);
}
control.run(task.dump(), outputSchema);
}
示例3: transaction
import org.embulk.spi.FilterPlugin; //导入方法依赖的package包/类
@Override
public void transaction(ConfigSource config, Schema inputSchema,
FilterPlugin.Control control)
{
// check if deprecated 'time_zone' option is used.
if (config.has("time_zone")) {
throw new ConfigException("'time_zone' option will be deprecated");
}
PluginTask task = config.loadConfig(PluginTask.class);
// check if a column specified as json_column_name option exists or not
Column jsonColumn = inputSchema.lookupColumn(task.getJsonColumnName());
if (jsonColumn.getType() != Types.STRING && jsonColumn.getType() != Types.JSON) {
// throws ConfigException if the column is not string or json type.
throw new ConfigException(String.format("A column specified as json_column_name option must be string or json type: %s",
new Object[] {jsonColumn.toString()}));
}
validateExpandedColumns(task.getExpandedColumns());
Schema outputSchema = buildOutputSchema(task, inputSchema);
validateOutputSchema(outputSchema);
control.run(task.dump(), outputSchema);
}
示例4: transaction
import org.embulk.spi.FilterPlugin; //导入方法依赖的package包/类
@Override
public void transaction(ConfigSource config, Schema inputSchema,
FilterPlugin.Control control)
{
PluginTask task = config.loadConfig(PluginTask.class);
try {
TableBuilder tableBuilder = new TableBuilder(
task.getFilePath(),
task.getFileFormat(),
task.getColumns(),
task.getCounterColumn().getName(),
task.getJoinedColumnPrefix());
task.setTable(tableBuilder.build());
}
catch (IOException e) {
logger.error(e.getMessage());
throw new RuntimeException(e);
}
Schema outputSchema = buildOutputSchema(inputSchema, task.getColumns(), task.getJoinedColumnPrefix());
logger.info("output schema: {}", outputSchema);
control.run(task.dump(), outputSchema);
}
示例5: transaction
import org.embulk.spi.FilterPlugin; //导入方法依赖的package包/类
@Override
public void transaction(ConfigSource config, Schema inputSchema,
FilterPlugin.Control control)
{
PluginTask task = config.loadConfig(PluginTask.class);
List<Column> distinctColumns = convertNameToColumn(inputSchema, task.getDistinctColumnNames());
task.setDistinctColumns(distinctColumns);
if (task.getDistinctColumns().isEmpty()) {
throw new ConfigException(
"inputSchema does not have any columns you configured.");
}
else {
logger.debug("distinct columns: {}", task.getDistinctColumns());
}
Schema outputSchema = inputSchema;
control.run(task.dump(), outputSchema);
}
示例6: transaction
import org.embulk.spi.FilterPlugin; //导入方法依赖的package包/类
@Override
public void transaction(ConfigSource config, Schema inputSchema,
FilterPlugin.Control control)
{
PluginTask task = config.loadConfig(PluginTask.class);
Schema outputSchema = buildOutputSchema(task, inputSchema);
control.run(task.dump(), outputSchema);
}
开发者ID:toyama0919,项目名称:embulk-filter-google_translate_api,代码行数:11,代码来源:GoogleTranslateApiFilterPlugin.java
示例7: transaction
import org.embulk.spi.FilterPlugin; //导入方法依赖的package包/类
@Override
public void transaction(ConfigSource config, Schema inputSchema,
FilterPlugin.Control control)
{
PluginTask task = config.loadConfig(PluginTask.class);
control.run(task.dump(), inputSchema);
}
示例8: transaction
import org.embulk.spi.FilterPlugin; //导入方法依赖的package包/类
@Override
public void transaction(final ConfigSource config, final Schema inputSchema,
final FilterPlugin.Control control)
{
PluginTask task = config.loadConfig(PluginTask.class);
configure(task, inputSchema);
Schema outputSchema = buildOuputSchema(task, inputSchema);
control.run(task.dump(), outputSchema);
}
示例9: transaction
import org.embulk.spi.FilterPlugin; //导入方法依赖的package包/类
@Override
public void transaction(ConfigSource config, Schema inputSchema,
FilterPlugin.Control control)
{
PluginTask task = config.loadConfig(PluginTask.class);
control.run(task.dump(), buildOutputSchema(task, inputSchema));
}
示例10: transaction
import org.embulk.spi.FilterPlugin; //导入方法依赖的package包/类
@Override
public void transaction(ConfigSource config, Schema inputSchema,
FilterPlugin.Control control)
{
PluginTask task = config.loadConfig(PluginTask.class);
Schema outputSchema = inputSchema;
control.run(task.dump(), outputSchema);
}
示例11: transaction
import org.embulk.spi.FilterPlugin; //导入方法依赖的package包/类
@Override
public void transaction(final ConfigSource config, final Schema inputSchema,
final FilterPlugin.Control control)
{
PluginTask task = config.loadConfig(PluginTask.class);
configure(task);
Schema outputSchema = buildOutputSchema(task, inputSchema);
control.run(task.dump(), outputSchema);
}
示例12: transaction
import org.embulk.spi.FilterPlugin; //导入方法依赖的package包/类
@Override
public void transaction(ConfigSource config, Schema inputSchema,
FilterPlugin.Control control)
{
PluginTask task = config.loadConfig(PluginTask.class);
configure(task, inputSchema);
Schema outputSchema = inputSchema;
control.run(task.dump(), outputSchema);
}
示例13: transaction
import org.embulk.spi.FilterPlugin; //导入方法依赖的package包/类
@Override
public void transaction(ConfigSource config, Schema inputSchema,
FilterPlugin.Control control)
{
PluginTask task = config.loadConfig(PluginTask.class);
Schema outputSchema = buildOutputSchema(task, inputSchema);
control.run(task.dump(), outputSchema);
}
示例14: transaction
import org.embulk.spi.FilterPlugin; //导入方法依赖的package包/类
@Override
public void transaction(ConfigSource config, Schema inputSchema,
FilterPlugin.Control control)
{
PluginTask task = config.loadConfig(PluginTask.class);
Schema outputSchema = inputSchema;
control.run(task.dump(), outputSchema);
}
示例15: transaction
import org.embulk.spi.FilterPlugin; //导入方法依赖的package包/类
@Override
public void transaction(ConfigSource config, Schema inputSchema,
FilterPlugin.Control control)
{
System.out.println("transaction!");
System.out.print("config: ");
System.out.println(config);
System.out.print("inputSchema: ");
System.out.println(inputSchema);
System.out.print("control: ");
System.out.println(control);
PluginTask task = config.loadConfig(PluginTask.class);
java.util.List<Column> newSchemaColumns = inputSchema.getColumns();
Schema.Builder builder = Schema.builder();
// 連番カラムを追加
builder.add("lineNumber", Types.LONG);
for (Column column : newSchemaColumns) {
builder.add(column.getName(), column.getType());
}
// 追加文字列カラムを追加
builder.add("additional", Types.STRING);
Schema outputSchema = builder.build();
control.run(task.dump(), outputSchema);
}