From 5ba05f42232ff55f87d3a4f7c5c036b395ec1495 Mon Sep 17 00:00:00 2001 From: xiaowuler Date: Sat, 2 Apr 2022 15:15:24 +0800 Subject: [PATCH] commit some codes --- .../jobhandler/TianQingRadarDataHandler.java | 5 --- .../service/impl/RadarService.java | 3 +- .../service/impl/SchemaService.java | 3 +- .../XxlJobExecutorApplicationTests.java | 39 ++++++++++--------- 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/04.系统编码/01.xxl-job/xxl-job-executor/src/main/java/com/ping/chuan/ahpmsdp/xxljobexecutor/jobhandler/TianQingRadarDataHandler.java b/04.系统编码/01.xxl-job/xxl-job-executor/src/main/java/com/ping/chuan/ahpmsdp/xxljobexecutor/jobhandler/TianQingRadarDataHandler.java index 0e84043..aaff762 100644 --- a/04.系统编码/01.xxl-job/xxl-job-executor/src/main/java/com/ping/chuan/ahpmsdp/xxljobexecutor/jobhandler/TianQingRadarDataHandler.java +++ b/04.系统编码/01.xxl-job/xxl-job-executor/src/main/java/com/ping/chuan/ahpmsdp/xxljobexecutor/jobhandler/TianQingRadarDataHandler.java @@ -83,11 +83,6 @@ public class TianQingRadarDataHandler { for(Map.Entry> entry : results.entrySet()){ XxlJobHelper.log("文件:{} 开始解析", entry.getKey().getFileName()); String result = radarService.read(entry); -// if(paramInfo.isWind()){ -// result = dataService.readWindElement(entry); -// }else { -// result = dataService.readRoutineElement(entry, paramInfo.isTemp()); -// } XxlJobHelper.log("文件:{} 解析完成, 结果:{}", entry.getKey().getFileName(), result); } XxlJobHelper.log("文件解析完成"); diff --git a/04.系统编码/01.xxl-job/xxl-job-executor/src/main/java/com/ping/chuan/ahpmsdp/xxljobexecutor/service/impl/RadarService.java b/04.系统编码/01.xxl-job/xxl-job-executor/src/main/java/com/ping/chuan/ahpmsdp/xxljobexecutor/service/impl/RadarService.java index 6f79cd5..1adb112 100644 --- a/04.系统编码/01.xxl-job/xxl-job-executor/src/main/java/com/ping/chuan/ahpmsdp/xxljobexecutor/service/impl/RadarService.java +++ b/04.系统编码/01.xxl-job/xxl-job-executor/src/main/java/com/ping/chuan/ahpmsdp/xxljobexecutor/service/impl/RadarService.java @@ -69,6 +69,7 @@ public class RadarService implements IRadarService { put("site_configuration", GZipUtils.toList(GZipUtils.compress(mapper.writeValueAsBytes(commonBlock.getSiteConfiguration())))); put("task_configuration", GZipUtils.toList(GZipUtils.compress(mapper.writeValueAsBytes(commonBlock.getTaskConfiguration())))); put("generic_header", GZipUtils.toList(GZipUtils.compress(mapper.writeValueAsBytes(commonBlock.getGenericHeader())))); + put("cut_configurations", GZipUtils.toList(GZipUtils.compress(mapper.writeValueAsBytes(commonBlock.getCutConfigurations())))); }}; } @@ -80,7 +81,7 @@ public class RadarService implements IRadarService { MomentBlock momentBlock = tr.getMomentBlocks().stream().filter(mb -> mb.getMomentHeader().getDataType() == 1).findAny().orElse(null); return new RadialBlock(tr.getRadialHeader(), momentBlock); }).collect(Collectors.toList()); - columns.put("col_%s".formatted(index), GZipUtils.toList(GZipUtils.compress(mapper.writeValueAsBytes(new RadarBlock(cutConfigurations.get(index), radialBlocks))))); + columns.put("col_%s".formatted(index), GZipUtils.toList(GZipUtils.compress(mapper.writeValueAsBytes(new RadarBlock(null, radialBlocks))))); } } } diff --git a/04.系统编码/01.xxl-job/xxl-job-executor/src/main/java/com/ping/chuan/ahpmsdp/xxljobexecutor/service/impl/SchemaService.java b/04.系统编码/01.xxl-job/xxl-job-executor/src/main/java/com/ping/chuan/ahpmsdp/xxljobexecutor/service/impl/SchemaService.java index f0233e4..7c285cb 100644 --- a/04.系统编码/01.xxl-job/xxl-job-executor/src/main/java/com/ping/chuan/ahpmsdp/xxljobexecutor/service/impl/SchemaService.java +++ b/04.系统编码/01.xxl-job/xxl-job-executor/src/main/java/com/ping/chuan/ahpmsdp/xxljobexecutor/service/impl/SchemaService.java @@ -93,10 +93,11 @@ public class SchemaService implements ISchemaService { } private Map toColumn(int length){ - Map columns = new LinkedHashMap<>(length + 4){{ + Map columns = new LinkedHashMap<>(length + 5){{ put("site_configuration", DataType.frozenList(DataType.cint())); put("task_configuration", DataType.frozenList(DataType.cint())); put("generic_header", DataType.frozenList(DataType.cint())); + put("cut_configurations", DataType.frozenList(DataType.cint())); }}; for(int index = 0; index < length; index++){ diff --git a/04.系统编码/01.xxl-job/xxl-job-executor/src/test/java/com/ping/chuan/ahpmsdp/xxljobexecutor/XxlJobExecutorApplicationTests.java b/04.系统编码/01.xxl-job/xxl-job-executor/src/test/java/com/ping/chuan/ahpmsdp/xxljobexecutor/XxlJobExecutorApplicationTests.java index 167940f..b57a00f 100644 --- a/04.系统编码/01.xxl-job/xxl-job-executor/src/test/java/com/ping/chuan/ahpmsdp/xxljobexecutor/XxlJobExecutorApplicationTests.java +++ b/04.系统编码/01.xxl-job/xxl-job-executor/src/test/java/com/ping/chuan/ahpmsdp/xxljobexecutor/XxlJobExecutorApplicationTests.java @@ -72,6 +72,7 @@ class XxlJobExecutorApplicationTests { //// netcdfFile.getVariables().get(0).read() //// }); // System.out.println("ssss"); + schemaService.buildKeySpace(); } @Test @@ -156,25 +157,25 @@ class XxlJobExecutorApplicationTests { private List> createMetaInfos(){ List> metaInfos = new ArrayList<>(); -// metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "VIS", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Visibility_surface")); -// metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "RHU", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Relative_humidity_height_above_ground")); -// metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "TEM", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Temperature_height_above_ground")); -// metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "WIN_U", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "u-component_of_wind_height_above_ground")); -// metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "WIN_V", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "v-component_of_wind_height_above_ground")); -// metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MNRHU", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Fraction_of_snow_cover_height_above_ground")); -// metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MNT", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Minimum_temperature_height_above_ground")); -// metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MXRHU", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "VAR0-1-122_FROM_38-0--1_height_above_ground")); -// metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MXT", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Maximum_temperature_height_above_ground")); -// metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MXWIN_U", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "VAR0-2-102_FROM_38-0--1_height_above_ground")); -// metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MXWIN_V", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "VAR0-2-103_FROM_38-0--1_height_above_ground")); -// metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "TMP", 180, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 180, "H", 60, 30, 30, "Temperature_height_above_ground")); -// metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "EDA10_U", 180, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 180, "H", 60, 30, 30, "u-component_of_wind_height_above_ground")); -// metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "EDA10_V", 180, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 180, "H", 60, 30, 30, "v-component_of_wind_height_above_ground")); -// metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "ER03", 180, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 180, "H", 60, 30, 30, "Total_precipitation_surface_3_Hour_Accumulation")); -// metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "PPH", 180, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 180, "H", 60, 30, 30, "Precipitation_type_surface_3_Hour_Accumulation")); -// metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "TMAX", 1440, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 1440, "H", 60, 30, 30, "Maximum_temperature_height_above_ground_24_Hour_Maximum")); -// metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "TMIN", 1440, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 1440, "H", 60, 30, 30, "Minimum_temperature_height_above_ground_24_Hour_Minimum")); -// metaInfos.add(Lists.newArrayList("CMPA", "BABJ", "PRE", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Total_precipitation_surface")); + metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "VIS", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Visibility_surface")); + metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "RHU", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Relative_humidity_height_above_ground")); + metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "TEM", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Temperature_height_above_ground")); + metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "WIN_U", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "u-component_of_wind_height_above_ground")); + metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "WIN_V", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "v-component_of_wind_height_above_ground")); + metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MNRHU", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Fraction_of_snow_cover_height_above_ground")); + metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MNT", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Minimum_temperature_height_above_ground")); + metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MXRHU", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "VAR0-1-122_FROM_38-0--1_height_above_ground")); + metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MXT", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Maximum_temperature_height_above_ground")); + metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MXWIN_U", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "VAR0-2-102_FROM_38-0--1_height_above_ground")); + metaInfos.add(Lists.newArrayList("CLDAS", "BABJ", "MXWIN_V", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "VAR0-2-103_FROM_38-0--1_height_above_ground")); + metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "TMP", 180, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 180, "H", 60, 30, 30, "Temperature_height_above_ground")); + metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "EDA10_U", 180, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 180, "H", 60, 30, 30, "u-component_of_wind_height_above_ground")); + metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "EDA10_V", 180, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 180, "H", 60, 30, 30, "v-component_of_wind_height_above_ground")); + metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "ER03", 180, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 180, "H", 60, 30, 30, "Total_precipitation_surface_3_Hour_Accumulation")); + metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "PPH", 180, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 180, "H", 60, 30, 30, "Precipitation_type_surface_3_Hour_Accumulation")); + metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "TMAX", 1440, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 1440, "H", 60, 30, 30, "Maximum_temperature_height_above_ground_24_Hour_Maximum")); + metaInfos.add(Lists.newArrayList("SPCC", "BEHF", "TMIN", 1440, 4320, 1010, "243_221_0.025_0.025_29_35.05_114.5_120", 1440, "H", 60, 30, 30, "Minimum_temperature_height_above_ground_24_Hour_Minimum")); + metaInfos.add(Lists.newArrayList("CMPA", "BABJ", "PRE", 60, 60, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "H", 60, 60, 70, "Total_precipitation_surface")); metaInfos.add(Lists.newArrayList("RADAR", "SAD", "CAP", 6, 6, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "m", 6, 6, 70, "")); metaInfos.add(Lists.newArrayList("RADAR", "CC", "CAP", 6, 6, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "m", 6, 6, 70, "")); metaInfos.add(Lists.newArrayList("RADAR", "SA", "CAP", 6, 6, 1010, "1201_1401_0.05_0.05_0_60_70_140", 0, "m", 6, 6, 70, ""));