← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2798: Impl maintenance function for rebuilding indexes on datamart tables

 

------------------------------------------------------------
revno: 2798
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-02-01 19:55:14 +0100
message:
  Impl maintenance function for rebuilding indexes on datamart tables
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/maintenance/PerformMaintenanceAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/maintenance.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/maintenanceForm.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-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/maintenance/PerformMaintenanceAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/maintenance/PerformMaintenanceAction.java	2010-11-29 14:22:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/maintenance/PerformMaintenanceAction.java	2011-02-01 18:55:14 +0000
@@ -83,18 +83,18 @@
     // Input
     // -------------------------------------------------------------------------
     
-    private boolean aggregatedDataValues;
+    private boolean clearDataMart;
 
-    public void setAggregatedDataValues( boolean aggregatedDataValues )
+    public void setClearDataMart( boolean clearDataMart )
     {
-        this.aggregatedDataValues = aggregatedDataValues;
+        this.clearDataMart = clearDataMart;
     }
 
-    private boolean aggregatedIndicatorValues;
-
-    public void setAggregatedIndicatorValues( boolean aggregatedIndicatorValues )
+    public boolean dataMartIndex;
+    
+    public void setDataMartIndex( boolean dataMartIndex )
     {
-        this.aggregatedIndicatorValues = aggregatedIndicatorValues;
+        this.dataMartIndex = dataMartIndex;
     }
 
     private boolean zeroValues;
@@ -125,18 +125,20 @@
     public String execute() 
         throws Exception
     {
-        if ( aggregatedDataValues )
+        if ( clearDataMart )
         {
             aggregatedDataValueService.deleteAggregatedDataValues();
-            
-            log.info( "Cleared aggregated data values" );
-        }
-        
-        if ( aggregatedIndicatorValues )
-        {
             aggregatedDataValueService.deleteAggregatedIndicatorValues();
             
-            log.info( "Cleared aggregated indicator values" );
+            log.info( "Cleared data mart" );
+        }
+        
+        if ( dataMartIndex )
+        {
+            aggregatedDataValueService.dropIndex( true, true );
+            aggregatedDataValueService.createIndex( true, true );
+            
+            log.info( "Rebuilt data mart indexes" );
         }
         
         if ( zeroValues )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties	2011-01-21 10:26:33 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties	2011-02-01 18:55:14 +0000
@@ -312,4 +312,6 @@
 sqlquery_is_not_allowed                                             = Not allowance to query in the special tables !
 drill_down_real_values                                              = Data entered
 sections_with_invalid_category_combinations                         = Sections with invalid category combinations
-confirm_delete_sqlview                                              = Do you want to delete this sql view object ?
\ No newline at end of file
+confirm_delete_sqlview                                              = Do you want to delete this sql view object ?
+clear_data_mart														= Clear data mart
+rebuild_data_mart_index												= Rebuild data mart index
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/maintenance.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/maintenance.js	2010-11-29 14:22:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/maintenance.js	2011-02-01 18:55:14 +0000
@@ -1,18 +1,18 @@
 
 function performMaintenance()
 {
-    var aggregatedDataValues = document.getElementById( "aggregatedDataValues" ).checked;
-    var aggregatedIndicatorValues = document.getElementById( "aggregatedIndicatorValues" ).checked;
+    var clearDataMart = document.getElementById( "clearDataMart" ).checked;
+    var dataMartIndex = document.getElementById( "dataMartIndex" ).checked;
     var zeroValues = document.getElementById( "zeroValues" ).checked;
     var dataSetCompleteness = document.getElementById( "dataSetCompleteness" ).checked;
     var prunePeriods = document.getElementById( "prunePeriods" ).checked;
     
-    if ( aggregatedDataValues || aggregatedIndicatorValues || zeroValues || dataSetCompleteness || prunePeriods )
+    if ( clearDataMart || dataMartIndex || zeroValues || dataSetCompleteness || prunePeriods )
     {
         setWaitMessage( i18n_performing_maintenance );
         
-        var params = "aggregatedDataValues=" + aggregatedDataValues + 
-            "&aggregatedIndicatorValues=" + aggregatedIndicatorValues +
+        var params = "clearDataMart=" + clearDataMart + 
+            "&dataMartIndex=" + dataMartIndex +
             "&zeroValues=" + zeroValues +
             "&dataSetCompleteness=" + dataSetCompleteness +
             "&prunePeriods=" + prunePeriods;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/maintenanceForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/maintenanceForm.vm	2010-09-21 06:16:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/maintenanceForm.vm	2011-02-01 18:55:14 +0000
@@ -2,13 +2,13 @@
 <h3>$i18n.getString( "maintenance" ) #openHelp( "maintenance" )</h3>
 
 <p>
-	<input type="checkbox" id="aggregatedDataValues"/>
-	<label for="aggregatedDataValues">$i18n.getString( "clear_data_mart_aggregated_datavalues" )</label>
+	<input type="checkbox" id="clearDataMart"/>
+	<label for="clearDataMart">$i18n.getString( "clear_data_mart" )</label>
 </p>
 
 <p>
-	<input type="checkbox" id="aggregatedIndicatorValues"/>
-	<label for="aggregatedIndicatorValues">$i18n.getString( "clear_data_mart_aggregated_indicatorvalues" )</label>
+	<input type="checkbox" id="dataMartIndex"/>
+	<label for="dataMartIndex">$i18n.getString( "rebuild_data_mart_index" )</label>
 </p>
 
 <p>