← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21884: Data value import. Removed the preheat cache option. The import will now never preheat cache, whi...

 

------------------------------------------------------------
revno: 21884
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2016-02-04 17:10:24 +0100
message:
  Data value import. Removed the preheat cache option. The import will now never preheat cache, which is almost always faster.
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java
  dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/datavalue/ImportDataValueAction.java
  dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/importDataValue.vm


--
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	2016-01-12 12:49:50 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java	2016-02-04 16:10:24 +0000
@@ -90,12 +90,10 @@
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
-import java.util.Map;
 import java.util.Optional;
 import java.util.Set;
 
 import static org.apache.commons.lang3.StringUtils.trimToNull;
-import static org.hisp.dhis.common.IdentifiableProperty.UUID;
 import static org.hisp.dhis.system.notification.NotificationLevel.ERROR;
 import static org.hisp.dhis.system.notification.NotificationLevel.INFO;
 import static org.hisp.dhis.system.util.DateUtils.getDefaultDate;
@@ -587,17 +585,9 @@
         CachingMap<String, Optional<Set<String>>> dataElementOptionsMap = new CachingMap<>();
 
         //----------------------------------------------------------------------
-        // Load meta-data maps
+        // Get meta-data maps
         //----------------------------------------------------------------------
 
-        if ( importOptions.isPreheatCache() )
-        {
-            notifier.notify( id, "Loading data elements and organisation units" );
-            dataElementMap.putAll( identifiableObjectManager.getIdMap( DataElement.class, dataElementIdScheme ) );
-            orgUnitMap.putAll( getOrgUnitMap( orgUnitIdScheme ) );
-            clock.logTime( "Preheated data element and organisation unit caches" );
-        }
-
         IdentifiableObjectCallable<DataElement> dataElementCallable = new IdentifiableObjectCallable<>(
             identifiableObjectManager, DataElement.class, dataElementIdScheme, null );
         IdentifiableObjectCallable<OrganisationUnit> orgUnitCallable = new IdentifiableObjectCallable<>(
@@ -982,11 +972,4 @@
 
         summary.setDataSetComplete( DateUtils.getMediumDateString( completeDate ) );
     }
-
-    private Map<String, OrganisationUnit> getOrgUnitMap( IdScheme idScheme )
-    {
-        return idScheme.is( UUID ) ?
-            organisationUnitService.getUuidOrganisationUnitMap() :
-            identifiableObjectManager.getIdMap( OrganisationUnit.class, idScheme );
-    }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/datavalue/ImportDataValueAction.java'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/datavalue/ImportDataValueAction.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/datavalue/ImportDataValueAction.java	2016-02-04 16:10:24 +0000
@@ -137,13 +137,6 @@
         this.importFormat = importFormat;
     }
 
-    private boolean preheatCache = true;
-
-    public void setPreheatCache( boolean preheatCache )
-    {
-        this.preheatCache = preheatCache;
-    }
-
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -163,7 +156,7 @@
         in = StreamUtils.wrapAndCheckCompressionFormat( in );
 
         ImportOptions options = new ImportOptions().setDryRun( dryRun )
-            .setPreheatCache( preheatCache ).setStrategy( strategy ).setSkipExistingCheck( skipExistingCheck )
+            .setStrategy( strategy ).setSkipExistingCheck( skipExistingCheck )
             .setIdScheme( StringUtils.trimToNull( idScheme ) )
             .setDataElementIdScheme( StringUtils.trimToNull( dataElementIdScheme ) )
             .setOrgUnitIdScheme( StringUtils.trimToNull( orgUnitIdScheme ) );

=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/importDataValue.vm'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/importDataValue.vm	2016-01-12 12:49:50 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/importDataValue.vm	2016-02-04 16:10:24 +0000
@@ -75,13 +75,6 @@
 		<option value="true">$i18n.getString( "skip_check_fast" )</option>
     </select></td>
 </tr>
-<tr class="moreOptions" style="display:none">
-	<td>$i18n.getString( "preload_cache" )</td>
-	<td><select id="preheatCache" name="preheatCache" style="width:190px">
-		<option value="false">$i18n.getString( "no" )</option>
-		<option value="true">$i18n.getString( "yes" )</option>
-    </select></td>
-</tr>
 <tr>
 	<td></td>
 	<td><input type="button" value="$i18n.getString( 'import' )" style="width:120px" onclick="importDataValue()"/></td>