Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
97767340
by Tony Chemit at 2020-12-24T08:06:08+01:00
-
4407da5d
by Tony Chemit at 2020-12-24T08:06:37+01:00
2 changed files:
- models/dto/src/main/java/fr/ird/observe/dto/data/ps/consolidate/dcp/SimplifiedObjectTypeSpecializedRules.java
- toolkit/persistence/src/main/java/fr/ird/observe/entities/ObserveTopiaApplicationContextSupport.java
Changes:
| ... | ... | @@ -112,7 +112,7 @@ public class SimplifiedObjectTypeSpecializedRules implements ObserveDto { |
| 112 | 112 |
int currentSize = specializedMappingBuilder.size();
|
| 113 | 113 |
addInheritance(specializedMappingBuilder, standardCodeMapping, tuple, standardCode, dependencies);
|
| 114 | 114 |
int newSize = specializedMappingBuilder.size();
|
| 115 |
- log.info(String.format("Add %d inheritance rules for main rule: %s", newSize - currentSize, tuple));
|
|
| 115 |
+ log.debug(String.format("Add %d inheritance rules for main rule: %s", newSize - currentSize, tuple));
|
|
| 116 | 116 |
|
| 117 | 117 |
}
|
| 118 | 118 |
log.info(String.format("Found %d rules (from %d main rules).", specializedMappingBuilder.size(), rules.size()));
|
| ... | ... | @@ -120,7 +120,7 @@ public class SimplifiedObjectTypeSpecializedRules implements ObserveDto { |
| 120 | 120 |
}
|
| 121 | 121 |
|
| 122 | 122 |
private void addInheritance(Map<ImmutableSet<SimplifiedObjectTypeNode>, String> specializedMappingBuilder, Map<String, SimplifiedObjectTypeNode> standardCodeMapping, ImmutableSet<SimplifiedObjectTypeNode> tuple, String standardCode, Map<SimplifiedObjectTypeNode, Set<SimplifiedObjectTypeNode>> dependencies) {
|
| 123 |
- log.info(String.format("Add inheritance for standard code: %s on tuple: %s", standardCode, tuple));
|
|
| 123 |
+ log.debug(String.format("Add inheritance for standard code: %s on tuple: %s", standardCode, tuple));
|
|
| 124 | 124 |
int size = tuple.size();
|
| 125 | 125 |
@SuppressWarnings("unchecked") List<SimplifiedObjectTypeNode>[] dependenciesTuples = (List<SimplifiedObjectTypeNode>[]) Array.newInstance(List.class, size);
|
| 126 | 126 |
int index = 0;
|
| ... | ... | @@ -154,18 +154,18 @@ public class SimplifiedObjectTypeSpecializedRules implements ObserveDto { |
| 154 | 154 |
SimplifiedObjectTypeNode thisNode = standardCodeMapping.get(standardCode);
|
| 155 | 155 |
SimplifiedObjectTypeNode otherNode = standardCodeMapping.get(existingStandardCode);
|
| 156 | 156 |
if (thisNode.getLevel() < otherNode.getLevel()) {
|
| 157 |
- log.debug(String.format("Mismatch standard code (found: %s, wants to set: %s) - reject it since less specialized for tuple: %s", existingStandardCode, standardCode, currentTuple));
|
|
| 157 |
+ log.trace(String.format("Mismatch standard code (found: %s, wants to set: %s) - reject it since less specialized for tuple: %s", existingStandardCode, standardCode, currentTuple));
|
|
| 158 | 158 |
} else {
|
| 159 | 159 |
keepRule = true;
|
| 160 |
- log.debug(String.format("Mismatch standard code (found: %s, wants to set: %s) - accept it more specialized for tuple: %s", existingStandardCode, standardCode, currentTuple));
|
|
| 160 |
+ log.trace(String.format("Mismatch standard code (found: %s, wants to set: %s) - accept it more specialized for tuple: %s", existingStandardCode, standardCode, currentTuple));
|
|
| 161 | 161 |
}
|
| 162 | 162 |
}
|
| 163 | 163 |
}
|
| 164 | 164 |
if (keepRule) {
|
| 165 |
- log.info(String.format("[%d/%d] Set standard code: %s for tuple: %s", currentIndex + 1, count, standardCode, Arrays.toString(indexTuples)));
|
|
| 165 |
+ log.debug(String.format("[%d/%d] Set standard code: %s for tuple: %s", currentIndex + 1, count, standardCode, Arrays.toString(indexTuples)));
|
|
| 166 | 166 |
specializedMappingBuilder.put(currentTuple, standardCode);
|
| 167 | 167 |
} else {
|
| 168 |
- log.info(String.format("[%d/%d] Reject set standard code: %s for tuple: %s", currentIndex + 1, count, standardCode, Arrays.toString(indexTuples)));
|
|
| 168 |
+ log.debug(String.format("[%d/%d] Reject set standard code: %s for tuple: %s", currentIndex + 1, count, standardCode, Arrays.toString(indexTuples)));
|
|
| 169 | 169 |
}
|
| 170 | 170 |
}
|
| 171 | 171 |
|
| ... | ... | @@ -24,7 +24,6 @@ package fr.ird.observe.entities; |
| 24 | 24 |
|
| 25 | 25 |
import com.google.common.collect.ImmutableSet;
|
| 26 | 26 |
import fr.ird.observe.dto.referential.ReferentialDto;
|
| 27 |
-import io.ultreia.java4all.util.SingletonSupplier;
|
|
| 28 | 27 |
import org.apache.logging.log4j.LogManager;
|
| 29 | 28 |
import org.apache.logging.log4j.Logger;
|
| 30 | 29 |
import org.hibernate.tool.hbm2ddl.SchemaExport;
|
| ... | ... | @@ -81,15 +80,15 @@ public abstract class ObserveTopiaApplicationContextSupport<P extends ObserveTop |
| 81 | 80 |
/**
|
| 82 | 81 |
* Meta model support.
|
| 83 | 82 |
*/
|
| 84 |
- private transient SingletonSupplier<TopiaMetadataModelSupport> topiaMetadataModelSupport;
|
|
| 83 |
+ private transient TopiaMetadataModelSupport topiaMetadataModelSupport;
|
|
| 85 | 84 |
/**
|
| 86 | 85 |
* Entity sql support.
|
| 87 | 86 |
*/
|
| 88 |
- private transient SingletonSupplier<TopiaEntitySqlModelSupport> topiaEntitySqlModelSupport;
|
|
| 87 |
+ private transient TopiaEntitySqlModelSupport topiaEntitySqlModelSupport;
|
|
| 89 | 88 |
/**
|
| 90 | 89 |
* Usage model.
|
| 91 | 90 |
*/
|
| 92 |
- private transient SingletonSupplier<TopiaUsageModel> topiaUsageModel;
|
|
| 91 |
+ private transient TopiaUsageModel topiaUsageModel;
|
|
| 93 | 92 |
|
| 94 | 93 |
public ObserveTopiaApplicationContextSupport(TopiaConfiguration topiaConfiguration) {
|
| 95 | 94 |
super(topiaConfiguration);
|
| ... | ... | @@ -117,16 +116,16 @@ public abstract class ObserveTopiaApplicationContextSupport<P extends ObserveTop |
| 117 | 116 |
|
| 118 | 117 |
public TopiaUsageModel getTopiaUsageModel() {
|
| 119 | 118 |
if (topiaUsageModel == null) {
|
| 120 |
- topiaUsageModel = SingletonSupplier.of(this::newUsageModel);
|
|
| 119 |
+ topiaUsageModel = newUsageModel();
|
|
| 121 | 120 |
}
|
| 122 |
- return topiaUsageModel.get();
|
|
| 121 |
+ return topiaUsageModel;
|
|
| 123 | 122 |
}
|
| 124 | 123 |
|
| 125 | 124 |
public TopiaEntitySqlModelSupport getTopiaEntitySqlModelSupport() {
|
| 126 | 125 |
if (topiaEntitySqlModelSupport == null) {
|
| 127 |
- topiaEntitySqlModelSupport = SingletonSupplier.of(this::newEntitySqlModelSupport);
|
|
| 126 |
+ topiaEntitySqlModelSupport = newEntitySqlModelSupport();
|
|
| 128 | 127 |
}
|
| 129 |
- return topiaEntitySqlModelSupport.get();
|
|
| 128 |
+ return topiaEntitySqlModelSupport;
|
|
| 130 | 129 |
}
|
| 131 | 130 |
|
| 132 | 131 |
public final String getAuthenticationToken() {
|
| ... | ... | @@ -135,9 +134,9 @@ public abstract class ObserveTopiaApplicationContextSupport<P extends ObserveTop |
| 135 | 134 |
|
| 136 | 135 |
protected final TopiaMetadataModelSupport getTopiaMetadataModelSupport() {
|
| 137 | 136 |
if (topiaMetadataModelSupport == null) {
|
| 138 |
- topiaMetadataModelSupport = SingletonSupplier.of(this::newMetaModelSupport);
|
|
| 137 |
+ topiaMetadataModelSupport = newMetaModelSupport();
|
|
| 139 | 138 |
}
|
| 140 |
- return topiaMetadataModelSupport.get();
|
|
| 139 |
+ return topiaMetadataModelSupport;
|
|
| 141 | 140 |
}
|
| 142 | 141 |
|
| 143 | 142 |
@Override
|