mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 00:16:16 +00:00
4381 loop over keyset for property tables instead of all properties
This commit is contained in:
parent
f687446658
commit
d99863e770
@ -95,7 +95,7 @@ abstract class AbstractSqlEamDb implements EamDb {
|
|||||||
|
|
||||||
defaultCorrelationTypes = CorrelationAttributeInstance.getDefaultCorrelationTypes();
|
defaultCorrelationTypes = CorrelationAttributeInstance.getDefaultCorrelationTypes();
|
||||||
defaultCorrelationTypes.forEach((type) -> {
|
defaultCorrelationTypes.forEach((type) -> {
|
||||||
bulkArtifacts.put(type.getDbTableName(), new ArrayList<>());
|
bulkArtifacts.put(EamDbUtil.correlationTypeToInstanceTableName(type), new ArrayList<>());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1207,7 +1207,7 @@ abstract class AbstractSqlEamDb implements EamDb {
|
|||||||
}
|
}
|
||||||
|
|
||||||
synchronized (bulkArtifacts) {
|
synchronized (bulkArtifacts) {
|
||||||
bulkArtifacts.get(eamArtifact.getCorrelationType().getDbTableName()).add(eamArtifact);
|
bulkArtifacts.get(EamDbUtil.correlationTypeToInstanceTableName(eamArtifact.getCorrelationType())).add(eamArtifact);
|
||||||
bulkArtifactsCount++;
|
bulkArtifactsCount++;
|
||||||
|
|
||||||
if (bulkArtifactsCount >= bulkArtifactsThreshold) {
|
if (bulkArtifactsCount >= bulkArtifactsThreshold) {
|
||||||
@ -1240,9 +1240,8 @@ abstract class AbstractSqlEamDb implements EamDb {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (CorrelationAttributeInstance.Type type : artifactTypes) {
|
for (String tableName : bulkArtifacts.keySet()) {
|
||||||
|
|
||||||
String tableName = EamDbUtil.correlationTypeToInstanceTableName(type);
|
|
||||||
String sql
|
String sql
|
||||||
= "INSERT INTO "
|
= "INSERT INTO "
|
||||||
+ tableName
|
+ tableName
|
||||||
@ -1253,8 +1252,7 @@ abstract class AbstractSqlEamDb implements EamDb {
|
|||||||
|
|
||||||
bulkPs = conn.prepareStatement(sql);
|
bulkPs = conn.prepareStatement(sql);
|
||||||
|
|
||||||
Collection<CorrelationAttributeInstance> eamArtifacts = bulkArtifacts.get(type.getDbTableName());
|
Collection<CorrelationAttributeInstance> eamArtifacts = bulkArtifacts.get(tableName);
|
||||||
if (eamArtifacts != null) {
|
|
||||||
for (CorrelationAttributeInstance eamArtifact : eamArtifacts) {
|
for (CorrelationAttributeInstance eamArtifact : eamArtifacts) {
|
||||||
|
|
||||||
if (!eamArtifact.getCorrelationValue().isEmpty()) {
|
if (!eamArtifact.getCorrelationValue().isEmpty()) {
|
||||||
@ -1310,9 +1308,9 @@ abstract class AbstractSqlEamDb implements EamDb {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bulkPs.executeBatch();
|
bulkPs.executeBatch();
|
||||||
bulkArtifacts.get(type.getDbTableName()).clear();
|
bulkArtifacts.get(tableName).clear();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TimingMetric timingMetric = HealthMonitor.getTimingMetric("Correlation Engine: Bulk insert");
|
TimingMetric timingMetric = HealthMonitor.getTimingMetric("Correlation Engine: Bulk insert");
|
||||||
HealthMonitor.submitTimingMetric(timingMetric);
|
HealthMonitor.submitTimingMetric(timingMetric);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user