流数据存储之Elasticsearch( 二 )


 

流数据存储之Elasticsearch

文章插图
 
  1.  
  2. 添加发送器
    1)添加发送器
    将“接收器”中的“Elasticsearch添加发送器”用鼠标拖到“节点编辑器”中,如下图所示:
    流数据存储之Elasticsearch

    文章插图
    2)编辑发送器节点信息
    鼠标单击“节点编辑器”中的“Elasticsearch添加发送器” , 添加如下信息:
    流数据存储之Elasticsearch

    文章插图
    4、连接发送器和接收器
    拖拽“节点编辑器”中的“单文本文件接收器”右侧的绿色方块 , 将拖出的箭头指向“Elasticsearch添加发送器”(如下图) , 命名为“ESstreaming” , 点击“发布”即可发布流处理模型 。
    流数据存储之Elasticsearch

    文章插图
     
 
(二)手动编写streaming文件
手动编写streaming文件相关的参数配置按照iServer帮助文档的“流处理模型配置参数说明”来进行编写 , 如下图:http://support.supermap.com.cn/DataWarehouse/WebDocHelp/iServer/index.htm
 
流数据存储之Elasticsearch

文章插图
编写好的streaming文件如下:
 
{
"sparkParameter": {
"checkPointDir": "tmp",
"interval": 5000
},
"stream": {
"nodeDic": {
"CSVFileReader": {
"metadata": {
"epsg": 4326,
"fieldInfos": [
{
"name": "id",
"source": "0",
"nType": "TEXT"
},
{
"name": "x",
"source": "1",
"nType": "DOUBLE"
},
{
"name": "y",
"source": "2",
"nType": "DOUBLE"
},
{
"name": "z",
"source": "3",
"nType": "DOUBLE"
},
{
"name": "fromStation",
"source": "4",
"nType": "TEXT"
},
{
"name": "toStation",
"source": "5",
"nType": "TEXT"
},
{
"name": "datetime",
"source": "6",
"nType": "TEXT"
}
],
"dateTimeFormat": "yyyy-MM-ddHH:mm:ss",
"timeFieldName": "datetime",
"featureType": "POINT",
"title": "",
"idFieldName": "id"
},
"readInterva": 5000,
"rowsOneTime": 50,
"nextNodes": [
"EsAppendSender"
],
"reader": {
"className":"com.supermap.bdt.streaming.formatter.CSVFormatter",
"separator": ","
},
"filePath":"E:/supermap/iserver/912/supermap-iserver-9.1.2-win64-zip/samples/streamingmodels/readcsv/flights.csv",
"name": "CSVFileReader",
"prevNodes": [],
"className":"com.supermap.bdt.streaming.receiver.SingleTextFileReceiver",
"caption": "单文本文件接收器",
"description": null
},
"EsAppendSender": {
"className":"com.supermap.bdt.streaming.sender.EsAppendSender",
"caption": "Elasticsearch添加发送器",
"name": "EsAppendSender",
"nextNodes": [],
"prevNodes": [
"CSVFileReader"
],
"description": null,
"formatter": {
"className":"com.supermap.bdt.streaming.formatter.GeoJsonFormatter"
},
"url": "192.168.15.200:9200",
"queueName": "streamingdata",
"directoryPath": "streaming"
}
}
},
"version": 9000
}
 
三、发布流处理模型
对于用模型编辑器编辑的直接点击模型编辑器左上角的【发布】即可 。
对于自己编写的streaming文件 , 在服务管理“首页”点击快速发布一个或一组服务 , 选择数据来源为"流处理模型" , 点击“下一步”;


推荐阅读