1.调整influxdb插入数量
This commit is contained in:
@@ -67,9 +67,8 @@ public class InfluxdbDataFlickerImpl extends MppServiceImpl<RStatDataFlickerRela
|
||||
}
|
||||
|
||||
List<DataFlicker> collect = dataFlickerDTOList.stream().map(temp -> DataFlicker.relationToInfluxDB(temp)).collect(Collectors.toList());
|
||||
int minSize = Math.min(1200000, collect.size());
|
||||
|
||||
List<List<DataFlicker>> partition = ListUtils.partition(collect, minSize);
|
||||
List<List<DataFlicker>> partition = ListUtils.partition(collect, 20000);
|
||||
for (List<DataFlicker> dataFlickerList : partition) {
|
||||
List<DataFlicker> sublistAsOriginalListType = new ArrayList<>(dataFlickerList);
|
||||
|
||||
|
||||
@@ -65,9 +65,8 @@ public class InfluxdbDataFlucImpl extends MppServiceImpl<RStatDataFlucRelationMa
|
||||
}
|
||||
|
||||
List<DataFluc> collect = dataFlucDTOList.stream().map(temp -> DataFluc.relationToInfluxDB(temp)).collect(Collectors.toList());
|
||||
int minSize = Math.min(1200000, collect.size());
|
||||
|
||||
List<List<DataFluc>> partition = ListUtils.partition(collect, minSize);
|
||||
List<List<DataFluc>> partition = ListUtils.partition(collect, 20000);
|
||||
for (List<DataFluc> dataFlucList : partition) {
|
||||
List<DataFluc> sublistAsOriginalListType = new ArrayList<>(dataFlucList);
|
||||
|
||||
|
||||
@@ -84,9 +84,8 @@ public class InfluxdbDataHarmRateVImpl extends MppServiceImpl<RStatDataHarmRateV
|
||||
}
|
||||
|
||||
List<DataHarmrateV> collect = dataHarmrateVDTOList.stream().flatMap(temp -> DataHarmrateV.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
||||
int minSize = Math.min(1200000, collect.size());
|
||||
|
||||
List<List<DataHarmrateV>> partition = ListUtils.partition(collect, minSize);
|
||||
List<List<DataHarmrateV>> partition = ListUtils.partition(collect, 20000);
|
||||
for (List<DataHarmrateV> dataHarmrateVList : partition) {
|
||||
List<DataHarmrateV> sublistAsOriginalListType = new ArrayList<>(dataHarmrateVList);
|
||||
|
||||
|
||||
@@ -66,9 +66,8 @@ public class InfluxdbDataHarmphasicIImpl extends MppServiceImpl<RStatDataHarmPha
|
||||
}
|
||||
|
||||
List<DataHarmphasicI> collect = dataHarmphasicIDTOList.stream().flatMap(temp -> DataHarmphasicI.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
||||
int minSize = Math.min(1200000, collect.size());
|
||||
|
||||
List<List<DataHarmphasicI>> partition = ListUtils.partition(collect, minSize);
|
||||
List<List<DataHarmphasicI>> partition = ListUtils.partition(collect, 20000);
|
||||
for (List<DataHarmphasicI> dataHarmphasicIList : partition) {
|
||||
List<DataHarmphasicI> sublistAsOriginalListType = new ArrayList<>(dataHarmphasicIList);
|
||||
dataHarmphasicIMapper.insertBatch(sublistAsOriginalListType);
|
||||
|
||||
@@ -70,9 +70,8 @@ public class InfluxdbDataHarmphasicVImpl extends MppServiceImpl<RStatDataHarmPha
|
||||
}
|
||||
|
||||
List<DataHarmphasicV> collect = dataHarmphasicVDTOList.stream().flatMap(temp -> DataHarmphasicV.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
||||
int minSize = Math.min(1200000, collect.size());
|
||||
|
||||
List<List<DataHarmphasicV>> partition = ListUtils.partition(collect, minSize);
|
||||
List<List<DataHarmphasicV>> partition = ListUtils.partition(collect, 20000);
|
||||
for (List<DataHarmphasicV> dataHarmphasicVList : partition) {
|
||||
List<DataHarmphasicV> sublistAsOriginalListType = new ArrayList<>(dataHarmphasicVList);
|
||||
|
||||
|
||||
@@ -70,9 +70,8 @@ public class InfluxdbDataHarmpowerPImpl extends MppServiceImpl<RStatDataHarmPowe
|
||||
return;
|
||||
}
|
||||
List<DataHarmpowerP> collect = dataHarmpowerPDTOList.stream().flatMap(temp -> DataHarmpowerP.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
||||
int minSize = Math.min(1200000, collect.size());
|
||||
|
||||
List<List<DataHarmpowerP>> partition = ListUtils.partition(collect, minSize);
|
||||
List<List<DataHarmpowerP>> partition = ListUtils.partition(collect, 20000);
|
||||
for (List<DataHarmpowerP> dataHarmpowerPList : partition) {
|
||||
List<DataHarmpowerP> sublistAsOriginalListType = new ArrayList<>(dataHarmpowerPList);
|
||||
|
||||
|
||||
@@ -66,9 +66,8 @@ public class InfluxdbDataHarmpowerQImpl extends MppServiceImpl<RStatDataHarmPowe
|
||||
return;
|
||||
}
|
||||
List<DataHarmpowerQ> collect = dataHarmpowerQDTOList.stream().flatMap(temp -> DataHarmpowerQ.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
||||
int minSize = Math.min(1200000, collect.size());
|
||||
|
||||
List<List<DataHarmpowerQ>> partition = ListUtils.partition(collect, minSize);
|
||||
List<List<DataHarmpowerQ>> partition = ListUtils.partition(collect, 20000);
|
||||
for (List<DataHarmpowerQ> dataHarmpowerQList : partition) {
|
||||
List<DataHarmpowerQ> sublistAsOriginalListType = new ArrayList<>(dataHarmpowerQList);
|
||||
|
||||
|
||||
@@ -66,9 +66,8 @@ public class InfluxdbDataHarmpowerSImpl extends MppServiceImpl<RStatDataHarmPowe
|
||||
return;
|
||||
}
|
||||
List<DataHarmpowerS> collect = dataHarmpowerSDTOList.stream().flatMap(temp -> DataHarmpowerS.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
||||
int minSize = Math.min(1200000, collect.size());
|
||||
|
||||
List<List<DataHarmpowerS>> partition = ListUtils.partition(collect, minSize);
|
||||
List<List<DataHarmpowerS>> partition = ListUtils.partition(collect, 20000);
|
||||
for (List<DataHarmpowerS> dataHarmpowerSList : partition) {
|
||||
List<DataHarmpowerS> sublistAsOriginalListType = new ArrayList<>(dataHarmpowerSList);
|
||||
|
||||
|
||||
@@ -69,9 +69,8 @@ public class InfluxdbDataIImpl extends MppServiceImpl<RStatDataIRelationMapper,
|
||||
return;
|
||||
}
|
||||
List<DataI> collect = dataIDTOList.stream().flatMap(temp -> DataI.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
||||
int minSize = Math.min(1200000, collect.size());
|
||||
|
||||
List<List<DataI>> partition = ListUtils.partition(collect, minSize);
|
||||
List<List<DataI>> partition = ListUtils.partition(collect, 20000);
|
||||
for (List<DataI> dataIList : partition) {
|
||||
List<DataI> sublistAsOriginalListType = new ArrayList<>(dataIList);
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public class InfluxdbDataInharmIImpl extends MppServiceImpl<RStatDataInHarmIRela
|
||||
List<DataInharmI> collect = dataInharmIDTOList.stream().flatMap(temp -> DataInharmI.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
||||
int minSize = Math.min(1200000, collect.size());
|
||||
|
||||
List<List<DataInharmI>> partition = ListUtils.partition(collect, minSize);
|
||||
List<List<DataInharmI>> partition = ListUtils.partition(collect, 20000);
|
||||
for (List<DataInharmI> dataInharmIList : partition) {
|
||||
List<DataInharmI> sublistAsOriginalListType = new ArrayList<>(dataInharmIList);
|
||||
|
||||
|
||||
@@ -68,9 +68,8 @@ public class InfluxdbDataInharmVImpl extends MppServiceImpl<RStatDataInHarmVRela
|
||||
return;
|
||||
}
|
||||
List<DataInharmV> collect = dataInharmVDTOList.stream().flatMap(temp -> DataInharmV.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
||||
int minSize = Math.min(1200000, collect.size());
|
||||
|
||||
List<List<DataInharmV>> partition = ListUtils.partition(collect, minSize);
|
||||
List<List<DataInharmV>> partition = ListUtils.partition(collect, 20000);
|
||||
for (List<DataInharmV> dataInharmVList : partition) {
|
||||
List<DataInharmV> sublistAsOriginalListType = new ArrayList<>(dataInharmVList);
|
||||
|
||||
|
||||
@@ -66,9 +66,8 @@ public class InfluxdbDataPltImpl extends MppServiceImpl<RStatDataPltRelationMapp
|
||||
}
|
||||
|
||||
List<DataPlt> collect = dataPltDTOList.stream().map(temp -> DataPlt.relationToInfluxDB(temp)).collect(Collectors.toList());
|
||||
int minSize = Math.min(1200000, collect.size());
|
||||
|
||||
List<List<DataPlt>> partition = ListUtils.partition(collect, minSize);
|
||||
List<List<DataPlt>> partition = ListUtils.partition(collect, 20000);
|
||||
for (List<DataPlt> dataPltList : partition) {
|
||||
List<DataPlt> sublistAsOriginalListType = new ArrayList<>(dataPltList);
|
||||
|
||||
|
||||
@@ -111,9 +111,8 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
||||
return;
|
||||
}
|
||||
List<DataV> collect = dataVDTOList.stream().flatMap(temp -> DataV.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
||||
int minSize = Math.min(1200000, collect.size());
|
||||
|
||||
List<List<DataV>> partition = ListUtils.partition(collect, minSize);
|
||||
List<List<DataV>> partition = ListUtils.partition(collect, 20000);
|
||||
for (List<DataV> dataVList : partition) {
|
||||
List<DataV> sublistAsOriginalListType = new ArrayList<>(dataVList);
|
||||
|
||||
@@ -370,12 +369,10 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
||||
return dataV;
|
||||
|
||||
}).collect(Collectors.toList());
|
||||
int minSize = Math.min(1200000, collect.size());
|
||||
|
||||
List<List<DataV>> partition = ListUtils.partition(collect, minSize);
|
||||
List<List<DataV>> partition = ListUtils.partition(collect, 20000);
|
||||
for (List<DataV> dataVList : partition) {
|
||||
List<DataV> sublistAsOriginalListType = new ArrayList<>(dataVList);
|
||||
|
||||
dataVMapper.insertBatch(sublistAsOriginalListType);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user