mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +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.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) {
|
||||
bulkArtifacts.get(eamArtifact.getCorrelationType().getDbTableName()).add(eamArtifact);
|
||||
bulkArtifacts.get(EamDbUtil.correlationTypeToInstanceTableName(eamArtifact.getCorrelationType())).add(eamArtifact);
|
||||
bulkArtifactsCount++;
|
||||
|
||||
if (bulkArtifactsCount >= bulkArtifactsThreshold) {
|
||||
@ -1240,9 +1240,8 @@ abstract class AbstractSqlEamDb implements EamDb {
|
||||
return;
|
||||
}
|
||||
|
||||
for (CorrelationAttributeInstance.Type type : artifactTypes) {
|
||||
for (String tableName : bulkArtifacts.keySet()) {
|
||||
|
||||
String tableName = EamDbUtil.correlationTypeToInstanceTableName(type);
|
||||
String sql
|
||||
= "INSERT INTO "
|
||||
+ tableName
|
||||
@ -1253,8 +1252,7 @@ abstract class AbstractSqlEamDb implements EamDb {
|
||||
|
||||
bulkPs = conn.prepareStatement(sql);
|
||||
|
||||
Collection<CorrelationAttributeInstance> eamArtifacts = bulkArtifacts.get(type.getDbTableName());
|
||||
if (eamArtifacts != null) {
|
||||
Collection<CorrelationAttributeInstance> eamArtifacts = bulkArtifacts.get(tableName);
|
||||
for (CorrelationAttributeInstance eamArtifact : eamArtifacts) {
|
||||
|
||||
if (!eamArtifact.getCorrelationValue().isEmpty()) {
|
||||
@ -1310,9 +1308,9 @@ abstract class AbstractSqlEamDb implements EamDb {
|
||||
}
|
||||
|
||||
bulkPs.executeBatch();
|
||||
bulkArtifacts.get(type.getDbTableName()).clear();
|
||||
}
|
||||
bulkArtifacts.get(tableName).clear();
|
||||
}
|
||||
|
||||
TimingMetric timingMetric = HealthMonitor.getTimingMetric("Correlation Engine: Bulk insert");
|
||||
HealthMonitor.submitTimingMetric(timingMetric);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user