You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// used in file distribution output@OverridepublicIterator<CacheItem> iterator() {
returncacheTable.values().iterator();
}
This will return the contents of cacheTable, but my understanding is that the contents of cacheTable does not necessarily reflect the contents of the cache. Shouldn't the items be checked for isInCache before they are returned?
If not, is this iterator safe to use if I want to output the contents of the cache at the end of the simulation?
The text was updated successfully, but these errors were encountered:
I think this should be checked. Because when we remove an item from
cache, we do not really remove it, instead we just set its "inCache"
to be false. So at last, only cache items with inCache being true
reflect the content of the cache.
In
Cache.java
, there's this bit of code:This will return the contents of
cacheTable
, but my understanding is that the contents ofcacheTable
does not necessarily reflect the contents of the cache. Shouldn't the items be checked forisInCache
before they are returned?If not, is this iterator safe to use if I want to output the contents of the cache at the end of the simulation?
The text was updated successfully, but these errors were encountered: