Modify

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#2613 closed defect (fixed)

[PATCH #2] Create core cache class

Reported by: xeen Owned by: team
Priority: minor Milestone:
Component: Core Version:
Keywords: Cc:

Description

Cache class as well as WMS Plugin patch attached. Lakewalker still needs patching.

Attachments (4)

WMS Plugin use CacheFiles.patch (7.3 KB ) - added by xeen 17 years ago.
Add CacheFiles class.patch (11.7 KB ) - added by xeen 17 years ago.
Add CacheFiles class.2.patch (11.8 KB ) - added by xeen 17 years ago.
Good catch. Implemented. Any value below 0 will do :)
Add CacheFiles class.3.patch (12.5 KB ) - added by xeen 17 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 by xeen, 17 years ago

I suggest checking in the core patch first, then wait at least one week to minimize the complaints of users who don't update JOSM/plugins simultaneously and get an error message about not found classes or so.

comment:2 by xeen, 17 years ago

The WMS patch didn't catch this, but wmsplugin\src\wmsplugin\Cache.java can be deleted once checked in.

comment:3 by avarab@…, 17 years ago

Regarding this:

{{

cache.setExpire(cache.EXPIRE_MONTHLY, false);

cache.setMaxSize(70, false);

}}

Can you please make this configurable, even if only through the Einstein dialog? The WMS images I use (e.g. landsat) I'd like to never expire (unless I manually delete the cache), and I'd like to use a lot more than 70MB for caching WMS images.

in reply to:  3 ; comment:4 by avarab@…, 17 years ago

Replying to avar:

Can you please make this configurable.

Hrm. actually there are some Main.pref calls in that code so it might implement this, but I recall trying to completely turning off caching in the old WMS plugin without luck.

in reply to:  4 ; comment:5 by xeen, 17 years ago

Hrm. actually there are some Main.pref calls in that code so it might implement this, but I recall trying to completely turning off caching in the old WMS plugin without luck.

They are configurable. The "false" says that these values will be written only if they don't exist yet. With this patch applied you can customize it via cache.wmsplugin.expire (time in seconds or -1 for never) and cache.wmsplugin.maxsize (in mbytes).

That reminds me of… I'll attach a new version that catches invalid values entered via Einstein

by xeen, 17 years ago

Attachment: Add CacheFiles class.patch added

in reply to:  5 comment:6 by avarab@…, 17 years ago

Replying to xeen:

Hrm. actually there are some Main.pref calls in that code so it might implement this, but I recall trying to completely turning off caching in the old WMS plugin without luck.

They are configurable. The "false" says that these values will be written only if they don't exist yet. With this patch applied you can customize it via cache.wmsplugin.expire (time in seconds or -1 for never) and cache.wmsplugin.maxsize (in mbytes).

Nice, but it looks like it doesn't understand maxsize = -1, it could be set to a very large value but then the cleanUp() routine would still waste time calculating the size of the cache.

Maybe if(!this.enabled) return; in the cleanUp() routine should be changed to if(!this.enabled
maxsize < 0) return;, or something like that.

by xeen, 17 years ago

Good catch. Implemented. Any value below 0 will do :)

comment:7 by stoecker, 17 years ago

You use pref.getInteger(), so why don't you use putInteger()?

If you need long, then adding getLong(), putLong() ist better than own code.

comment:8 by xeen, 17 years ago

Summary: [PATCH] Create core cache class[PATCH #2] Create core cache class

Don't I have the right to be lazy?

by xeen, 17 years ago

comment:9 by stoecker, 17 years ago

Resolution: fixed
Status: newclosed

No. YOU don't have the right to be lazy. This would kill my good opinion about you.

In r1610 and [o15185]. New plugin not yet built.

P.S. Could you try to change your eidtor, so you no longer produce trailing spaces?

in reply to:  9 comment:10 by xeen, 17 years ago

P.S. Could you try to change your eidtor, so you no longer produce trailing spaces?

No. But I remapped some shortcuts in N++ so it auto trims on save and added a plugin for Eclipse that does just that :)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.