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


Java Exec.newConfigDiff方法代码示例

本文整理汇总了Java中org.embulk.spi.Exec.newConfigDiff方法的典型用法代码示例。如果您正苦于以下问题:Java Exec.newConfigDiff方法的具体用法?Java Exec.newConfigDiff怎么用?Java Exec.newConfigDiff使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.embulk.spi.Exec的用法示例。


在下文中一共展示了Exec.newConfigDiff方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: resume

import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public ConfigDiff resume(TaskSource taskSource,
        Schema schema, int taskCount,
        InputPlugin.Control control)
{
    List<TaskReport> taskReportList =
            control.run(taskSource, schema, taskCount);

    // start_row_marker を ConfigDiff にセット
    ConfigDiff configDiff = Exec.newConfigDiff();
    for (TaskReport taskReport : taskReportList) {
        final String label = "start_row_marker";
        final String startRowMarker = taskReport.get(String.class, label, null);
        if (startRowMarker != null) {
            configDiff.set(label, startRowMarker);
        }
    }
    return configDiff;
}
 
开发者ID:mikoto2000,项目名称:embulk-input-salesforce_bulk,代码行数:20,代码来源:SalesforceBulkInputPlugin.java

示例2: resume

import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public ConfigDiff resume(TaskSource taskSource,
        Schema schema, int taskCount,
        InputPlugin.Control control)
{
    control.run(taskSource, schema, taskCount);
    return Exec.newConfigDiff();
}
 
开发者ID:yuokada,项目名称:embulk-input-randomj,代码行数:9,代码来源:RandomjInputPlugin.java

示例3: transaction

import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public ConfigDiff transaction(ConfigSource config,
        Schema schema, int taskCount,
        OutputPlugin.Control control)
{
    PluginTask task = config.loadConfig(PluginTask.class);
    control.run(task.dump());
    return Exec.newConfigDiff();
}
 
开发者ID:tomykaira,项目名称:embulk-output-s3_per_record,代码行数:10,代码来源:S3PerRecordOutputPlugin.java

示例4: transaction

import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public ConfigDiff transaction(ConfigSource config, int taskCount,
        FileOutputPlugin.Control control)
{
    PluginTask task = config.loadConfig(PluginTask.class);

    // retryable (idempotent) output:
    // return resume(task.dump(), taskCount, control);

    // non-retryable (non-idempotent) output:
    control.run(task.dump());
    return Exec.newConfigDiff();
}
 
开发者ID:embulk,项目名称:embulk-output-sftp,代码行数:14,代码来源:SftpFileOutputPlugin.java

示例5: resume

import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public ConfigDiff resume(TaskSource taskSource,
                         int taskCount,
                         FileOutputPlugin.Control control)
{
    control.run(taskSource);
    return Exec.newConfigDiff();
}
 
开发者ID:embulk,项目名称:embulk-output-gcs,代码行数:9,代码来源:GcsOutputPlugin.java

示例6: guess

import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public ConfigDiff guess(ConfigSource config, Buffer sample) {

    GrokGuessPlugin.PluginTask task = config.getNested("parser").loadConfig(GrokGuessPlugin.PluginTask.class);

    LineDecoder.DecoderTask decoderTask = config.loadConfig(LineDecoder.DecoderTask.class);
    LineDecoder decoder = new LineDecoder(new ListFileInput(ImmutableList.of(ImmutableList.of((sample)))), decoderTask);

    List<String> sampleLines = new ArrayList<>();
    while (true) {
        if (!decoder.nextFile()) {
            break;
        }
        while (true) {
            String line = decoder.poll();
            if (line == null) {
                break;
            }
            sampleLines.add(line);
        }
    }

    GrokGuesser guesser = new GrokGuesser(
            task.getGuessPatterns(),
            task.getGrokPatternFiles()
    );
    try {
        String pattern = guesser.guessPattern(sampleLines);
        List<Map<String, Object>> columns = guesser.guessColumns(sampleLines, pattern);
        return Exec.newConfigDiff().set(
                "parser", ImmutableMap.of("grok_pattern", pattern, "columns", columns));
    } catch (GrokException e) {
        return Exec.newConfigDiff();
    }

}
 
开发者ID:arielnetworks,项目名称:embulk-parser-grok,代码行数:37,代码来源:GrokGuessPlugin.java

示例7: resume

import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public ConfigDiff resume(TaskSource taskSource,
        int taskCount,
        FileInputPlugin.Control control)
{
    control.run(taskSource, taskCount);
    ConfigDiff configDiff = Exec.newConfigDiff();
    return configDiff;
}
 
开发者ID:civitaspo,项目名称:embulk-input-hdfs,代码行数:10,代码来源:HdfsFileInputPlugin.java

示例8: resume

import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public ConfigDiff resume(TaskSource taskSource,
        Schema schema, int taskCount,
        InputPlugin.Control control)
{
    List<TaskReport> report = control.run(taskSource, schema, taskCount);

    ConfigDiff configDiff = Exec.newConfigDiff();
    if (report.size() > 0 && report.get(0).has("last_record")) {
        configDiff.set("last_record", report.get(0).get(Map.class, "last_record"));
    }

    return configDiff;
}
 
开发者ID:hakobera,项目名称:embulk-input-mongodb,代码行数:15,代码来源:MongodbInputPlugin.java

示例9: transaction

import org.embulk.spi.Exec; //导入方法依赖的package包/类
public ConfigDiff transaction(ConfigSource config,
        Schema schema, int processorCount,
        OutputPlugin.Control control)
{
    PluginTask task = config.loadConfig(PluginTask.class);

    //TODO

    control.run(task.dump());
    return Exec.newConfigDiff();
}
 
开发者ID:choplin,项目名称:embulk-output-parquet,代码行数:12,代码来源:ParquetOutputPlugin.java

示例10: resume

import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public ConfigDiff resume(TaskSource taskSource, int taskCount,
        Control control)
{
    control.run(taskSource);
    return Exec.newConfigDiff();
}
 
开发者ID:llibra,项目名称:embulk-output-s3,代码行数:8,代码来源:S3FileOutputPlugin.java

示例11: egestEmbulkData

import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public ConfigDiff egestEmbulkData(final PluginTask task, final Schema schema, final int taskCount,
                                  final List<TaskReport> taskReports)
{
    long totalInserted = 0;
    for (TaskReport taskReport : taskReports) {
        if (taskReport.has("pushed")) {
            totalInserted += taskReport.get(Long.class, "pushed");
        }
    }

    LOG.info("Pushed completed. {} records", totalInserted);

    return Exec.newConfigDiff();
}
 
开发者ID:treasure-data,项目名称:embulk-output-mailchimp,代码行数:16,代码来源:MailChimpOutputPluginDelegate.java

示例12: guess

import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public ConfigDiff guess(ConfigSource config)
{
    return Exec.newConfigDiff();
}
 
开发者ID:yuokada,项目名称:embulk-input-randomj,代码行数:6,代码来源:RandomjInputPlugin.java

示例13: transaction

import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public ConfigDiff transaction(ConfigSource config, Schema schema, int taskCount, OutputPlugin.Control control) {
    PluginTask task = config.loadConfig(PluginTask.class);
    control.run(task.dump());
    return Exec.newConfigDiff();
}
 
开发者ID:yahoojapan,项目名称:embulk-output-solr,代码行数:7,代码来源:SolrOutputPlugin.java

示例14: resume

import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public ConfigDiff resume(TaskSource taskSource, Schema schema, int taskCount, OutputPlugin.Control control) {
    // TODO
    return Exec.newConfigDiff();
}
 
开发者ID:yahoojapan,项目名称:embulk-output-solr,代码行数:6,代码来源:SolrOutputPlugin.java

示例15: transaction

import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public ConfigDiff transaction(ConfigSource config,
        Schema schema, int taskCount,
        OutputPlugin.Control control)
{
    PluginTask task = config.loadConfig(PluginTask.class);
    logger = Exec.getLogger(getClass());
    
    if (task.getResultDir().isPresent() && task.getResultDir().get() != null) {
        File resultDir = new File(task.getResultDir().get());
        if (!resultDir.exists() || !resultDir.isDirectory()) {
            logger.error("{} is not exist or is not directory.", task.getResultDir().get());
            throw new RuntimeException(task.getResultDir().get() + " is not exist or is not directory.");
        }
    }
    
    final String username = task.getUsername();
    final String password = task.getPassword();
    final String loginEndpoint = task.getLoginEndpoint().get();
    try {
        if (client == null) {
            ConnectorConfig connectorConfig = new ConnectorConfig();
            connectorConfig.setUsername(username);
            connectorConfig.setPassword(password);
            connectorConfig.setAuthEndpoint(loginEndpoint + "/services/Soap/u/" +task.getVersion().get() + "/");

            client = Connector.newConnection(connectorConfig);
            GetUserInfoResult userInfo = client.getUserInfo();
            logger.info("login successful with {}", userInfo.getUserName());
            externalIdToObjectNameMap = new HashMap<>();
            DescribeSObjectResult describeResult = client.describeSObject(task.getSObject());
            for (Field field : describeResult.getFields()) {
                if (field.getType() == FieldType.reference) {
                    externalIdToObjectNameMap.put(field.getRelationshipName(), field.getReferenceTo()[0]);
                }
            }
        }
    } catch(ConnectionException ex) {
        logger.error("Login error. Please check your credentials.");
        throw new RuntimeException(ex);
    }
        
    control.run(task.dump());
    return Exec.newConfigDiff();
}
 
开发者ID:tzmfreedom,项目名称:embulk-output-salesforce,代码行数:46,代码来源:SalesforceOutputPlugin.java


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