← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20113: Cleanup

 

------------------------------------------------------------
revno: 20113
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2015-09-13 19:49:03 +0200
message:
  Cleanup
modified:
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultQueryPlanner.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/JdbcAnalyticsManager.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/partition/JdbcPartitionManager.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/AbstractJdbcTableManager.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-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2015-09-08 18:09:34 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2015-09-13 17:49:03 +0000
@@ -859,11 +859,11 @@
 
         int maxLimit = getMaxLimit();
         
-        Timer t = new Timer().start().disablePrint();
+        Timer timer = new Timer().start().disablePrint();
 
         DataQueryGroups queryGroups = queryPlanner.planQuery( params, optimalQueries, tableName );
 
-        t.getSplitTime( "Planned analytics query, got: " + queryGroups.getLargestGroupSize() + " for optimal: " + optimalQueries );
+        timer.getSplitTime( "Planned analytics query, got: " + queryGroups.getLargestGroupSize() + " for optimal: " + optimalQueries );
 
         Map<String, Object> map = new HashMap<>();
 
@@ -897,7 +897,7 @@
             }
         }
 
-        t.getTime( "Got analytics values" );
+        timer.getTime( "Got analytics values" );
 
         return map;
     }

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultQueryPlanner.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultQueryPlanner.java	2015-08-31 07:45:43 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultQueryPlanner.java	2015-09-13 17:49:03 +0000
@@ -803,7 +803,7 @@
     private AggregationType getAggregationType( ValueType valueType, String aggregationOperator,
         PeriodType aggregationPeriodType, PeriodType dataPeriodType )
     {
-        AggregationType aggregationType;
+        AggregationType aggregationType = null;
 
         boolean disaggregation = isDisaggregation( aggregationOperator, aggregationPeriodType, dataPeriodType );
         boolean number = valueType.isNumeric();

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/JdbcAnalyticsManager.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/JdbcAnalyticsManager.java	2015-08-25 07:19:18 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/JdbcAnalyticsManager.java	2015-09-13 17:49:03 +0000
@@ -136,7 +136,7 @@
 
             log.debug( sql );
 
-            Map<String, Object> map;
+            Map<String, Object> map = null;
 
             try
             {

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java	2015-09-08 18:09:34 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java	2015-09-13 17:49:03 +0000
@@ -217,18 +217,18 @@
             // Data
             // -----------------------------------------------------------------
 
-            Timer t = new Timer().start().disablePrint();
+            Timer timer = new Timer().start().disablePrint();
     
             List<EventQueryParams> queries = queryPlanner.planAggregateQuery( params );
     
-            t.getSplitTime( "Planned event query, got partitions: " + params.getPartitions() );
+            timer.getSplitTime( "Planned event query, got partitions: " + params.getPartitions() );
     
             for ( EventQueryParams query : queries )
             {
                 analyticsManager.getAggregatedEventData( query, grid, maxLimit );
             }
             
-            t.getTime( "Got aggregated events" );
+            timer.getTime( "Got aggregated events" );
             
             if ( maxLimit > 0 && grid.getHeight() > maxLimit )
             {
@@ -330,11 +330,11 @@
         // Data
         // ---------------------------------------------------------------------
 
-        Timer t = new Timer().start();
+        Timer timer = new Timer().start();
 
         params = queryPlanner.planEventQuery( params );
 
-        t.getSplitTime( "Planned event query, got partitions: " + params.getPartitions() );
+        timer.getSplitTime( "Planned event query, got partitions: " + params.getPartitions() );
 
         int count = 0;
 
@@ -347,7 +347,7 @@
     
             analyticsManager.getEvents( params, grid, queryPlanner.getMaxLimit() );
     
-            t.getTime( "Got events " + grid.getHeight() );
+            timer.getTime( "Got events " + grid.getHeight() );
         }
         
         // ---------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/partition/JdbcPartitionManager.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/partition/JdbcPartitionManager.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/partition/JdbcPartitionManager.java	2015-09-13 17:49:03 +0000
@@ -47,8 +47,8 @@
 {
     private static final Log log = LogFactory.getLog( JdbcPartitionManager.class );
     
-    private Set<String> ANALYTICS_PARTITIONS = null;
-    private Set<String> ANALYTICS_EVENT_PARTITIONS = null;
+    private Set<String> analyticsPartitions = null;
+    private Set<String> analyticsEventPartitions = null;
     
     @Autowired
     private JdbcTemplate jdbcTemplate;
@@ -56,9 +56,9 @@
     @Override
     public Set<String> getAnalyticsPartitions()
     {
-        if ( ANALYTICS_PARTITIONS != null )
+        if ( analyticsPartitions != null )
         {
-            return ANALYTICS_PARTITIONS;
+            return analyticsPartitions;
         }
                 
         final String sql =
@@ -69,16 +69,16 @@
         log.info( "Information schema analytics SQL: " + sql );
 
         Set<String> partitions = new HashSet<>( jdbcTemplate.queryForList( sql, String.class ) );
-        ANALYTICS_PARTITIONS = partitions;
+        analyticsPartitions = partitions;
         return partitions;
     }
     
     @Override
     public Set<String> getEventAnalyticsPartitions()
     {
-        if ( ANALYTICS_EVENT_PARTITIONS != null )
+        if ( analyticsEventPartitions != null )
         {
-            return ANALYTICS_EVENT_PARTITIONS;
+            return analyticsEventPartitions;
         }
         
         final String sql = 
@@ -89,14 +89,14 @@
         log.info( "Information schema event analytics SQL: " + sql );
         
         Set<String> partitions = new HashSet<>( jdbcTemplate.queryForList( sql, String.class ) );
-        ANALYTICS_EVENT_PARTITIONS = partitions;
+        analyticsEventPartitions = partitions;
         return partitions;
     }
     
     @Override
     public void clearCaches()
     {
-        ANALYTICS_PARTITIONS = null;
-        ANALYTICS_EVENT_PARTITIONS = null;
+        analyticsPartitions = null;
+        analyticsEventPartitions = null;
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/AbstractJdbcTableManager.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/AbstractJdbcTableManager.java	2015-09-02 05:15:31 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/AbstractJdbcTableManager.java	2015-09-13 17:49:03 +0000
@@ -331,10 +331,10 @@
     {
         log.debug( "Populate table: " + tableName + " SQL: " + sql );
 
-        Timer t = new SystemTimer().start();
+        Timer timer = new SystemTimer().start();
         
         jdbcTemplate.execute( sql );
         
-        log.info( "Populated " + tableName + ": " + t.stop().toString() );
+        log.info( "Populated " + tableName + ": " + timer.stop().toString() );
     }
 }