[Geoserver-devel] Generalized ExternalGraphicFactory caching?

Hi all,

I am working on an implementation of the ExternalGraphicFactory interface that supports Mapbox-style spritesheets (spec), and I have a question about image caching.

I see that the current implementation of ImageGraphicFactory caches BufferedImages and provides a resetCache() method. That method is not part of the interface – instead, GeoServer calls it directly in the WMSLifecycleHandler::onReset() method. Is that image-cache-reset functionality generalized anywhere that I am not seeing? Do we want it to be? Or, on the other hand, would it be reasonable for a style module to provide its own lifecycle handler and manage its cache that way?

Any input or feedback is appreciated.

Thanks,
Matt

On Fri, Mar 24, 2017 at 6:05 PM, Matt Kruszewski <
mkruszewski@anonymised.com> wrote:

Hi all,

I am working on an implementation of the ExternalGraphicFactory interface
that supports Mapbox-style spritesheets (spec
<https://www.mapbox.com/mapbox-gl-js/style-spec/#sprite&gt;\), and I have a
question about image caching.

I see that the current implementation of ImageGraphicFactory caches
BufferedImages and provides a resetCache() method. That method is not part
of the interface -- instead, GeoServer calls it directly in the
WMSLifecycleHandler::onReset() method. Is that image-cache-reset
functionality generalized anywhere that I am not seeing?

Nope

Do we want it to be?

That would be a good idea imho

Or, on the other hand, would it be reasonable for a style module to
provide its own lifecycle handler and manage its cache that way?

Imho a style module should not be aware of those details, they should be
orthogonal, a graphic factory can either be used
from all styling languages, or its design is broken

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------

Hi Andrea,

Continuing with the idea of a generalized way to reset ExternalGraphicFactory caches, would something as simple as a CachingExternalGraphicFactory interface be appropriate? Something along the lines of this branch? The GS lifecycle handler would then just reset the cache based on the interface. (I left the existing static resetCache() methods in place in this example for GeoServer’s sake).

···
  • Matt

On Fri, Mar 24, 2017 at 12:56 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Fri, Mar 24, 2017 at 6:05 PM, Matt Kruszewski <mkruszewski@anonymised.com> wrote:

Hi all,

I am working on an implementation of the ExternalGraphicFactory interface that supports Mapbox-style spritesheets (spec), and I have a question about image caching.

I see that the current implementation of ImageGraphicFactory caches BufferedImages and provides a resetCache() method. That method is not part of the interface – instead, GeoServer calls it directly in the WMSLifecycleHandler::onReset() method. Is that image-cache-reset functionality generalized anywhere that I am not seeing?

Nope

Do we want it to be?

That would be a good idea imho

Or, on the other hand, would it be reasonable for a style module to provide its own lifecycle handler and manage its cache that way?

Imho a style module should not be aware of those details, they should be orthogonal, a graphic factory can either be used
from all styling languages, or its design is broken

Cheers
Andrea

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313

fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


That sounds fine Matt,

We woudl like to backport this work, so we may need to ask GeoServer 2.11.x to use reflection to call this method in order not to backport an api change.

···

On 13 April 2017 at 12:15, Matt Kruszewski <mkruszewski@anonymised.com> wrote:

Hi Andrea,

Continuing with the idea of a generalized way to reset ExternalGraphicFactory caches, would something as simple as a CachingExternalGraphicFactory interface be appropriate? Something along the lines of this branch? The GS lifecycle handler would then just reset the cache based on the interface. (I left the existing static resetCache() methods in place in this example for GeoServer’s sake).


Check out the vibrant tech community on one of the world’s most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


Geoserver-devel mailing list
Geoserver-devel@anonymised.com.366…sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel


Jody Garnett

  • Matt

On Fri, Mar 24, 2017 at 12:56 PM, Andrea Aime <andrea.aime@anonymised.com1268…> wrote:

On Fri, Mar 24, 2017 at 6:05 PM, Matt Kruszewski <mkruszewski@anonymised.com> wrote:

Hi all,

I am working on an implementation of the ExternalGraphicFactory interface that supports Mapbox-style spritesheets (spec), and I have a question about image caching.

I see that the current implementation of ImageGraphicFactory caches BufferedImages and provides a resetCache() method. That method is not part of the interface – instead, GeoServer calls it directly in the WMSLifecycleHandler::onReset() method. Is that image-cache-reset functionality generalized anywhere that I am not seeing?

Nope

Do we want it to be?

That would be a good idea imho

Or, on the other hand, would it be reasonable for a style module to provide its own lifecycle handler and manage its cache that way?

Imho a style module should not be aware of those details, they should be orthogonal, a graphic factory can either be used
from all styling languages, or its design is broken

Cheers
Andrea

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313

fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


Hi Matt,
looks fine indeed

Cheers
Andrea

···

On Thu, Apr 13, 2017 at 7:15 PM, Matt Kruszewski <mkruszewski@anonymised.com> wrote:

Hi Andrea,

Continuing with the idea of a generalized way to reset ExternalGraphicFactory caches, would something as simple as a CachingExternalGraphicFactory interface be appropriate? Something along the lines of this branch? The GS lifecycle handler would then just reset the cache based on the interface. (I left the existing static resetCache() methods in place in this example for GeoServer’s sake).

  • Matt

On Fri, Mar 24, 2017 at 12:56 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Fri, Mar 24, 2017 at 6:05 PM, Matt Kruszewski <mkruszewski@anonymised.com> wrote:

Hi all,

I am working on an implementation of the ExternalGraphicFactory interface that supports Mapbox-style spritesheets (spec), and I have a question about image caching.

I see that the current implementation of ImageGraphicFactory caches BufferedImages and provides a resetCache() method. That method is not part of the interface – instead, GeoServer calls it directly in the WMSLifecycleHandler::onReset() method. Is that image-cache-reset functionality generalized anywhere that I am not seeing?

Nope

Do we want it to be?

That would be a good idea imho

Or, on the other hand, would it be reasonable for a style module to provide its own lifecycle handler and manage its cache that way?

Imho a style module should not be aware of those details, they should be orthogonal, a graphic factory can either be used
from all styling languages, or its design is broken

Cheers
Andrea

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313

fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313

fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


Hi Jody,
check his branch, Matt made a new sub-interface, there is no API break, just has to follow the usual rule for new features (1 month cooldown,
although this one is so small that I doubt waiting would do much good)

Cheers
Andrea

···

On Mon, Apr 17, 2017 at 2:04 AM, Jody Garnett <jody.garnett@anonymised.com…> wrote:

That sounds fine Matt,

We woudl like to backport this work, so we may need to ask GeoServer 2.11.x to use reflection to call this method in order not to backport an api change.


Jody Garnett

On 13 April 2017 at 12:15, Matt Kruszewski <mkruszewski@anonymised.com> wrote:

Hi Andrea,

Continuing with the idea of a generalized way to reset ExternalGraphicFactory caches, would something as simple as a CachingExternalGraphicFactory interface be appropriate? Something along the lines of this branch? The GS lifecycle handler would then just reset the cache based on the interface. (I left the existing static resetCache() methods in place in this example for GeoServer’s sake).


Check out the vibrant tech community on one of the world’s most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


Geoserver-devel mailing list
Geoserver-devel@anonymised.comrge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

  • Matt

On Fri, Mar 24, 2017 at 12:56 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Fri, Mar 24, 2017 at 6:05 PM, Matt Kruszewski <mkruszewski@anonymised.com> wrote:

Hi all,

I am working on an implementation of the ExternalGraphicFactory interface that supports Mapbox-style spritesheets (spec), and I have a question about image caching.

I see that the current implementation of ImageGraphicFactory caches BufferedImages and provides a resetCache() method. That method is not part of the interface – instead, GeoServer calls it directly in the WMSLifecycleHandler::onReset() method. Is that image-cache-reset functionality generalized anywhere that I am not seeing?

Nope

Do we want it to be?

That would be a good idea imho

Or, on the other hand, would it be reasonable for a style module to provide its own lifecycle handler and manage its cache that way?

Imho a style module should not be aware of those details, they should be orthogonal, a graphic factory can either be used
from all styling languages, or its design is broken

Cheers
Andrea

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313

fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313

fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


I though the interface would need to be in GeoTools, which is more strict about API breaks.

···

On 17 April 2017 at 01:35, Andrea Aime <andrea.aime@anonymised.com> wrote:

Hi Jody,
check his branch, Matt made a new sub-interface, there is no API break, just has to follow the usual rule for new features (1 month cooldown,
although this one is so small that I doubt waiting would do much good)

Cheers

Andrea


Jody Garnett

On Mon, Apr 17, 2017 at 2:04 AM, Jody Garnett <jody.garnett@anonymised.com> wrote:

That sounds fine Matt,

We woudl like to backport this work, so we may need to ask GeoServer 2.11.x to use reflection to call this method in order not to backport an api change.

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313

fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.



Jody Garnett

On 13 April 2017 at 12:15, Matt Kruszewski <mkruszewski@anonymised.com> wrote:

Hi Andrea,

Continuing with the idea of a generalized way to reset ExternalGraphicFactory caches, would something as simple as a CachingExternalGraphicFactory interface be appropriate? Something along the lines of this branch? The GS lifecycle handler would then just reset the cache based on the interface. (I left the existing static resetCache() methods in place in this example for GeoServer’s sake).


Check out the vibrant tech community on one of the world’s most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


Geoserver-devel mailing list
Geoserver-devel@anonymised.comrge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

  • Matt

On Fri, Mar 24, 2017 at 12:56 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Fri, Mar 24, 2017 at 6:05 PM, Matt Kruszewski <mkruszewski@anonymised.com> wrote:

Hi all,

I am working on an implementation of the ExternalGraphicFactory interface that supports Mapbox-style spritesheets (spec), and I have a question about image caching.

I see that the current implementation of ImageGraphicFactory caches BufferedImages and provides a resetCache() method. That method is not part of the interface – instead, GeoServer calls it directly in the WMSLifecycleHandler::onReset() method. Is that image-cache-reset functionality generalized anywhere that I am not seeing?

Nope

Do we want it to be?

That would be a good idea imho

Or, on the other hand, would it be reasonable for a style module to provide its own lifecycle handler and manage its cache that way?

Imho a style module should not be aware of those details, they should be orthogonal, a graphic factory can either be used
from all styling languages, or its design is broken

Cheers
Andrea

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313

fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


It should go in Geotools but I still do not see what is the problem. A new optional sub-interface does not an API break make :wink:
Please clarify the issues it causes to Geotools users

Cheers
Andrea

···

Il 18 Apr 2017 6:31 AM, “Jody Garnett” <jody.garnett@anonymised.com> ha scritto:

I though the interface would need to be in GeoTools, which is more strict about API breaks.


Jody Garnett

On 17 April 2017 at 01:35, Andrea Aime <andrea.aime@anonymised.com> wrote:

Hi Jody,
check his branch, Matt made a new sub-interface, there is no API break, just has to follow the usual rule for new features (1 month cooldown,
although this one is so small that I doubt waiting would do much good)

Cheers

Andrea

On Mon, Apr 17, 2017 at 2:04 AM, Jody Garnett <jody.garnett@anonymised.com> wrote:

That sounds fine Matt,

We woudl like to backport this work, so we may need to ask GeoServer 2.11.x to use reflection to call this method in order not to backport an api change.

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313

fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.



Jody Garnett

On 13 April 2017 at 12:15, Matt Kruszewski <mkruszewski@anonymised.com> wrote:

Hi Andrea,

Continuing with the idea of a generalized way to reset ExternalGraphicFactory caches, would something as simple as a CachingExternalGraphicFactory interface be appropriate? Something along the lines of this branch? The GS lifecycle handler would then just reset the cache based on the interface. (I left the existing static resetCache() methods in place in this example for GeoServer’s sake).


Check out the vibrant tech community on one of the world’s most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


Geoserver-devel mailing list
Geoserver-devel@anonymised.comrge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

  • Matt

On Fri, Mar 24, 2017 at 12:56 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Fri, Mar 24, 2017 at 6:05 PM, Matt Kruszewski <mkruszewski@anonymised.com> wrote:

Hi all,

I am working on an implementation of the ExternalGraphicFactory interface that supports Mapbox-style spritesheets (spec), and I have a question about image caching.

I see that the current implementation of ImageGraphicFactory caches BufferedImages and provides a resetCache() method. That method is not part of the interface – instead, GeoServer calls it directly in the WMSLifecycleHandler::onReset() method. Is that image-cache-reset functionality generalized anywhere that I am not seeing?

Nope

Do we want it to be?

That would be a good idea imho

Or, on the other hand, would it be reasonable for a style module to provide its own lifecycle handler and manage its cache that way?

Imho a style module should not be aware of those details, they should be orthogonal, a graphic factory can either be used
from all styling languages, or its design is broken

Cheers
Andrea

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313

fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


Yep, and I prefer that to reflection.

···

Il 18 Apr 2017 6:31 AM, “Jody Garnett” <jody.garnett@anonymised.com> ha scritto:

I though the interface would need to be in GeoTools, which is more strict about API breaks.


Jody Garnett

On 17 April 2017 at 01:35, Andrea Aime <andrea.aime@anonymised.com> wrote:

Hi Jody,
check his branch, Matt made a new sub-interface, there is no API break, just has to follow the usual rule for new features (1 month cooldown,
although this one is so small that I doubt waiting would do much good)

Cheers

Andrea

On Mon, Apr 17, 2017 at 2:04 AM, Jody Garnett <jody.garnett@anonymised.com> wrote:

That sounds fine Matt,

We woudl like to backport this work, so we may need to ask GeoServer 2.11.x to use reflection to call this method in order not to backport an api change.

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313

fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.



Jody Garnett

On 13 April 2017 at 12:15, Matt Kruszewski <mkruszewski@anonymised.com> wrote:

Hi Andrea,

Continuing with the idea of a generalized way to reset ExternalGraphicFactory caches, would something as simple as a CachingExternalGraphicFactory interface be appropriate? Something along the lines of this branch? The GS lifecycle handler would then just reset the cache based on the interface. (I left the existing static resetCache() methods in place in this example for GeoServer’s sake).


Check out the vibrant tech community on one of the world’s most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

  • Matt

On Fri, Mar 24, 2017 at 12:56 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Fri, Mar 24, 2017 at 6:05 PM, Matt Kruszewski <mkruszewski@anonymised.com> wrote:

Hi all,

I am working on an implementation of the ExternalGraphicFactory interface that supports Mapbox-style spritesheets (spec), and I have a question about image caching.

I see that the current implementation of ImageGraphicFactory caches BufferedImages and provides a resetCache() method. That method is not part of the interface – instead, GeoServer calls it directly in the WMSLifecycleHandler::onReset() method. Is that image-cache-reset functionality generalized anywhere that I am not seeing?

Nope

Do we want it to be?

That would be a good idea imho

Or, on the other hand, would it be reasonable for a style module to provide its own lifecycle handler and manage its cache that way?

Imho a style module should not be aware of those details, they should be orthogonal, a graphic factory can either be used
from all styling languages, or its design is broken

Cheers
Andrea

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313

fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.