本文整理汇总了Java中org.apache.streams.hdfs.WebHdfsPersistWriter类的典型用法代码示例。如果您正苦于以下问题:Java WebHdfsPersistWriter类的具体用法?Java WebHdfsPersistWriter怎么用?Java WebHdfsPersistWriter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WebHdfsPersistWriter类属于org.apache.streams.hdfs包,在下文中一共展示了WebHdfsPersistWriter类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import org.apache.streams.hdfs.WebHdfsPersistWriter; //导入依赖的package包/类
@Override
public void run() {
ElasticsearchPersistReader elasticsearchPersistReader = new ElasticsearchPersistReader(config.getSource());
WebHdfsPersistWriter hdfsPersistWriter = new WebHdfsPersistWriter(config.getDestination());
LocalRuntimeConfiguration localRuntimeConfiguration =
StreamsJacksonMapper.getInstance().convertValue(StreamsConfigurator.detectConfiguration(), LocalRuntimeConfiguration.class);
StreamBuilder builder = new LocalStreamBuilder(localRuntimeConfiguration);
builder.newPerpetualStream(ElasticsearchPersistReader.class.getCanonicalName(), elasticsearchPersistReader);
builder.addStreamsPersistWriter(WebHdfsPersistWriter.class.getCanonicalName(), hdfsPersistWriter, 1, ElasticsearchPersistReader.class.getCanonicalName());
builder.start();
}