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


Java StreamsConfigurator类代码示例

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


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

示例1: main

import org.apache.streams.config.StreamsConfigurator; //导入依赖的package包/类
public static void main(String[] args)
{
  LOGGER.info(StreamsConfigurator.getConfig().toString());

  TwitterUserstreamElasticsearch userstream = new TwitterUserstreamElasticsearch();
  new Thread(userstream).start();

}
 
开发者ID:apache,项目名称:streams-examples,代码行数:9,代码来源:TwitterUserstreamElasticsearch.java

示例2: run

import org.apache.streams.config.StreamsConfigurator; //导入依赖的package包/类
@Override
public void run() {

  TwitterStreamConfiguration twitterStreamConfiguration = config.getTwitter();
  ElasticsearchWriterConfiguration elasticsearchWriterConfiguration = config.getElasticsearch();

  TwitterStreamProvider stream = new TwitterStreamProvider(twitterStreamConfiguration);
  ActivityConverterProcessor converter = new ActivityConverterProcessor();
  VerbDefinitionDropFilter noDeletesProcessor = new VerbDefinitionDropFilter(Stream.of(deleteVerbDefinition).collect(Collectors.toSet()));
  ElasticsearchPersistWriter writer = new ElasticsearchPersistWriter(elasticsearchWriterConfiguration);
  VerbDefinitionKeepFilter deleteOnlyProcessor = new VerbDefinitionKeepFilter(Stream.of(deleteVerbDefinition).collect(Collectors.toSet()));
  SetDeleteIdProcessor setDeleteIdProcessor = new SetDeleteIdProcessor();
  ElasticsearchPersistDeleter deleter = new ElasticsearchPersistDeleter(elasticsearchWriterConfiguration);

  LocalRuntimeConfiguration localRuntimeConfiguration =
      StreamsJacksonMapper.getInstance().convertValue(StreamsConfigurator.detectConfiguration(), LocalRuntimeConfiguration.class);
  StreamBuilder builder = new LocalStreamBuilder(localRuntimeConfiguration);

  builder.newPerpetualStream(TwitterStreamProvider.class.getCanonicalName(), stream);
  builder.addStreamsProcessor(ActivityConverterProcessor.class.getCanonicalName(), converter, 2, TwitterStreamProvider.class.getCanonicalName());
  builder.addStreamsProcessor(VerbDefinitionDropFilter.class.getCanonicalName(), noDeletesProcessor, 1, ActivityConverterProcessor.class.getCanonicalName());
  builder.addStreamsPersistWriter(ElasticsearchPersistWriter.class.getCanonicalName(), writer, 1, VerbDefinitionDropFilter.class.getCanonicalName());
  builder.addStreamsProcessor(VerbDefinitionKeepFilter.class.getCanonicalName(), deleteOnlyProcessor, 1, ActivityConverterProcessor.class.getCanonicalName());
  builder.addStreamsProcessor(SetDeleteIdProcessor.class.getCanonicalName(), setDeleteIdProcessor, 1, VerbDefinitionKeepFilter.class.getCanonicalName());
  builder.addStreamsPersistWriter(ElasticsearchPersistDeleter.class.getCanonicalName(), deleter, 1, SetDeleteIdProcessor.class.getCanonicalName());

  builder.start();

}
 
开发者ID:apache,项目名称:streams-examples,代码行数:30,代码来源:TwitterUserstreamElasticsearch.java

示例3: run

import org.apache.streams.config.StreamsConfigurator; //导入依赖的package包/类
@Override
public void run() {

  MongoPersistReader mongoPersistReader = new MongoPersistReader(config.getSource());

  ElasticsearchPersistWriter elasticsearchPersistWriter = new ElasticsearchPersistWriter(config.getDestination());

  LocalRuntimeConfiguration localRuntimeConfiguration =
      StreamsJacksonMapper.getInstance().convertValue(StreamsConfigurator.detectConfiguration(), LocalRuntimeConfiguration.class);
  StreamBuilder builder = new LocalStreamBuilder(localRuntimeConfiguration);

  builder.newPerpetualStream(MongoPersistReader.class.getCanonicalName(), mongoPersistReader);
  builder.addStreamsPersistWriter(ElasticsearchPersistWriter.class.getCanonicalName(), elasticsearchPersistWriter, 1, MongoPersistReader.class.getCanonicalName());
  builder.start();
}
 
开发者ID:apache,项目名称:streams-examples,代码行数:16,代码来源:MongoElasticsearchSync.java

示例4: run

import org.apache.streams.config.StreamsConfigurator; //导入依赖的package包/类
@Override
public void run() {

  ElasticsearchPersistReader elasticsearchPersistReader = new ElasticsearchPersistReader(config.getSource());

  ElasticsearchPersistWriter elasticsearchPersistWriter = new ElasticsearchPersistWriter(config.getDestination());

  LocalRuntimeConfiguration localRuntimeConfiguration =
      StreamsJacksonMapper.getInstance().convertValue(StreamsConfigurator.detectConfiguration(), LocalRuntimeConfiguration.class);
  StreamBuilder builder = new LocalStreamBuilder(localRuntimeConfiguration);

  builder.newPerpetualStream(ElasticsearchPersistReader.class.getCanonicalName(), elasticsearchPersistReader);
  builder.addStreamsPersistWriter(ElasticsearchPersistWriter.class.getCanonicalName(), elasticsearchPersistWriter, 1, ElasticsearchPersistReader.class.getCanonicalName());
  builder.start();
}
 
开发者ID:apache,项目名称:streams-examples,代码行数:16,代码来源:ElasticsearchReindex.java

示例5: run

import org.apache.streams.config.StreamsConfigurator; //导入依赖的package包/类
@Override
public void run() {

  WebHdfsPersistReader webHdfsPersistReader = new WebHdfsPersistReader(config.getSource());
  ElasticsearchPersistWriter elasticsearchPersistWriter = new ElasticsearchPersistWriter(config.getDestination());

  LocalRuntimeConfiguration localRuntimeConfiguration =
      StreamsJacksonMapper.getInstance().convertValue(StreamsConfigurator.detectConfiguration(), LocalRuntimeConfiguration.class);
  StreamBuilder builder = new LocalStreamBuilder(localRuntimeConfiguration);

  builder.newPerpetualStream(WebHdfsPersistReader.class.getCanonicalName(), webHdfsPersistReader);
  builder.addStreamsPersistWriter(ElasticsearchPersistWriter.class.getCanonicalName(), elasticsearchPersistWriter, 1, WebHdfsPersistReader.class.getCanonicalName());
  builder.start();
}
 
开发者ID:apache,项目名称:streams-examples,代码行数:15,代码来源:HdfsElasticsearch.java

示例6: run

import org.apache.streams.config.StreamsConfigurator; //导入依赖的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();
}
 
开发者ID:apache,项目名称:streams-examples,代码行数:15,代码来源:ElasticsearchHdfs.java

示例7: run

import org.apache.streams.config.StreamsConfigurator; //导入依赖的package包/类
public void run() {

    TwitterFollowingConfiguration twitterFollowingConfiguration = config.getTwitter();
    TwitterFollowingProvider followingProvider = new TwitterFollowingProvider(twitterFollowingConfiguration);
    TypeConverterProcessor converter = new TypeConverterProcessor(String.class);

    List<DocumentClassifier> classifiers = Stream.of((DocumentClassifier) new TwitterDocumentClassifier()).collect(Collectors.toList());
    List<ActivityConverter> converters = Stream.of((ActivityConverter) new TwitterFollowActivityConverter()).collect(Collectors.toList());
    ActivityConverterProcessorConfiguration activityConverterProcessorConfiguration =
        new ActivityConverterProcessorConfiguration()
            .withClassifiers(classifiers)
            .withConverters(converters);
    ActivityConverterProcessor activity = new ActivityConverterProcessor(activityConverterProcessorConfiguration);

    Neo4jConfiguration neo4jConfiguration = config.getNeo4j();
    Neo4jBoltPersistWriter graphPersistWriter = new Neo4jBoltPersistWriter(neo4jConfiguration);
    graphPersistWriter.prepare(neo4jConfiguration);

    LocalRuntimeConfiguration localRuntimeConfiguration =
        StreamsJacksonMapper.getInstance().convertValue(StreamsConfigurator.detectConfiguration(), LocalRuntimeConfiguration.class);
    StreamBuilder builder = new LocalStreamBuilder(localRuntimeConfiguration);

    builder.newPerpetualStream(TwitterFollowingProvider.class.getCanonicalName(), followingProvider);
    builder.addStreamsProcessor(TypeConverterProcessor.class.getCanonicalName(), converter, 1, TwitterFollowingProvider.class.getCanonicalName());
    builder.addStreamsProcessor(ActivityConverterProcessor.class.getCanonicalName(), activity, 1, TypeConverterProcessor.class.getCanonicalName());
    builder.addStreamsPersistWriter(Neo4jBoltPersistWriter.class.getCanonicalName(), graphPersistWriter, 1, ActivityConverterProcessor.class.getCanonicalName());

    builder.start();
  }
 
开发者ID:apache,项目名称:streams-examples,代码行数:30,代码来源:TwitterFollowNeo4j.java

示例8: run

import org.apache.streams.config.StreamsConfigurator; //导入依赖的package包/类
public void run() {

    TwitterTimelineProvider provider = new TwitterTimelineProvider(config.getTwitter());
    ActivityConverterProcessor converter = new ActivityConverterProcessor();
    ElasticsearchPersistWriter writer = new ElasticsearchPersistWriter(config.getElasticsearch());

    LocalRuntimeConfiguration localRuntimeConfiguration =
        StreamsJacksonMapper.getInstance().convertValue(StreamsConfigurator.detectConfiguration(), LocalRuntimeConfiguration.class);
    StreamBuilder builder = new LocalStreamBuilder(localRuntimeConfiguration);

    builder.newPerpetualStream(TwitterTimelineProvider.class.getCanonicalName(), provider);
    builder.addStreamsProcessor(ActivityConverterProcessor.class.getCanonicalName(), converter, 2, TwitterTimelineProvider.class.getCanonicalName());
    builder.addStreamsPersistWriter(ElasticsearchPersistWriter.class.getCanonicalName(), writer, 1, ActivityConverterProcessor.class.getCanonicalName());
    builder.start();
  }
 
开发者ID:apache,项目名称:streams-examples,代码行数:16,代码来源:TwitterHistoryElasticsearch.java

示例9: MongoElasticsearchSync

import org.apache.streams.config.StreamsConfigurator; //导入依赖的package包/类
public MongoElasticsearchSync() {
  this(new ComponentConfigurator<MongoElasticsearchSyncConfiguration>(MongoElasticsearchSyncConfiguration.class).detectConfiguration(StreamsConfigurator.getConfig()));
}
 
开发者ID:apache,项目名称:streams-examples,代码行数:4,代码来源:MongoElasticsearchSync.java

示例10: HdfsElasticsearch

import org.apache.streams.config.StreamsConfigurator; //导入依赖的package包/类
public HdfsElasticsearch() {
  this(new ComponentConfigurator<>(HdfsElasticsearchConfiguration.class).detectConfiguration(StreamsConfigurator.getConfig()));
}
 
开发者ID:apache,项目名称:streams-examples,代码行数:4,代码来源:HdfsElasticsearch.java

示例11: main

import org.apache.streams.config.StreamsConfigurator; //导入依赖的package包/类
public static void main(String[] args)
{
  LOGGER.info(StreamsConfigurator.getConfig().toString());
  HdfsElasticsearch restore = new HdfsElasticsearch();
  new Thread(restore).start();
}
 
开发者ID:apache,项目名称:streams-examples,代码行数:7,代码来源:HdfsElasticsearch.java

示例12: ElasticsearchHdfs

import org.apache.streams.config.StreamsConfigurator; //导入依赖的package包/类
public ElasticsearchHdfs() {
  this(new ComponentConfigurator<>(ElasticsearchHdfsConfiguration.class).detectConfiguration(StreamsConfigurator.getConfig()));
}
 
开发者ID:apache,项目名称:streams-examples,代码行数:4,代码来源:ElasticsearchHdfs.java

示例13: main

import org.apache.streams.config.StreamsConfigurator; //导入依赖的package包/类
public static void main(String[] args)
{
  LOGGER.info(StreamsConfigurator.getConfig().toString());
  ElasticsearchHdfs backup = new ElasticsearchHdfs();
  new Thread(backup).start();
}
 
开发者ID:apache,项目名称:streams-examples,代码行数:7,代码来源:ElasticsearchHdfs.java

示例14: TwitterFollowNeo4j

import org.apache.streams.config.StreamsConfigurator; //导入依赖的package包/类
public TwitterFollowNeo4j() {
  this(new ComponentConfigurator<>(TwitterFollowNeo4jConfiguration.class).detectConfiguration(StreamsConfigurator.getConfig()));
}
 
开发者ID:apache,项目名称:streams-examples,代码行数:4,代码来源:TwitterFollowNeo4j.java

示例15: TwitterHistoryElasticsearch

import org.apache.streams.config.StreamsConfigurator; //导入依赖的package包/类
public TwitterHistoryElasticsearch() {
  this(new ComponentConfigurator<>(TwitterHistoryElasticsearchConfiguration.class).detectConfiguration(StreamsConfigurator.getConfig()));
}
 
开发者ID:apache,项目名称:streams-examples,代码行数:4,代码来源:TwitterHistoryElasticsearch.java


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