Re: [Geotools-devel] SchemaCache timeout error

2013-05-23 Thread Ben Caradoc-Davies
Mauro, I do not like the exception swallowing in SchemaCache.download(). 
You changed to original:

throw new RuntimeException(e);

to

return null;

in the catch block. While this will result in a failed download and an 
exception higher up that includes a URL report, precise network or DNS 
error reports will be swallowed. I am wondering if these are useful 
enough for deployment debugging that they should be retained by keeping 
the throw? What do you think?

My original throw was also inadequate because is prevents the reporting 
of the problematic URL, causing me problems analysing this behaviour. If 
you think this throw should be left, perhaps we could improve it to 
report the problematic URL:

throw new RuntimeException("Error downloading " + location.toString(), e);

Your other code changes look great and your handling of the W3C licence 
is just right.

Thanks!

Kind regards,
Ben.


On 23/05/13 20:07, Mauro Bartolomeoli wrote:
> Please, have a look at my fix proposal at
> https://github.com/mbarto/geotools/commit/ea85a28ff360e5be2b5c5843eb2cbf30ee68ba9f
> If you think it's ok I'll merge it on master.
>
> Thanks.
> Mauro
>
>
>
> 2013/5/23 Mauro Bartolomeoli  >
>
>
> Hi Ben,
>
>
>
> (2) Please look at the logic in SchemaCache.startDownload(). Why
> is it necessary to create an empty file? How should SchemaCache
> recover when a download fails? Please have a look and recommend
> a solution. I know you gave this some thought and I do not want
> to introduce a deadlock or thread blocking that might impact
> your performance.
>
>
> I had a look at the code, and the empty file creation seems not
> useful in that point. I don't remember why I introduced it. Maybe it
> was there for some file existance check, but that check is not there
> anymore. So I'm going to remove the empty file creation completely.
> The connect timeout instead was there to prevent a deadlock. I'm
> going to make it configurable through an env variable
> (-Dschema.cache.download.timeout is ok for you?). For the default,
> maybe we can set it to 30seconds. What do you think?
> Mauro
> --
> ==
> GeoServer training in Milan, 6th & 7th June 2013! Visit
> http://geoserver.geo-solutions.it
>  for more information.
> ==
>
> Dott. Mauro Bartolomeoli
> @mauro_bart
> Senior Software Engineer
>
> GeoSolutions S.A.S.
> Via Poggio alle Viti 1187
> 55054  Massarosa (LU)
> Italy
> phone: +39 0584 962313 
> fax: +39 0584 1660272 
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> ---
>
>
>
>
> --
> ==
> GeoServer training in Milan, 6th & 7th June 2013! Visit
> http://geoserver.geo-solutions.it
>  for more information.
> ==
>
> Dott. Mauro Bartolomeoli
> @mauro_bart
> Senior Software Engineer
>
> GeoSolutions S.A.S.
> Via Poggio alle Viti 1187
> 55054  Massarosa (LU)
> Italy
> phone: +39 0584 962313
> fax: +39 0584 1660272
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> ---

-- 
Ben Caradoc-Davies 
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] SchemaCache timeout error

2013-05-23 Thread Ben Caradoc-Davies
Mauro,

30 seconds sounds like a generous default. Maybe even 60 seconds for the 
paranoid?

I think your decision to have a timeout is excellent, as a thread could 
otherwise block indefinitely, which would be very, very bad for a 
service such as GeoServer.

Kind regards,
Ben.

On 23/05/13 16:34, Mauro Bartolomeoli wrote:
>
> Hi Ben,
>
>
>
> (2) Please look at the logic in SchemaCache.startDownload(). Why is
> it necessary to create an empty file? How should SchemaCache recover
> when a download fails? Please have a look and recommend a solution.
> I know you gave this some thought and I do not want to introduce a
> deadlock or thread blocking that might impact your performance.
>
>
> I had a look at the code, and the empty file creation seems not useful
> in that point. I don't remember why I introduced it. Maybe it was there
> for some file existance check, but that check is not there anymore. So
> I'm going to remove the empty file creation completely. The connect
> timeout instead was there to prevent a deadlock. I'm going to make it
> configurable through an env variable (-Dschema.cache.download.timeout is
> ok for you?). For the default, maybe we can set it to 30seconds. What do
> you think?
> Mauro
> --
> ==
> GeoServer training in Milan, 6th & 7th June 2013! Visit
> http://geoserver.geo-solutions.it
>  for more information.
> ==
>
> Dott. Mauro Bartolomeoli
> @mauro_bart
> Senior Software Engineer
>
> GeoSolutions S.A.S.
> Via Poggio alle Viti 1187
> 55054  Massarosa (LU)
> Italy
> phone: +39 0584 962313
> fax: +39 0584 1660272
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> ---

-- 
Ben Caradoc-Davies 
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] H2 and Hatbox in GeoTools

2013-05-23 Thread Justin Deoliveira
Hi Vitali,

Indeed it does look like it is only possible to create a single hatbox
index per table. Although its possible to create a table with multiple
geometry columns, the first being the one that receives the index.

This is something relatively easily fixable. Could you open a jira ticket
about this? Thanks.

-Justin



On Thu, May 23, 2013 at 5:46 AM, Vitali Dyachkov wrote:

> Hello.
>
> Simple question: is it so that table in H2 databse may have only 1
> geometry column ?  Has anyone faced with this restriction?
>
>
> Vitali.
>
>
> --
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
> ___
> GeoTools-Devel mailing list
> GeoTools-Devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>



-- 
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


[Geotools-devel] H2 and Hatbox in GeoTools

2013-05-23 Thread Vitali Dyachkov
Hello.

Simple question: is it so that table in H2 databse may have only 1 
geometry column ?  Has anyone faced with this restriction?


Vitali.

--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] SLD and Internationalization

2013-05-23 Thread Andrea Aime
On Thu, May 23, 2013 at 11:48 AM, Mauro Bartolomeoli <
mauro.bartolome...@geo-solutions.it> wrote:

> Hi all,
> I think I can prepare a patch for this shortly using the last variant
> proposed by Andrea (I did some testing patching the SLDParser and
> everything seems to work well).
> I would use the "free text" (not included in a value tag) as the default
> value if no locale is specified.
>
> So, something like:
> default title
>  Titolo
>  Title
>  ...
> 
>
> Also: do you think any other part (xsd, validators, parsers) would need to
> be touched to allow mixed content in Title and Abstract classes?
>

The xsd's in gt-xsd-sld I believe

Cheers
Andrea

-- 
==
GeoServer training in Milan, 6th & 7th June 2013!  Visit
http://geoserver.geo-solutions.it for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

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

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

---
--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] SLD and Internationalization

2013-05-23 Thread Mauro Bartolomeoli
Hi all,
I think I can prepare a patch for this shortly using the last variant
proposed by Andrea (I did some testing patching the SLDParser and
everything seems to work well).
I would use the "free text" (not included in a value tag) as the default
value if no locale is specified.

So, something like:
default title
 Titolo
 Title
 ...


Also: do you think any other part (xsd, validators, parsers) would need to
be touched to allow mixed content in Title and Abstract classes?

Mauro


2013/5/23 Jody Garnett 

>  Yeah I like that, more similar to the W3C  approach for
> html documents.
>
> Only wrinkle would be to define the document default lang, and use 
> for the alternatives.
>
> --
> Jody Garnett
>
> On Wednesday, 22 May 2013 at 8:35 AM, Andrea Aime wrote:
>
> Thinking about it, I would like to propose a further variant that is
> possibly cleaner on the user's eyes, and better to parse.
>
> Just like we extended the content of some SLD elements already (think
> geometry, not limited anymore to a property name)
> we could allow mixed content in Title and Abstract and allow either:
>
> My title
>
> or:
>
> 
> xxx
> yyy
> ...
> 
>
> which would parse directly into a international string.
>
> Opinions?
>
> Cheers
> Andrea
>
>
> --
> ==
> GeoServer training in Milan, 6th & 7th June 2013!  Visit
> http://geoserver.geo-solutions.it for more information.
> ==
>
> Ing. Andrea Aime
> @geowolf
> Technical Lead
>
> GeoSolutions S.A.S.
> Via Poggio alle Viti 1187
> 55054  Massarosa (LU)
> Italy
> phone: +39 0584 962313
> fax: +39 0584 1660272
> mob: +39  339 8844549
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> ---
>
> --
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring
> service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
> ___
> GeoTools-Devel mailing list
> GeoTools-Devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>
>
>


-- 
==
GeoServer training in Milan, 6th & 7th June 2013! Visit
http://geoserver.geo-solutions.it for more information.
==

Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer

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

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

---
--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] (E)CQL DE9IM_PATTERN token conflicts with INTEGER token (GEOT-4211)

2013-05-23 Thread Andrea Aime
On Thu, May 23, 2013 at 11:10 AM, Jan De Moerloose <
jan.demoerlo...@geosparc.com> wrote:

>  For backward compatibility, it might be an option to change the order of
> the token evaluations of INTEGER and DE9IM_PATTERN. An DE9IM_PATTERN
> consisting of all integers is extremely unlikely, so it might be better to
> change the parser order by putting DE9IM_PATTERN after INTEGER. People that
> really need an all-integer DE9IM_PATTERN could use the escape construct, of
> course.
>

I am wondering if some kind of lookahead in the grammar would help it
resolve the situation, and decide which is which based on contextual
information.
Unfortunately my JavaCC is quite rusty...

Cheers
Andrea

-- 
==
GeoServer training in Milan, 6th & 7th June 2013!  Visit
http://geoserver.geo-solutions.it for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

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

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

---
--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] (E)CQL DE9IM_PATTERN token conflicts with INTEGER token (GEOT-4211)

2013-05-23 Thread Jan De Moerloose
For backward compatibility, it might be an option to change the order of 
the token evaluations of INTEGER and DE9IM_PATTERN. An DE9IM_PATTERN 
consisting of all integers is extremely unlikely, so it might be better 
to change the parser order by putting DE9IM_PATTERN after INTEGER. 
People that really need an all-integer DE9IM_PATTERN could use the 
escape construct, of course.


Cheers,
Jan
On 17/05/2013 11:26, Kristof Heirwegh wrote:

Hello kind people of Geotools,

After upgrading to Geotools version 9.2 (from 2.7.5) we had a problem 
with all our samples because of GEOT-4211 (CQL Filter fails when 
certain values are passed).
I took a look at the grammar files and saw that the newly (since 8.x) 
added relate filter functionality conflicts with the parsing of integers.


TOKEN [IGNORE_CASE]:
{
< #DIMENSION_SYMBOL: "*"| "T" | "F" | "0" | "1" | "2"> |
< DE9IM_PATTERN: 
 
>

}

Which overlaps with 9 digit integers existing of only 0, 1 & 2.


If I add left and right square brackets everything works fine, this 
does however change the syntax of the Relate function.


TOKEN [IGNORE_CASE]:
{
< #DIMENSION_SYMBOL: "*"| "T" | "F" | "0" | "1" | "2"> |
< DE9IM_PATTERN: 
>

}

Sample:
RELATE(the_geom, LINESTRING (-134.921387 58.687767, -135.303391 
59.092838), T*FF*)


becomes:
RELATE(the_geom, LINESTRING (-134.921387 58.687767, -135.303391 
59.092838), [T*FF*])



I took brackets because the pattern represents a matrix, but it could 
also be something else (quotes for instance (making it a string)).



Thought / Remarks?

If you like I can make a patch, but changing syntax probably needs 
some discussion / more formal way of handling, as it will break your 
code if you use the relate filter.




Sincerely
Kristof Heirwegh


DFC Software Engineering
Brugsesteenweg 587
9030 Gent
T: +32 (0)9 236 61 96
F: +32 (0)9 236 54 12
W: _www.dfc.be_






--
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d


___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel



--
Sincerely,
Jan De Moerloose

Geosparc n.v.
http://www.geosparc.com
sponsor of http://www.geomajas.org

--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] SchemaCache timeout error

2013-05-23 Thread Mauro Bartolomeoli
Hi Ben,


>
> (2) Please look at the logic in SchemaCache.startDownload(). Why is it
> necessary to create an empty file? How should SchemaCache recover when a
> download fails? Please have a look and recommend a solution. I know you
> gave this some thought and I do not want to introduce a deadlock or thread
> blocking that might impact your performance.
>
>
I had a look at the code, and the empty file creation seems not useful in
that point. I don't remember why I introduced it. Maybe it was there for
some file existance check, but that check is not there anymore. So I'm
going to remove the empty file creation completely. The connect timeout
instead was there to prevent a deadlock. I'm going to make it configurable
through an env variable (-Dschema.cache.download.timeout is ok for you?).
For the default, maybe we can set it to 30seconds. What do you think?

Mauro
-- 
==
GeoServer training in Milan, 6th & 7th June 2013! Visit
http://geoserver.geo-solutions.it for more information.
==

Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer

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

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

---
--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] SchemaCache timeout error

2013-05-23 Thread Ben Caradoc-Davies
On 23/05/13 15:20, Mauro Bartolomeoli wrote:
> 2013/5/23 Ben Caradoc-Davies  >
>
> On Thu, May 23, 2013 at 5:48 AM, Ben Caradoc-Davies
>   >> wrote:
> http://www.w3.org/2001/xml.xsd
>
> Placing this file as /org/w3/www/2001/xml.xsd on the classpath (in
> any jar) will cause SchemaResolver to pick it up before hitting
> SchemaCache. The gt-xml jar is a good place.
>
> Sure, and it's used also by inspire schemas. Where do you thing could be
> a good place to put it, the gt-xml module itself?

That sounds like the perfect place. If you download

http://www.w3.org/2001/xml.xsd

and then save it as:

modules/library/xml/src/main/resources/org/w3/www/2001/xml.xsd

and commit it on master, then Maven will bundle it into the gt-xml jar, 
SchemaResolver will find it on the classpath, and it will never be 
downloaded ever again.

Because we are now shipping it with GeoTools we need to acknowledge the 
W3C license. Please note where you got it in the module review file:
modules/library/xml/src/site/apt/review.apt

Please also add the W3 license to the top-level in the project license 
folder:
http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231

We already have a copy of xml.xsd in gt-xsd-core, but it is in the wrong 
place for SchemaResolver; also some files have been modified to work 
with code (unacceptable for app-schema users). I do not know if the 
copyright of this file was acknowledged. Please check the review file.

PMC, do we need to include the W3C short notice anywhere? Do we have a 
page that lists all the licenses? (Jody knows all.)

Kind regards,

-- 
Ben Caradoc-Davies 
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] SchemaCache timeout error

2013-05-23 Thread Mauro Bartolomeoli
2013/5/23 Ben Caradoc-Davies 

> On 23/05/13 14:26, Andrea Aime wrote:
>
>> On Thu, May 23, 2013 at 5:48 AM, Ben Caradoc-Davies
>> > >
>> wrote:
>> http://www.w3.org/2001/xml.xsd
>> Ah, this one is a nightmare, it's always super-slow to download (I guess
>> because
>> anything XML ends up linking it).
>> Imho, we should have a copy of it baked directly into code to avoid
>> downloading it
>> over and over.
>>
>
> Placing this file as /org/w3/www/2001/xml.xsd on the classpath (in any
> jar) will cause SchemaResolver to pick it up before hitting SchemaCache.
> The gt-xml jar is a good place.
>
> This is currently being imported via the new xlink.xsd and smil20.xsd
> (since the great XLink change of 2012).



Sure, and it's used also by inspire schemas. Where do you thing could be a
good place to put it, the gt-xml module itself?
I'm currently placing it in geoserver classes folder for my clients, but
having it at the library level should be useful to anyone.


>
>
>  (1) Why do you set a timeout at all? Just a best practice to avoid an
>> application hang? (Good idea!) If so, the obvious workaround is to
>> increase the timeout (60 seconds?) to accommodate slow servers. Would
>> this be a satisfactory solution?
>> I'd say, make it configurable. 10 seconds to start responding in 2013 is
>> not slow,
>> it's a geologic era...
>>
>
> Good idea. But what default? Java 6 defaults to waiting indefinitely,
> which will never fail[*].  :-D
>
> [*] Depending on your definition of failure, of course.
>
>
>  The original AppSchemaCache had no timeout and did not write to a file
>> until it had all the bytes of the remote resource, so 9.x is not
>> affected by these issues.
>> Right right, good idea to complete the write on disk only when the
>> download
>> is complete to avoid half downloaded files. But keeping everything in
>> memory
>> could be dangerous, maybe write a temp file and rename it to the final
>> destination once done
>>
>
> The resources are only kilobytes. Using a temp file is Mauro's solution to
> parallel thread support; the temp copy is discarded after use (the first
> thread uses a non-temp location). A subtle change to this behaviour could
> be a solution.
>
>
I think so.
Mauro

-- 
==
GeoServer training in Milan, 6th & 7th June 2013! Visit
http://geoserver.geo-solutions.it for more information.
==

Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer

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

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

---
--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] SchemaCache timeout error

2013-05-23 Thread Mauro Bartolomeoli
2013/5/23 Andrea Aime 

> On Thu, May 23, 2013 at 5:48 AM, Ben Caradoc-Davies <
> ben.caradoc-dav...@csiro.au> wrote:
>
>> Mauro,
>>
>> your improvements to SchemaCache have also introduced an unanticipated
>> problem triggered by download failure:
>> https://jira.codehaus.org/browse/GEOT-4467
>>
>> You set a 10 second timeout on connections and reads. It turns out that
>> some application schemas, including that used in the GeoServer
>> app-schema tutorial, import this W3 schema, which often takes more than
>> 10 seconds to connect:
>> http://www.w3.org/2001/xml.xsd
>
>
> Ah, this one is a nightmare, it's always super-slow to download (I guess
> because
> anything XML ends up linking it).
> Imho, we should have a copy of it baked directly into code to avoid
> downloading it
> over and over.
>

Right! that was the schema that has triggered this work at the beginning.


>
>
>> (1) Why do you set a timeout at all? Just a best practice to avoid an
>> application hang? (Good idea!) If so, the obvious workaround is to
>> increase the timeout (60 seconds?) to accommodate slow servers. Would
>> this be a satisfactory solution?
>>
>
> I'd say, make it configurable. 10 seconds to start responding in 2013 is
> not slow,
> it's a geologic era...
>

How would you do that, through a -Dschema.cache.connection.timeout=60 for
example ?


>
>
>>
>> (2) Please look at the logic in SchemaCache.startDownload(). Why is it
>> necessary to create an empty file? How should SchemaCache recover when a
>> download fails? Please have a look and recommend a solution. I know you
>> gave this some thought and I do not want to introduce a deadlock or
>> thread blocking that might impact your performance.
>>
>
> Fully agree this is a problem
>
>
>>
>> The original AppSchemaCache had no timeout and did not write to a file
>> until it had all the bytes of the remote resource, so 9.x is not
>> affected by these issues.
>>
>
> Right right, good idea to complete the write on disk only when the download
> is complete to avoid half downloaded files. But keeping everything in
> memory
> could be dangerous, maybe write a temp file and rename it to the final
> destination once done
>

Yes, I think using a temp file name should do the trick.

Mauro

-- 
==
GeoServer training in Milan, 6th & 7th June 2013! Visit
http://geoserver.geo-solutions.it for more information.
==

Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer

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

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

---
--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] SchemaCache timeout error

2013-05-23 Thread Ben Caradoc-Davies
On 23/05/13 14:26, Andrea Aime wrote:
> On Thu, May 23, 2013 at 5:48 AM, Ben Caradoc-Davies
> mailto:ben.caradoc-dav...@csiro.au>> wrote:
> http://www.w3.org/2001/xml.xsd
> Ah, this one is a nightmare, it's always super-slow to download (I guess
> because
> anything XML ends up linking it).
> Imho, we should have a copy of it baked directly into code to avoid
> downloading it
> over and over.

Placing this file as /org/w3/www/2001/xml.xsd on the classpath (in any 
jar) will cause SchemaResolver to pick it up before hitting SchemaCache. 
The gt-xml jar is a good place.

This is currently being imported via the new xlink.xsd and smil20.xsd 
(since the great XLink change of 2012).

> (1) Why do you set a timeout at all? Just a best practice to avoid an
> application hang? (Good idea!) If so, the obvious workaround is to
> increase the timeout (60 seconds?) to accommodate slow servers. Would
> this be a satisfactory solution?
> I'd say, make it configurable. 10 seconds to start responding in 2013 is
> not slow,
> it's a geologic era...

Good idea. But what default? Java 6 defaults to waiting indefinitely, 
which will never fail[*].  :-D

[*] Depending on your definition of failure, of course.

> The original AppSchemaCache had no timeout and did not write to a file
> until it had all the bytes of the remote resource, so 9.x is not
> affected by these issues.
> Right right, good idea to complete the write on disk only when the download
> is complete to avoid half downloaded files. But keeping everything in memory
> could be dangerous, maybe write a temp file and rename it to the final
> destination once done

The resources are only kilobytes. Using a temp file is Mauro's solution 
to parallel thread support; the temp copy is discarded after use (the 
first thread uses a non-temp location). A subtle change to this 
behaviour could be a solution.

Kind regards,

-- 
Ben Caradoc-Davies 
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel