StatSampler no longer logs fatal message for JDK-8207200

2019-01-08 Thread Kirk Lund
I just committed a change to develop which catches the
IllegalStateException caused by JDK-8207200 when the StatSampler samples
JVM memory usage using MemoryMXBean.

commit 1143af997292df0f6d480084ffd2103fa2c17bbf (origin/develop,
origin/HEAD)
Author: Kirk Lund 
Date:   Mon Jan 7 16:43:34 2019 -0800

GEODE-6253: Handle JDK-8207200 gracefully in VM stats

The above change prevents the following, so please don't add any more
IgnoredExceptions to dunit tests for this:

[fatal 2019/01/04 00:15:19.050 UTC  tid=67] committed =
538968064 should be < max = 536870912
java.lang.IllegalArgumentException: committed = 538968064 should be <
max = 536870912
at
java.management/java.lang.management.MemoryUsage.(MemoryUsage.java:166)
at java.management/sun.management.MemoryImpl.getMemoryUsage0(Native
Method)
at
java.management/sun.management.MemoryImpl.getHeapMemoryUsage(MemoryImpl.java:71)
at
org.apache.geode.internal.stats50.VMStats50.refresh(VMStats50.java:624)
at
org.apache.geode.internal.statistics.HostStatSampler.sampleSpecialStats(HostStatSampler.java:562)
at
org.apache.geode.internal.statistics.HostStatSampler.run(HostStatSampler.java:235)
at java.base/java.lang.Thread.run(Thread.java:834)

Thanks,
Kirk


Defining public SPIs in Geode

2019-01-08 Thread Dale Emery
We are exploring adding one or more public Service Provider Interfaces (SPIs) 
for Geode, and would like some guidance about standards, conventions, 
precedent, and such.

Do we have standards or conventions for creating SPIs? Good examples? Bad 
examples?

Are there standards or conventions described elsewhere (e.g. Spring) that we 
should consider when defining SPIs?

Is it as simple(!) as defining a service interface, then using Java's 
ServiceLoader mechanism to discover and load instances of it?

Any additional considerations for adding a public SPI, compared to a private 
one?

Cheers,
Dale



Re: Defining public SPIs in Geode

2019-01-08 Thread Dan Smith
What sort of services are you thinking of adding?

Technically, things like a CacheLoader or a SecurityManager are SPIs in the
sense that they places where you can plug your code into geode. Using a
ServiceLoader might ok in cases where we want something to be plugged in if
the jar is on the classpath, without any additional configuration. So it
probably depends on what the SPI is for.

-Dan

On Tue, Jan 8, 2019 at 3:59 PM Dale Emery  wrote:

> We are exploring adding one or more public Service Provider Interfaces
> (SPIs) for Geode, and would like some guidance about standards,
> conventions, precedent, and such.
>
> Do we have standards or conventions for creating SPIs? Good examples? Bad
> examples?
>
> Are there standards or conventions described elsewhere (e.g. Spring) that
> we should consider when defining SPIs?
>
> Is it as simple(!) as defining a service interface, then using Java's
> ServiceLoader mechanism to discover and load instances of it?
>
> Any additional considerations for adding a public SPI, compared to a
> private one?
>
> Cheers,
> Dale
>
>