dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #35848
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18363: Data value import, preheat cache for data element
------------------------------------------------------------
revno: 18363
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-02-20 14:45:23 +0100
message:
Data value import, preheat cache for data element
modified:
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java 2015-02-20 12:35:55 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java 2015-02-20 13:45:23 +0000
@@ -625,8 +625,8 @@
// Create meta-data maps
//----------------------------------------------------------------------
- Map<String, DataElement> dataElementMap = identifiableObjectManager.getIdMap( DataElement.class, dataElementIdScheme );
- CachingMap<String, OrganisationUnit> orgUnitMap = new CachingMap<String, OrganisationUnit>();
+ CachingMap<String, DataElement> dataElementMap = new CachingMap<>();
+ CachingMap<String, OrganisationUnit> orgUnitMap = new CachingMap<>();
Map<String, DataElementCategoryOptionCombo> categoryOptionComboMap = identifiableObjectManager.getIdMap( DataElementCategoryOptionCombo.class, idScheme );
Map<String, Period> periodMap = new HashMap<>();
@@ -636,7 +636,8 @@
if ( importOptions.isPreheatCache() )
{
- notifier.notify( id, "Loading organisation units" );
+ notifier.notify( id, "Loading data elements and organisation units" );
+ dataElementMap.putAll( identifiableObjectManager.getIdMap( DataElement.class, dataElementIdScheme ) );
orgUnitMap.putAll( getOrgUnitMap( orgUnitIdScheme ) );
}
@@ -723,7 +724,8 @@
totalCount++;
- DataElement dataElement = dataElementMap.get( trimToNull( dataValue.getDataElement() ) );
+ DataElement dataElement = dataElementMap.get( trimToNull( dataValue.getDataElement() ),
+ new IdentifiableObjectCallable<>( identifiableObjectManager, DataElement.class, trimToNull( dataValue.getDataElement() ) ) );
Period period = outerPeriod != null ? outerPeriod : PeriodType.getPeriodFromIsoString( trimToNull( dataValue.getPeriod() ) );
OrganisationUnit orgUnit = outerOrgUnit != null ? outerOrgUnit : orgUnitMap.get( trimToNull( dataValue.getOrgUnit() ),
new IdentifiableObjectCallable<>( identifiableObjectManager, OrganisationUnit.class, trimToNull( dataValue.getOrgUnit() ) ) );