当前位置: 首页>>代码示例>>Java>>正文


Java FilterPlugin.Control方法代码示例

本文整理汇总了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());
}
 
开发者ID:mwed,项目名称:embulk-filter-query_string,代码行数:18,代码来源:QueryStringFilterPlugin.java

示例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);
}
 
开发者ID:hiroyuki-sato,项目名称:embulk-filter-build_json,代码行数:18,代码来源:BuildJsonFilterPlugin.java

示例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);
}
 
开发者ID:civitaspo,项目名称:embulk-filter-expand_json,代码行数:25,代码来源:ExpandJsonFilterPlugin.java

示例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);
}
 
开发者ID:civitaspo,项目名称:embulk-filter-join_file,代码行数:27,代码来源:JoinFileFilterPlugin.java

示例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);
}
 
开发者ID:civitaspo,项目名称:embulk-filter-distinct,代码行数:21,代码来源:DistinctFilterPlugin.java

示例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);
}
 
开发者ID:mwed,项目名称:embulk-filter-url_encode,代码行数:9,代码来源:UrlEncodeFilterPlugin.java

示例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);
}
 
开发者ID:sonots,项目名称:embulk-filter-typecast,代码行数:11,代码来源:TypecastFilterPlugin.java

示例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));
}
 
开发者ID:toyama0919,项目名称:embulk-filter-icu4j,代码行数:9,代码来源:Icu4jFilterPlugin.java

示例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);
}
 
开发者ID:civitaspo,项目名称:embulk-filter-flatten_json,代码行数:11,代码来源:FlattenJsonFilterPlugin.java

示例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);
}
 
开发者ID:sonots,项目名称:embulk-filter-column,代码行数:12,代码来源:ColumnFilterPlugin.java

示例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);
}
 
开发者ID:sonots,项目名称:embulk-filter-row,代码行数:12,代码来源:RowFilterPlugin.java

示例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);
}
 
开发者ID:toyama0919,项目名称:embulk-filter-kuromoji,代码行数:11,代码来源:KuromojiFilterPlugin.java

示例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);
}
 
开发者ID:hata,项目名称:embulk-filter-speedometer,代码行数:9,代码来源:SpeedometerFilterPlugin.java

示例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);
}
 
开发者ID:mikoto2000,项目名称:MiscellaneousStudy,代码行数:29,代码来源:FirstfilterFilterPlugin.java


注:本文中的org.embulk.spi.FilterPlugin.Control方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。