Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 97767340 by Tony Chemit at 2020-12-24T08:06:08+01:00 low log level - - - - - 4407da5d by Tony Chemit at 2020-12-24T08:06:37+01:00 no more need of singleton supplier since we apply some lazy instances now. - - - - - 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: ===================================== models/dto/src/main/java/fr/ird/observe/dto/data/ps/consolidate/dcp/SimplifiedObjectTypeSpecializedRules.java ===================================== @@ -112,7 +112,7 @@ public class SimplifiedObjectTypeSpecializedRules implements ObserveDto { int currentSize = specializedMappingBuilder.size(); addInheritance(specializedMappingBuilder, standardCodeMapping, tuple, standardCode, dependencies); int newSize = specializedMappingBuilder.size(); - log.info(String.format("Add %d inheritance rules for main rule: %s", newSize - currentSize, tuple)); + log.debug(String.format("Add %d inheritance rules for main rule: %s", newSize - currentSize, tuple)); } log.info(String.format("Found %d rules (from %d main rules).", specializedMappingBuilder.size(), rules.size())); @@ -120,7 +120,7 @@ public class SimplifiedObjectTypeSpecializedRules implements ObserveDto { } private void addInheritance(Map<ImmutableSet<SimplifiedObjectTypeNode>, String> specializedMappingBuilder, Map<String, SimplifiedObjectTypeNode> standardCodeMapping, ImmutableSet<SimplifiedObjectTypeNode> tuple, String standardCode, Map<SimplifiedObjectTypeNode, Set<SimplifiedObjectTypeNode>> dependencies) { - log.info(String.format("Add inheritance for standard code: %s on tuple: %s", standardCode, tuple)); + log.debug(String.format("Add inheritance for standard code: %s on tuple: %s", standardCode, tuple)); int size = tuple.size(); @SuppressWarnings("unchecked") List<SimplifiedObjectTypeNode>[] dependenciesTuples = (List<SimplifiedObjectTypeNode>[]) Array.newInstance(List.class, size); int index = 0; @@ -154,18 +154,18 @@ public class SimplifiedObjectTypeSpecializedRules implements ObserveDto { SimplifiedObjectTypeNode thisNode = standardCodeMapping.get(standardCode); SimplifiedObjectTypeNode otherNode = standardCodeMapping.get(existingStandardCode); if (thisNode.getLevel() < otherNode.getLevel()) { - log.debug(String.format("Mismatch standard code (found: %s, wants to set: %s) - reject it since less specialized for tuple: %s", existingStandardCode, standardCode, currentTuple)); + log.trace(String.format("Mismatch standard code (found: %s, wants to set: %s) - reject it since less specialized for tuple: %s", existingStandardCode, standardCode, currentTuple)); } else { keepRule = true; - log.debug(String.format("Mismatch standard code (found: %s, wants to set: %s) - accept it more specialized for tuple: %s", existingStandardCode, standardCode, currentTuple)); + log.trace(String.format("Mismatch standard code (found: %s, wants to set: %s) - accept it more specialized for tuple: %s", existingStandardCode, standardCode, currentTuple)); } } } if (keepRule) { - log.info(String.format("[%d/%d] Set standard code: %s for tuple: %s", currentIndex + 1, count, standardCode, Arrays.toString(indexTuples))); + log.debug(String.format("[%d/%d] Set standard code: %s for tuple: %s", currentIndex + 1, count, standardCode, Arrays.toString(indexTuples))); specializedMappingBuilder.put(currentTuple, standardCode); } else { - log.info(String.format("[%d/%d] Reject set standard code: %s for tuple: %s", currentIndex + 1, count, standardCode, Arrays.toString(indexTuples))); + log.debug(String.format("[%d/%d] Reject set standard code: %s for tuple: %s", currentIndex + 1, count, standardCode, Arrays.toString(indexTuples))); } } ===================================== toolkit/persistence/src/main/java/fr/ird/observe/entities/ObserveTopiaApplicationContextSupport.java ===================================== @@ -24,7 +24,6 @@ package fr.ird.observe.entities; import com.google.common.collect.ImmutableSet; import fr.ird.observe.dto.referential.ReferentialDto; -import io.ultreia.java4all.util.SingletonSupplier; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.hibernate.tool.hbm2ddl.SchemaExport; @@ -81,15 +80,15 @@ public abstract class ObserveTopiaApplicationContextSupport<P extends ObserveTop /** * Meta model support. */ - private transient SingletonSupplier<TopiaMetadataModelSupport> topiaMetadataModelSupport; + private transient TopiaMetadataModelSupport topiaMetadataModelSupport; /** * Entity sql support. */ - private transient SingletonSupplier<TopiaEntitySqlModelSupport> topiaEntitySqlModelSupport; + private transient TopiaEntitySqlModelSupport topiaEntitySqlModelSupport; /** * Usage model. */ - private transient SingletonSupplier<TopiaUsageModel> topiaUsageModel; + private transient TopiaUsageModel topiaUsageModel; public ObserveTopiaApplicationContextSupport(TopiaConfiguration topiaConfiguration) { super(topiaConfiguration); @@ -117,16 +116,16 @@ public abstract class ObserveTopiaApplicationContextSupport<P extends ObserveTop public TopiaUsageModel getTopiaUsageModel() { if (topiaUsageModel == null) { - topiaUsageModel = SingletonSupplier.of(this::newUsageModel); + topiaUsageModel = newUsageModel(); } - return topiaUsageModel.get(); + return topiaUsageModel; } public TopiaEntitySqlModelSupport getTopiaEntitySqlModelSupport() { if (topiaEntitySqlModelSupport == null) { - topiaEntitySqlModelSupport = SingletonSupplier.of(this::newEntitySqlModelSupport); + topiaEntitySqlModelSupport = newEntitySqlModelSupport(); } - return topiaEntitySqlModelSupport.get(); + return topiaEntitySqlModelSupport; } public final String getAuthenticationToken() { @@ -135,9 +134,9 @@ public abstract class ObserveTopiaApplicationContextSupport<P extends ObserveTop protected final TopiaMetadataModelSupport getTopiaMetadataModelSupport() { if (topiaMetadataModelSupport == null) { - topiaMetadataModelSupport = SingletonSupplier.of(this::newMetaModelSupport); + topiaMetadataModelSupport = newMetaModelSupport(); } - return topiaMetadataModelSupport.get(); + return topiaMetadataModelSupport; } @Override View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/c0cb65a8383c57afbd6026200... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/c0cb65a8383c57afbd6026200... You're receiving this email because of your account on gitlab.com.