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


Java OutputPlugin类代码示例

本文整理汇总了Java中org.embulk.spi.OutputPlugin的典型用法代码示例。如果您正苦于以下问题:Java OutputPlugin类的具体用法?Java OutputPlugin怎么用?Java OutputPlugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: configurePlugin

import org.embulk.spi.OutputPlugin; //导入依赖的package包/类
protected void configurePlugin(Binder binder) {
	// input plugins
	InjectedPluginSource.registerPluginTo(binder, InputPlugin.class, EmbulkTestFileInputPlugin.TYPE,
			EmbulkTestFileInputPlugin.class);
	binder.bind(EmbulkTestFileInputPlugin.class).toProvider(new Provider<EmbulkTestFileInputPlugin>() {

		@Override
		public EmbulkTestFileInputPlugin get() {
			return embulkTestFileInputPlugin;
		}
	});

	// output plugins
	InjectedPluginSource.registerPluginTo(binder, OutputPlugin.class, EmbulkTestOutputPlugin.TYPE,
			EmbulkTestOutputPlugin.class);
	binder.bind(EmbulkTestOutputPlugin.class).toProvider(new Provider<EmbulkTestOutputPlugin>() {

		@Override
		public EmbulkTestOutputPlugin get() {
			return embulkTestOutputPlugin;
		}
	});
}
 
开发者ID:hishidama,项目名称:embulk-parser-poi_excel,代码行数:24,代码来源:EmbulkPluginTester.java

示例2: testTransaction

import org.embulk.spi.OutputPlugin; //导入依赖的package包/类
@Test
public void testTransaction() {
    ConfigSource config = config();
    Schema schema = config.getNested("parser").loadConfig(CsvParserPlugin.PluginTask.class).getSchemaConfig()
            .toSchema();
    plugin.transaction(config, schema, 0, new OutputPlugin.Control() {
        @Override
        public List<TaskReport> run(TaskSource taskSource) {
            return Lists.newArrayList(Exec.newTaskReport());
        }
    });
}
 
开发者ID:yahoojapan,项目名称:embulk-output-solr,代码行数:13,代码来源:TestSolrOutputPlugin.java

示例3: testResume

import org.embulk.spi.OutputPlugin; //导入依赖的package包/类
@Test
public void testResume() {
    ConfigSource config = config();
    Schema schema = config.getNested("parser").loadConfig(CsvParserPlugin.PluginTask.class).getSchemaConfig()
            .toSchema();
    PluginTask task = config.loadConfig(PluginTask.class);
    plugin.resume(task.dump(), schema, 0, new OutputPlugin.Control() {
        @Override
        public List<TaskReport> run(TaskSource taskSource) {
            return Lists.newArrayList(Exec.newTaskReport());
        }
    });
}
 
开发者ID:yahoojapan,项目名称:embulk-output-solr,代码行数:14,代码来源:TestSolrOutputPlugin.java

示例4: transaction

import org.embulk.spi.OutputPlugin; //导入依赖的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

示例5: resume

import org.embulk.spi.OutputPlugin; //导入依赖的package包/类
@Override
public ConfigDiff resume(TaskSource taskSource,
        Schema schema, int taskCount,
        OutputPlugin.Control control)
{
    throw new UnsupportedOperationException("s3_per_record output plugin does not support resuming");
}
 
开发者ID:tomykaira,项目名称:embulk-output-s3_per_record,代码行数:8,代码来源:S3PerRecordOutputPlugin.java

示例6: resume

import org.embulk.spi.OutputPlugin; //导入依赖的package包/类
@Override
public ConfigDiff resume(TaskSource taskSource,
        Schema schema, int taskCount,
        OutputPlugin.Control control)
{
    throw new UnsupportedOperationException("salesforce output plugin does not support resuming");
}
 
开发者ID:tzmfreedom,项目名称:embulk-output-salesforce,代码行数:8,代码来源:SalesforceOutputPlugin.java

示例7: transaction

import org.embulk.spi.OutputPlugin; //导入依赖的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

示例8: transaction

import org.embulk.spi.OutputPlugin; //导入依赖的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

示例9: resume

import org.embulk.spi.OutputPlugin; //导入依赖的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

示例10: transaction

import org.embulk.spi.OutputPlugin; //导入依赖的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

示例11: transaction

import org.embulk.spi.OutputPlugin; //导入依赖的package包/类
@Override
public ConfigDiff transaction(ConfigSource config, Schema schema, int taskCount, OutputPlugin.Control control) {
	final PluginTask task = config.loadConfig(PluginTask.class);
	return resume(task.dump(), schema, taskCount, control);
}
 
开发者ID:hishidama,项目名称:embulk-parser-poi_excel,代码行数:6,代码来源:EmbulkTestOutputPlugin.java

示例12: resume

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

示例13: resume

import org.embulk.spi.OutputPlugin; //导入依赖的package包/类
public ConfigDiff resume(TaskSource taskSource,
        Schema schema, int processorCount,
        OutputPlugin.Control control)
{
    throw new UnsupportedOperationException("parquet output plugin does not support resuming");
}
 
开发者ID:choplin,项目名称:embulk-output-parquet,代码行数:7,代码来源:ParquetOutputPlugin.java


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