Changeset 20779


Ignore:
Timestamp:
03/03/10 13:54:23 (2 years ago)
Author:
julie
Message:

turn off debugging mode so that the cache is updated less frequently. improve logging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bio/tools/main/src/org/intermine/bio/logic/OrthologueLinkManager.java

    r20766 r20779  
    5959public class OrthologueLinkManager 
    6060{ 
    61     private static final boolean DEBUG = true; 
     61    private static final boolean DEBUG = false; 
    6262    private static OrthologueLinkManager orthologueLinkManager = null; 
    6363    private static long lastCacheRefresh = 0; 
     
    109109    public static synchronized void primeCache() { 
    110110        long timeSinceLastRefresh = System.currentTimeMillis() - lastCacheRefresh; 
    111         // FIXME hardcoded for testing. 
    112111        // if release version is different, update homologue mappings in cache 
    113112        if (timeSinceLastRefresh > ONE_HOUR || DEBUG) { 
    114113            lastCacheRefresh = System.currentTimeMillis(); 
    115  
    116114            updateMaps(); 
    117115        } 
     
    133131                } else { 
    134132                    String msg = "Unable to retrieve release version for " + mine.getName(); 
    135                     LOG.error(msg); 
     133                    LOG.info(msg); 
    136134                    continue; 
    137135                } 
     
    176174            return reader; 
    177175        } catch (MalformedURLException e) { 
    178             LOG.error("Unable to access " + urlString); 
    179             e.printStackTrace(); 
     176            LOG.info("Unable to access " + urlString); 
    180177            return null; 
    181178        } catch (IOException e) { 
    182             LOG.error("Unable to access " + urlString); 
    183             e.printStackTrace(); 
     179            LOG.info("Unable to access " + urlString); 
    184180            return null; 
    185181        } 
     
    261257 
    262258    private static boolean setOrganisms(Mine mine) { 
    263  
    264         String mineName = mine.getName(); 
    265         LOG.error("querying " + mineName + " for genes"); 
    266  
    267259        Set<String> names = new HashSet(); 
    268260        String webserviceURL = null; 
     
    278270            } 
    279271        } catch (MalformedURLException e) { 
    280             LOG.error("Unable to access " + mine.getName() + " at " + webserviceURL); 
    281             e.printStackTrace(); 
     272            LOG.info("Unable to access " + mine.getName() + " at " + webserviceURL); 
    282273            return false; 
    283274        } catch (IOException e) { 
    284             LOG.error("Unable to access " + mine.getName() + " at " + webserviceURL); 
    285             e.printStackTrace(); 
     275            LOG.info("Unable to access " + mine.getName() + " at " + webserviceURL); 
    286276            return false; 
    287277        } 
     
    308298            QueryField qfHomologueOrganismName = new QueryField(qcHomologueOrganism, "shortName"); 
    309299            QueryField qfType = new QueryField(qcHomologue, "type"); 
    310              
     300 
    311301            q.setDistinct(true); 
    312302 
     
    348338            // gene.homologues.type = 'orthologue' 
    349339            QueryExpression c6 = new QueryExpression(QueryExpression.LOWER, qfType); 
    350             cs.addConstraint(new SimpleConstraint(c6, ConstraintOp.EQUALS,  
     340            cs.addConstraint(new SimpleConstraint(c6, ConstraintOp.EQUALS, 
    351341                    new QueryValue("orthologue"))); 
    352              
     342 
    353343            q.addToOrderBy(qfGeneOrganismName); 
    354              
     344 
    355345            Results results = im.getObjectStore().execute(q); 
    356346            Iterator it = results.iterator(); 
     
    391381 
    392382    private static void setOrthologues(Mine mine) { 
    393  
    394         String mineName = mine.getName(); 
    395         LOG.error("querying " + mineName + " for orthologues"); 
    396  
    397383        Map<String, Map<String, Set[]>> orthologues = new HashMap(); 
    398384        URL url; 
     
    410396                    + ".  Expected three columns, found " + bits.length + " columns instead." 
    411397                    + webserviceURL; 
    412                     LOG.error(msg); 
     398                    LOG.info(msg); 
    413399                    return; 
    414400                } 
     
    442428            } 
    443429        } catch (MalformedURLException e) { 
    444             LOG.error("Unable to access " + mine.getName() + " at " + webserviceURL); 
    445             e.printStackTrace(); 
     430            LOG.info("Unable to access " + mine.getName() + " at " + webserviceURL); 
    446431            return; 
    447432        } catch (IOException e) { 
    448             LOG.error("Unable to access " + mine.getName() + " at " + webserviceURL); 
    449             e.printStackTrace(); 
     433            LOG.info("Unable to access " + mine.getName() + " at " + webserviceURL); 
    450434            return; 
    451435        } 
     
    474458        // remote mines 
    475459        for (Mine mine : mines.values()) { 
    476  
    477             String mineName = mine.getName(); 
    478             LOG.error("testing " + mineName + " for orthologues"); 
    479  
    480460            /* unique list of organisms available for conversion 
    481461             * orthologue --> mine (local/remote) --> datasets 
     
    487467 
    488468            if (geneToOrthologues.isEmpty()) { 
    489                 LOG.error(mineName + " has no orthologues"); 
     469                LOG.info(mine.getName() + " has no orthologues"); 
    490470                continue; 
    491471            } 
Note: See TracChangeset for help on using the changeset viewer.