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


Java StreamsJacksonMapper类代码示例

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


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

示例1: run

import org.apache.streams.jackson.StreamsJacksonMapper; //导入依赖的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

示例2: run

import org.apache.streams.jackson.StreamsJacksonMapper; //导入依赖的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

示例3: run

import org.apache.streams.jackson.StreamsJacksonMapper; //导入依赖的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

示例4: run

import org.apache.streams.jackson.StreamsJacksonMapper; //导入依赖的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

示例5: run

import org.apache.streams.jackson.StreamsJacksonMapper; //导入依赖的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

示例6: run

import org.apache.streams.jackson.StreamsJacksonMapper; //导入依赖的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

示例7: run

import org.apache.streams.jackson.StreamsJacksonMapper; //导入依赖的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


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