Fixes for RangeLookUp

3 views
Skip to first unread message

Simone Giannecchini

unread,
Jan 10, 2013, 6:37:42 AM1/10/13
to jai-...@googlegroups.com
Hi List,
in an internal project we are heavily relying on RangeLookUp and I
noticed that although it is a PointOpImage it is not threasafe.
RangeLookUpOpImage was using member variable to store various indexes
while looping to compute destination tiles, at the same time
the RangeLookUpTable was caching the last matching item.

Now, when using JAI multithreading in an heavily multithreaded server
on large images this was giving us headaches. I opened some issues and
I pushed some changes for this (see #208 and #209) in line with how
JAI operators work (some code duplication is required).
Of course Michael, you can review and improve as neede, I left the
issues open but marked as fixed.

Regards,
Simone Giannecchini
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for
more information.
==

Ing. Simone Giannecchini
@simogeo
Founder/Director

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

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

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

Michael Bedward

unread,
Jan 10, 2013, 5:32:41 PM1/10/13
to jai-...@googlegroups.com
Hi Simone,

Thanks for this. I notice you had flagged the issue as critical but
I've been but I've been having a critical break from work and coding
:) Hope this hasn't inconvenienced you too much. The changes sound
good. I'll review the code today (oz time) and publish new snapshot
jars.

Aside: some time ago Daniele was asking about the old classifiedstats
branch from svn. I looked at bringing the branch up to date with
current git sources, with a view to making it feature branch to be
included in snapshots and then merging into master. However, we got
stuck on an issue of yours which involved changes to RangeLookupTable:

http://code.google.com/p/jaitools/issues/detail?id=198

These changes never made it into master but are used by the
classifiedstats branch. I want to make RangeLookupTable, and other
such classes, immutable but didn't want to proceed without getting
your input:

https://groups.google.com/forum/?fromgroups=#!topic/jai-tools/N4FhT3jXkP4

cheers,
Michael

On 10 January 2013 22:37, Simone Giannecchini
> --
> You received this message because you are subscribed to the Google Groups "jai-tools" group.
> To post to this group, send email to jai-...@googlegroups.com.
> To unsubscribe from this group, send email to jai-tools+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/jai-tools?hl=en.
>

Simone Giannecchini

unread,
Jan 12, 2013, 6:13:43 AM1/12/13
to jai-...@googlegroups.com
Ciao Michael,
thanks for looking into this.

About the classifiedstats I will try to check that out early next week.
I need to talk to daniele as I don't really remember where the stuff
is located atm.

Michael Bedward

unread,
Jan 12, 2013, 6:18:57 AM1/12/13
to jai-...@googlegroups.com
No problems Simone.

I've had a quick look at your changes and they look good, but I'm
slightly unclear on the new method added to RangeLookupTable and its
use in the ImageOp class - just need to look at that again to
understand it. I'll have some time on Monday for that and also to
deploy new snapshot jars.

Michael

On 12 January 2013 22:13, Simone Giannecchini

Simone Giannecchini

unread,
Jan 14, 2013, 8:23:25 AM1/14/13
to jai-...@googlegroups.com
Ciao Michael,
I have externalized caching, so it is not done, in a more complex way
I admit, within the ImageOp.

We talked about other approaches with Andrea (ThreadLocal as an
instance) but this was the safest one.

Regards,
Simone Giannecchini
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for
more information.
==

Ing. Simone Giannecchini
@simogeo
Founder/Director

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

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

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


Simone Giannecchini

unread,
Jan 14, 2013, 8:28:14 AM1/14/13
to jai-...@googlegroups.com
Ciao Michael,
I checked the old ClassifiedStats branch and here is my feedback:

-1- the ClassifiedStats op does not depend on RangeLookUpTable hence I
moved on and I commited it. I opened an issue for the doc.
-2- afaic the changes you are proposing for RangeLookUpTable are fine.
I am in agreement with making that class Immutable. See the comment on
the issue for more info.

Regards,
Simone Giannecchini
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for
more information.
==

Ing. Simone Giannecchini
@simogeo
Founder/Director

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

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

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


Michael Bedward

unread,
Jan 14, 2013, 7:30:53 PM1/14/13
to jai-...@googlegroups.com
Hi Simone,

> I have externalized caching, so it is not done, in a more complex way
> I admit, within the ImageOp.

OK. I'll see if it's possible to simplify it a bit when I refactor
RangeLookupTable shortly, but otherwise no problems.

> -1- the ClassifiedStats op does not depend on RangeLookUpTable hence I
> moved on and I commited it. I opened an issue for the doc.

Sounds good.

> -2- afaic the changes you are proposing for RangeLookUpTable are fine.
> I am in agreement with making that class Immutable. See the comment on
> the issue for more info.
>

Cool - thanks for that.

Snapshot jars are here:
https://oss.sonatype.org/content/repositories/snapshots/org/jaitools/

Michael
Reply all
Reply to author
Forward
0 new messages