• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RequestIndexer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: process

import org.apache.flink.streaming.connectors.elasticsearch.RequestIndexer; //导入依赖的package包/类
@Override
public void process(
		Tuple5<Float, Float, Long, Boolean, Integer> record,
		RuntimeContext ctx,
		RequestIndexer indexer) {

	// construct JSON document to index
	Map<String, String> json = new HashMap<>();
	json.put("time", record.f2.toString());         // timestamp
	json.put("location", record.f1+","+record.f0);  // lat,lon pair
	json.put("isStart", record.f3.toString());      // isStart
	json.put("cnt", record.f4.toString());          // count

	IndexRequest rqst = Requests.indexRequest()
			.index("nyc-places")           // index name
			.type("popular-locations")     // mapping name
			.source(json);

	indexer.add(rqst);
}
 
开发者ID:dineshtrivedi,项目名称:flink-java-project,代码行数:21,代码来源:PoupularPlacesMain.java


示例2: process

import org.apache.flink.streaming.connectors.elasticsearch.RequestIndexer; //导入依赖的package包/类
@Override
public void process(
		Tuple5<Float, Float, Long, Boolean, Integer> record,
		RuntimeContext ctx,
		RequestIndexer indexer) {

	// construct JSON document to index
	Map<String, String> json = new HashMap<>();
	json.put("time", record.f2.toString());         // timestamp
	json.put("location", record.f1+","+record.f0);  // lat,lon pair
	json.put("isStart", record.f3.toString());      // isStart
	json.put("cnt", record.f4.toString());          // count

	IndexRequest rqst = Requests.indexRequest()
			.index("nyc-places")        // index name
			.type("popular-locations")  // mapping name
			.source(json);

	indexer.add(rqst);
}
 
开发者ID:dataArtisans,项目名称:flink-training-exercises,代码行数:21,代码来源:PopularPlacesToES.java


示例3: main

import org.apache.flink.streaming.connectors.elasticsearch.RequestIndexer; //导入依赖的package包/类
public static void main(String[] args) throws Exception {

		StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

		DataStream<String> source = env.generateSequence(0, 20).map(new MapFunction<Long, String>() {
			@Override
			public String map(Long value) throws Exception {
				return "message #" + value;
			}
		});

		Map<String, String> userConfig = new HashMap<>();
		userConfig.put("cluster.name", "elasticsearch");
		// This instructs the sink to emit after every element, otherwise they would be buffered
		userConfig.put(ElasticsearchSink.CONFIG_KEY_BULK_FLUSH_MAX_ACTIONS, "1");

		List<TransportAddress> transports = new ArrayList<>();
		transports.add(new InetSocketTransportAddress(InetAddress.getByName("127.0.0.1"), 9300));

		source.addSink(new ElasticsearchSink<>(userConfig, transports, new ElasticsearchSinkFunction<String>() {
			@Override
			public void process(String element, RuntimeContext ctx, RequestIndexer indexer) {
				indexer.add(createIndexRequest(element));
			}
		}));

		env.execute("Elasticsearch Sink Example");
	}
 
开发者ID:axbaretto,项目名称:flink,代码行数:29,代码来源:ElasticsearchSinkExample.java


示例4: process

import org.apache.flink.streaming.connectors.elasticsearch.RequestIndexer; //导入依赖的package包/类
@Override
public void process(T element, RuntimeContext ctx, RequestIndexer indexer) {
	if (reusedRequestIndexerBridge == null) {
		reusedRequestIndexerBridge = new OldNewRequestIndexerBridge(indexer);
	}
	deprecated.process(element, ctx, reusedRequestIndexerBridge);
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:8,代码来源:OldNewElasticsearchSinkFunctionBridge.java


示例5: main

import org.apache.flink.streaming.connectors.elasticsearch.RequestIndexer; //导入依赖的package包/类
public static void main(String[] args) throws Exception {

		final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

		DataStream<String> source = env.generateSequence(0, 20).map(new MapFunction<Long, String>() {
			@Override
			public String map(Long value) throws Exception {
				return "message #" + value;
			}
		});

		Map<String, String> userConfig = new HashMap<>();
		userConfig.put("cluster.name", "elasticsearch");
		// This instructs the sink to emit after every element, otherwise they would be buffered
		userConfig.put(ElasticsearchSink.CONFIG_KEY_BULK_FLUSH_MAX_ACTIONS, "1");

		List<InetSocketAddress> transports = new ArrayList<>();
		transports.add(new InetSocketAddress(InetAddress.getByName("127.0.0.1"), 9300));

		source.addSink(new ElasticsearchSink<>(userConfig, transports, new ElasticsearchSinkFunction<String>() {
			@Override
			public void process(String element, RuntimeContext ctx, RequestIndexer indexer) {
				indexer.add(createIndexRequest(element));
			}
		}));

		env.execute("Elasticsearch Sink Example");
	}
 
开发者ID:axbaretto,项目名称:flink,代码行数:29,代码来源:ElasticsearchSinkExample.java


示例6: onFailure

import org.apache.flink.streaming.connectors.elasticsearch.RequestIndexer; //导入依赖的package包/类
@Override
public void onFailure(ActionRequest action, Throwable failure, int restStatusCode, RequestIndexer indexer) throws Throwable {
	if (ExceptionUtils.findThrowable(failure, EsRejectedExecutionException.class).isPresent()) {
		indexer.add(action);
	} else {
		// rethrow all other failures
		throw failure;
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:10,代码来源:RetryRejectedExecutionFailureHandler.java


示例7: process

import org.apache.flink.streaming.connectors.elasticsearch.RequestIndexer; //导入依赖的package包/类
@Override
public void process(WindowWordRanking value, RuntimeContext ctx, RequestIndexer indexer) {
  indexer.add(this.createWindowWordRanking(value));
}
 
开发者ID:gmarciani,项目名称:flink-scaffolding,代码行数:5,代码来源:MyESSinkFunction.java


示例8: process

import org.apache.flink.streaming.connectors.elasticsearch.RequestIndexer; //导入依赖的package包/类
@Override
public void process(PlayerRunningStatistics value, RuntimeContext ctx, RequestIndexer indexer) {
  indexer.add(this.createWindowWordRanking(value));
}
 
开发者ID:braineering,项目名称:socstream,代码行数:5,代码来源:PlayerRunningStatisticsESSinkFunction.java


示例9: process

import org.apache.flink.streaming.connectors.elasticsearch.RequestIndexer; //导入依赖的package包/类
@Override
public void process(PlayersSpeedRanking value, RuntimeContext ctx, RequestIndexer indexer) {
  indexer.add(this.createWindowWordRanking(value));
}
 
开发者ID:braineering,项目名称:socstream,代码行数:5,代码来源:PlayerSpeedRankingESSinkFunction.java


示例10: process

import org.apache.flink.streaming.connectors.elasticsearch.RequestIndexer; //导入依赖的package包/类
@Override
public void process(PlayerGridStatistics value, RuntimeContext ctx, RequestIndexer indexer) {
  indexer.add(this.createWindowWordRanking(value));
}
 
开发者ID:braineering,项目名称:socstream,代码行数:5,代码来源:PlayerGridStatisticsESSinkFunction.java


示例11: process

import org.apache.flink.streaming.connectors.elasticsearch.RequestIndexer; //导入依赖的package包/类
@Override
public void process(Result element, RuntimeContext ctx, RequestIndexer indexer) {
	indexer.add(createIndexRequest(element));
}
 
开发者ID:pravega,项目名称:pravega-samples,代码行数:5,代码来源:PravegaAnomalyDetectionProcessor.java


示例12: onFailure

import org.apache.flink.streaming.connectors.elasticsearch.RequestIndexer; //导入依赖的package包/类
@Override
public void onFailure(ActionRequest action, Throwable failure, int restStatusCode, RequestIndexer indexer) throws Throwable {
	// simply fail the sink
	throw failure;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:6,代码来源:NoOpFailureHandler.java


示例13: process

import org.apache.flink.streaming.connectors.elasticsearch.RequestIndexer; //导入依赖的package包/类
@Override
public void process(Tuple2<Integer, String> element, RuntimeContext ctx, RequestIndexer indexer) {
	indexer.add(createIndexRequest(element));
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:5,代码来源:SourceSinkDataTestKit.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java InstructionBuilder类代码示例发布时间:2022-05-23
下一篇:
Java Repository类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap