Changeset e87a9d5


Ignore:
Timestamp:
Aug 17, 2017 5:22:25 PM (5 weeks ago)
Author:
www-data <www-data@…>
Branches:
master
Children:
08faf7d
Parents:
002daed
git-author:
Bang Pham Huu <b.phamhuu@…> (08/16/17 15:29:25)
git-committer:
www-data <www-data@…> (08/17/17 17:22:25)
Message:

ticket:502 - No migrate obsoleted WMS layers without associated WCS coverages

Summary:
A WMS layer is always imported from a WCS coverage. Migration application
will try to find the associated WCS coverage for some obsoleted WMS layers which are not removed from DeleteCoverage? service,
and throw exception. Therefore, when running migration, it should ignore these WMS layers.
Also, increase the time for Petascope to read SECORE's CRSs before it throws exception as it can take longer time when tomcat restarts and SECORE is initializing when Petascope tries to request.

Test Plan: Tested with both cases on test server.

Reviewers: dmisev

Differential Revision: http://codereview.rasdaman.org/D451

Location:
applications/petascope
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • applications/petascope/petascope_core/src/main/java/org/rasdaman/config/ConfigManager.java

    r0631145c re87a9d5  
    133133    /* ***** SECORE configuration ***** */
    134134    public static List<String> SECORE_URLS;
    135     public static final int CRSRESOLVER_CONN_TIMEOUT = 2000;
     135    // NOTE: time to read CRS from SECORE can be slow when Tomcat restarts and SECORE is initializing, so petascope should wait longer.
     136    public static final int CRSRESOLVER_CONN_TIMEOUT = 10000;
    136137    public static final int CRSRESOLVER_READ_TIMEOUT = 10000;
    137138
  • applications/petascope/petascope_main/src/main/java/org/rasdaman/ApplicationMain.java

    r1ede013 re87a9d5  
    8888     */
    8989    @Bean
    90     public PropertySourcesPlaceholderConfigurer placeholderConfigurer() throws FileNotFoundException, IOException, SQLException, ClassNotFoundException, PetascopeException {
     90    public PropertySourcesPlaceholderConfigurer placeholderConfigurer() throws FileNotFoundException, IOException, SQLException, ClassNotFoundException, PetascopeException, InterruptedException {
    9191        String resourceName = APPLICATION_PROPERTIES_FILE; // could also be a constant
    9292        Properties properties = new Properties();
     
    116116    }
    117117
    118     public static void main(String[] args) throws Exception {
     118    public static void main(String[] args) throws Exception {       
    119119        SpringApplication.run(ApplicationMain.class, args);
    120120    }
     
    124124     * OGC WCS XML Schema
    125125     */
    126     private void initConfigurations(Properties properties) throws SQLException, ClassNotFoundException, PetascopeException, IOException {
     126    private void initConfigurations(Properties properties) throws SQLException, ClassNotFoundException, PetascopeException, IOException, InterruptedException {               
    127127        String GDAL_JAVA_DIR = properties.getProperty(KEY_GDAL_JAVA_DIR);
    128128        String CONF_DIR = properties.getProperty(KEY_PETASCOPE_CONF_DIR);
  • applications/petascope/petascope_migration/src/main/java/org/rasdaman/migration/domain/legacy/LegacyDbMetadataSource.java

    r901a413 re87a9d5  
    32123212        try {
    32133213
    3214             // First, get all the layers from wms13_layer           
    3215             String sqlQuery = "SELECT * from wms13_layer where name ='" + legacyLayerName + "'";
     3214            // First, check if legacy WMS layer exists in both wms layer table and wcs coverage table
     3215            // NOTE: if a wms layer does not exist in wcs coverage table, it cannot be used to migrate as the associated coverage does not exist.
     3216            String sqlQuery = "SELECT * from wms13_layer where name ='" + legacyLayerName
     3217                            + "' and name in (select name from ps_coverage where name = '" + legacyLayerName + "')";
    32163218            //log.debug("SQL Query : " + sqlQuery);
    32173219            ResultSet r = s.executeQuery(sqlQuery);
  • applications/petascope/petascope_migration/src/main/java/org/rasdaman/migration/service/LegacyMigrationService.java

    r7d15c94 re87a9d5  
    186186            } else {
    187187                // Legacy WMS layer is not migrated yet, now read the whole legacy WMS layer content which is *slow*
    188                 LegacyWMSLayer legacyWMSLayer = readLegacyWMSLayerService.read(legacyWmsLayerName);
    189                 // And persist this legacy WMS layer's metadata by converting it to new data model and saving to database
    190                 legacyWMSLayerMainService.persist(legacyWMSLayer);
    191                 log.info("... migrated successfully.");
     188                LegacyWMSLayer legacyWMSLayer = readLegacyWMSLayerService.read(legacyWmsLayerName);               
     189                if (legacyWMSLayer == null) {
     190                    log.info("Associated coverage for this layer does not exist in database to migrate, skipping.");
     191                } else {
     192                    // And persist this legacy WMS layer's metadata by converting it to new data model and saving to database
     193                    legacyWMSLayerMainService.persist(legacyWMSLayer);
     194                    log.info("... migrated successfully.");
     195                }
    192196            }           
    193197            i++;
Note: See TracChangeset for help on using the changeset viewer.