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
var useCache = true;
var cogUri = new BasicAuthURI(url, useCache);
var input = new CogSourceSPIProvider(
cogUri,
new CogImageReaderSpi(),
new CogImageInputStreamSpi(),
HttpRangeReader.class.getName()
);
...
i get some NullPointerException caused by CachingCogImageInputStream.
I have added some tests to CogHTTPReadOnlineTest to demonstrate the problem.
I tried to fix these problems by keeping the header field of CachingCogImageInputStream up to date and my tests passed.
However, upon closer inspection of the current implementation of CachingCogImageInputStream, I noticed that it relies heavily on the cache and will most likely break when parts of the cache are evicted.
For example: Tile is cached when readRanges(.) is called -> ehcache decides to remove that tile -> call of read(...) tries to get the tile from the cache -> error
since a TODO in the code already noted that the implementation never worked well, i thought i'd give it a shot:
CachingCogImageInputStream extends DefaultCogImageInputStream and all the cache related stuff happens in readRanges(.)
If the tiles are in cache the will be copied, else we fetch them and add them to cache.
The downside of this solution is that we have to merge the cached tile-chunks into continuous-chunks because the read(.) method expects it that way. Which might raise concerns about memory management?
Please let me know your thoughts on this.
The text was updated successfully, but these errors were encountered:
Hi,
As soon as i turn on caching by specifying:
i get some NullPointerException caused by CachingCogImageInputStream.
I have added some tests to CogHTTPReadOnlineTest to demonstrate the problem.
I tried to fix these problems by keeping the header field of CachingCogImageInputStream up to date and my tests passed.
However, upon closer inspection of the current implementation of CachingCogImageInputStream, I noticed that it relies heavily on the cache and will most likely break when parts of the cache are evicted.
For example: Tile is cached when readRanges(.) is called -> ehcache decides to remove that tile -> call of read(...) tries to get the tile from the cache -> error
since a TODO in the code already noted that the implementation never worked well, i thought i'd give it a shot:
CachingCogImageInputStream extends DefaultCogImageInputStream and all the cache related stuff happens in readRanges(.)
If the tiles are in cache the will be copied, else we fetch them and add them to cache.
The downside of this solution is that we have to merge the cached tile-chunks into continuous-chunks because the read(.) method expects it that way. Which might raise concerns about memory management?
Please let me know your thoughts on this.
The text was updated successfully, but these errors were encountered: