Changeset 769


Ignore:
Timestamp:
05/09/11 18:03:48 (8 years ago)
Author:
philsmart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • raptor-parse/trunk/src/main/java/uk/ac/cardiff/raptor/parse/DataAccessRegister.java

    r763 r769  
    9393    } 
    9494 
    95     /**  
     95    /** 
    9696     * Removes events from all parsing modules iff they have been released to all endpoints 
    9797     */ 
    9898        public void garbageCollect(List<Endpoint> endpoints) { 
    9999                DateTime earliestReleaseTime = null; 
     100                Endpoint endpointWithEarliestReleaseTime=null; 
    100101                for (Endpoint endpoint :endpoints){ 
    101102                        if (earliestReleaseTime==null){ 
    102103                                earliestReleaseTime = endpoint.getReleaseInformation().getLastReleasedEventTime(); 
     104                                endpointWithEarliestReleaseTime = endpoint; 
    103105                        } 
    104                         if (earliestReleaseTime.isBefore(endpoint.getReleaseInformation().getLastReleasedEventTime())){ 
     106                        if (endpoint.getReleaseInformation().getLastReleasedEventTime().isBefore(earliestReleaseTime)){ 
    105107                                earliestReleaseTime = endpoint.getReleaseInformation().getLastReleasedEventTime(); 
     108                                endpointWithEarliestReleaseTime = endpoint; 
    106109                        } 
    107110                } 
     
    110113                                EntryHandler entryHandler = parser.getEntryHandler(); 
    111114                                log.info("GC. Parsing Module {} has {} events before garbage collection",parser,entryHandler.getNumberOfEntries()); 
    112                                 entryHandler.removeEventsBefore(earliestReleaseTime); 
     115                                entryHandler.removeEventsBefore(earliestReleaseTime,endpointWithEarliestReleaseTime.getReleaseInformation().getLatestEqualEntries()); 
    113116                                log.info("GC. Parsing Module {} has {} events after garbage collection", parser,entryHandler.getNumberOfEntries()); 
    114                                  
     117 
    115118                } 
    116                                  
     119 
    117120        } 
    118121 
Note: See TracChangeset for help on using the changeset viewer.