|
|
|
@ -452,60 +452,60 @@ public class IotMachineEventGeneratorJob { |
|
|
|
CreateIndexRequest request = new CreateIndexRequest(indicesName); |
|
|
|
// 字段映射 |
|
|
|
String mappersStr = "{\n" + |
|
|
|
" \"properties\": {\n" + |
|
|
|
" \"countOfThePeriod\": {\n" + |
|
|
|
" \"type\": \"long\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"durationOfThePeriod\": {\n" + |
|
|
|
" \"type\": \"long\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"jobCountOfTheDay\": {\n" + |
|
|
|
" \"type\": \"long\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"jobDurationOfTheDay\": {\n" + |
|
|
|
" \"type\": \"long\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"machineWorkingStat\": {\n" + |
|
|
|
" \"type\": \"integer\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"machineIotMac\": {\n" + |
|
|
|
" \"type\": \"long\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"machinePwrStat\": {\n" + |
|
|
|
" \"type\": \"integer\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"currWaitingDuration\": {\n" + |
|
|
|
" \"type\": \"long\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"igStat\": {\n" + |
|
|
|
" \"type\": \"integer\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"currJobDuration\": {\n" + |
|
|
|
" \"type\": \"long\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"currJobCount\": {\n" + |
|
|
|
" \"type\": \"long\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"receivedTime\": {\n" + |
|
|
|
" \"type\": \"date\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"currStoppingDuration\": {\n" + |
|
|
|
" \"type\": \"long\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"id\": {\n" + |
|
|
|
" \"type\": \"long\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"accJobCount\": {\n" + |
|
|
|
" \"type\": \"long\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"dataSource\": {\n" + |
|
|
|
" \"type\": \"integer\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"reportTime\": {\n" + |
|
|
|
" \"type\": \"date\"\n" + |
|
|
|
" }\n" + |
|
|
|
" }\n" + |
|
|
|
" }"; |
|
|
|
" \"properties\": {\n" + |
|
|
|
" \"machineWorkingStat\": {\n" + |
|
|
|
" \"type\": \"integer\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"jobCountOfTheDay\": {\n" + |
|
|
|
" \"type\": \"long\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"machineIotMac\": {\n" + |
|
|
|
" \"type\": \"long\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"machinePwrStat\": {\n" + |
|
|
|
" \"type\": \"integer\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"durationOfThePeriod\": {\n" + |
|
|
|
" \"type\": \"long\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"currWaitingDuration\": {\n" + |
|
|
|
" \"type\": \"long\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"igStat\": {\n" + |
|
|
|
" \"type\": \"integer\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"currJobDuration\": {\n" + |
|
|
|
" \"type\": \"long\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"currJobCount\": {\n" + |
|
|
|
" \"type\": \"long\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"receivedTime\": {\n" + |
|
|
|
" \"type\": \"date\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"currStoppingDuration\": {\n" + |
|
|
|
" \"type\": \"long\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"countOfThePeriod\": {\n" + |
|
|
|
" \"type\": \"long\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"id\": {\n" + |
|
|
|
" \"type\": \"long\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"jobDurationOfTheDay\": {\n" + |
|
|
|
" \"type\": \"long\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"accJobCount\": {\n" + |
|
|
|
" \"type\": \"long\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"dataSource\": {\n" + |
|
|
|
" \"type\": \"integer\"\n" + |
|
|
|
" },\n" + |
|
|
|
" \"reportTime\": {\n" + |
|
|
|
" \"type\": \"date\"\n" + |
|
|
|
" }\n" + |
|
|
|
" }\n" + |
|
|
|
" }"; |
|
|
|
request.mapping(mappersStr, XContentType.JSON); |
|
|
|
// 设置索引别名 |
|
|
|
request.alias(new Alias(ApolloConfig.getStr(ConfigConstant.SINK_ELASTICSEARCH_INDEX))); |
|
|
|
|