Re: [Discuss] Investigation of C++ object return types

2017-09-17 Thread Jacob Barrett
Ok, one more idea.
https://gist.github.com/pivotal-jbarrett/beed5f70c1f3a238cef94832b13dab7a

The biggest issue with the value model is that we have been using a factory
to build the Cache object. We really don't need one and if we get rid of it
things look much better. They aren't perfect since we still need the back
pointer from the impl to the cache for later use. If we didn't need that
then we could allow copy construction. As it stands right now this version
allows value, shared_prt, unique_ptr, etc. without any real overhead or RVO
issues.

The big change is that, rather than have a factory that we set a bunch of
values on and then ask it to create the Cache, we create a CacheConfig
object and pass that in to the Cache's constructor. Cache passes it to
CacheImpl and CacheImpl sets itself up based on the config. If you look at
what the current factory model does it isn't that different. For clarity I
added an XmlCacheConfig object to that builds up the CacheConfig via Xml.
You could imagine a YamlCacheConfig object *shiver*. The point is we don't
care as long as we get a CacheConfig with all the things we support at
"init" time.

I know it is a more radical change but I feel it is more C++ and more
testable than the factory model. I also like that it solves some of the
issues with the value model we were looking at.

-Jake

On Thu, Sep 14, 2017 at 5:16 PM Jacob Barrett  wrote:

> Y'all here is an attempt to get the best of both worlds.
> https://gist.github.com/pivotal-jbarrett/52ba9ec5de0b494368d1c5282ef188ef
>
> I thought I would try posting to Gist but so far not impressed, sorry.
>
> The Gist of it is that we can overcome the thirdpary or transient
> reference back to the public Cache instance by keeping a reference to it in
> the implementation instance and updating it whenever the move constructor
> is called.
>
> The downside is if your run this test it doesn't show RVO kicking in on
> the second test where we move the value into a shared pointer. There are a
> couple of pitfalls you can stumble into as well by trying to used the
> previous instance to access the cache after the move operation, as
> illustrated by the "BAD" commented lines.
>
> The upside is the choices this gives the use for ownership of their
> factory constructed Cache instance. They can keep it a value or move it to
> unique or shared pointer.
>
> Overhead wise I think we better off in value as long as there are no
> moves, rare I would thing, but the moves are pretty cheap at the point
> since we only maintain a unique_ptr. After moving into a shared_ptr it acts
> identical to the shared_ptr model proposed earlier.
>
> -Jake
>
>
> On Thu, Sep 14, 2017 at 3:36 PM Michael Martell 
> wrote:
>
>> Late to this party.
>>
>> Confession 1: I had to look up both RVO and copy-elision.
>> Confession 2: I don't like using pointers at all. I used to, but I've
>> evolved to just use C# and Java :)
>>
>> Without investing a lot more time, I don't have strong feelings about raw
>> vs shared pointers. My only question is: Can we return ptr to abstract
>> class everywhere we return objects? Just thinking of mocking, which always
>> wants to mock interfaces.
>>
>> On Thu, Sep 14, 2017 at 2:25 PM, Michael William Dodge > >
>> wrote:
>>
>> > +0 shared pointer
>> >
>> > > On 14 Sep, 2017, at 14:09, Ernest Burghardt 
>> > wrote:
>> > >
>> > > Calling a vote for:
>> > >
>> > > - Raw pointer
>> > > - shard pointer
>> > >
>> > > +1 raw Pointer, I had to look up RVO and am new to std::move(s)
>> > >
>> > > On Thu, Sep 14, 2017 at 3:02 PM, Michael William Dodge <
>> > mdo...@pivotal.io>
>> > > wrote:
>> > >
>> > >> I generally dig reference-counted pointers for avoiding lifetime
>> issues
>> > >> with objects allocated off the heap but I can live with bare
>> pointers,
>> > too.
>> > >>
>> > >> Sarge
>> > >>
>> > >>> On 13 Sep, 2017, at 16:25, Mark Hanson  wrote:
>> > >>>
>> > >>> Hi All,
>> > >>>
>> > >>> I favor the “pointer" approach that is identified in the code
>> sample.
>> > >> There is greater clarity and less bytes seemingly created and
>> written.
>> > We
>> > >> do sacrifice the potential ease of using an object, but in all, I
>> think
>> > the
>> > >> way our code is structured. It is not conducive to do a value
>> approach,
>> > >> from an efficiency standpoint,  because of our use of the pimpl
>> model.
>> > >>>
>> > >>> Thanks,
>> > >>> Mark
>> > >>>
>> >  On Sep 12, 2017, at 11:09 AM, Jacob Barrett 
>> > >> wrote:
>> > 
>> >  My biggest concern with this model is that access to the public
>> Cache
>> >  object from other public objects results in additional allocations
>> of
>> > a
>> >  Cache value. Think about when we are inside a Serializable object
>> and
>> > we
>> >  access the Cache from DataOutput.
>> > 
>> >  As value:
>> >  Serializable* MyClass::fromData(DataInput& dataInput) {
>> >  auto cache = dataOutput.getCache();
>> >  ...
>> >  }
>> >  In this the value of cache wi

Build failed in Jenkins: Geode-nightly #957

2017-09-17 Thread Apache Jenkins Server
See 

--
[...truncated 117.85 KB...]
:geode-json:distributedTest NO-SOURCE
:geode-json:integrationTest NO-SOURCE
:geode-junit:javadoc
:geode-junit:javadocJar
:geode-junit:sourcesJar
:geode-junit:signArchives SKIPPED
:geode-junit:assemble
:geode-junit:compileTestJavaNote: 

 uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: 

 uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

:geode-junit:processTestResources
:geode-junit:testClasses
:geode-junit:checkMissedTests
:geode-junit:spotlessJavaCheck
:geode-junit:spotlessCheck
:geode-junit:test
:geode-junit:check
:geode-junit:build
:geode-junit:distributedTest
:geode-junit:integrationTest
:geode-lucene:assemble
:geode-lucene:compileTestJavaNote: Some input files use or override a 
deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

:geode-lucene:processTestResources
:geode-lucene:testClasses
:geode-lucene:checkMissedTests
:geode-lucene:spotlessJavaCheck
:geode-lucene:spotlessCheck
:geode-lucene:test
:geode-lucene:check
:geode-lucene:build
:geode-lucene:distributedTest
:geode-lucene:integrationTest
:geode-old-client-support:assemble
:geode-old-client-support:compileTestJavaNote: 

 uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

:geode-old-client-support:processTestResources NO-SOURCE
:geode-old-client-support:testClasses
:geode-old-client-support:checkMissedTests
:geode-old-client-support:spotlessJavaCheck
:geode-old-client-support:spotlessCheck
:geode-old-client-support:test
:geode-old-client-support:check
:geode-old-client-support:build
:geode-old-client-support:distributedTest
:geode-old-client-support:integrationTest
:geode-old-versions:distributedTest NO-SOURCE
:geode-old-versions:integrationTest NO-SOURCE
:geode-protobuf:assemble
:geode-protobuf:extractIncludeTestProto
:geode-protobuf:extractTestProto UP-TO-DATE
:geode-protobuf:generateTestProto NO-SOURCE
:geode-protobuf:compileTestJavaNote: Some input files use unchecked or unsafe 
operations.
Note: Recompile with -Xlint:unchecked for details.

:geode-protobuf:processTestResources
:geode-protobuf:testClasses
:geode-protobuf:checkMissedTests
:geode-protobuf:spotlessJavaCheck
:geode-protobuf:spotlessCheck
:geode-protobuf:test
:geode-protobuf:check
:geode-protobuf:build
:geode-protobuf:distributedTest
:geode-protobuf:integrationTest

org.apache.geode.protocol.acceptance.CacheConnectionTimeoutJUnitTest > 
testUnresponsiveClientsGetDisconnected FAILED
org.awaitility.core.ConditionTimeoutException: Condition defined as a 
lambda expression in 
org.apache.geode.protocol.acceptance.CacheConnectionTimeoutJUnitTest null 
within 1120 milliseconds.
at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:104)
at 
org.awaitility.core.AssertionCondition.await(AssertionCondition.java:117)
at 
org.awaitility.core.AssertionCondition.await(AssertionCondition.java:32)
at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:809)
at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:648)
at 
org.apache.geode.protocol.acceptance.CacheConnectionTimeoutJUnitTest.testUnresponsiveClientsGetDisconnected(CacheConnectionTimeoutJUnitTest.java:128)

13 tests completed, 1 failed
:geode-protobuf:integrationTest FAILED
:geode-pulse:assemble
:geode-pulse:compileTestJavaNote: Some input files use or override a deprecated 
API.
Note: Recompile with -Xlint:deprecation for details.
Note: 

 uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

:geode-pulse:processTestResources
:geode-pulse:testClasses
:geode-pulse:checkMissedTests
:geode-pulse:spotlessJavaCheck
:geode-pulse:spotlessCheck
:geode-pulse:test
:geode-pulse:check
:geode-pulse:build
:geode-pulse:distributedTest
:geode-pulse:integrationTest
:geode-rebalancer:assemble
:geode-rebalancer:compileTestJava
:geode-rebalancer:processTestResources NO-SOURCE
:geode-rebalancer:testClasses
:geode-rebalancer:checkMissedTests
:geode-rebalancer:spotlessJavaCheck
:geode-rebalancer:spotlessCheck
:geode-rebalancer:test
:geode-rebalancer:check
:geode-rebalancer:build
:geode-rebalancer:dist

Build failed in Jenkins: Geode-nightly-flaky #124

2017-09-17 Thread Apache Jenkins Server
See 


Changes:

[dbarnes] User Guide: reformatted a badly-formed link (gfsh create region 
command)

--
[...truncated 115.55 KB...]
Download 
https://repo1.maven.org/maven2/com/fasterxml/jackson/module/jackson-module-scala_2.10/2.8.6/jackson-module-scala_2.10-2.8.6.pom
Download 
https://repo1.maven.org/maven2/io/springfox/springfox-swagger2/2.6.1/springfox-swagger2-2.6.1.pom
Download 
https://repo1.maven.org/maven2/io/springfox/springfox-swagger-ui/2.6.1/springfox-swagger-ui-2.6.1.pom
Download 
https://repo1.maven.org/maven2/org/springframework/hateoas/spring-hateoas/0.23.0.RELEASE/spring-hateoas-0.23.0.RELEASE.pom
Download 
https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.10.6/scala-reflect-2.10.6.pom
Download 
https://repo1.maven.org/maven2/com/fasterxml/jackson/module/jackson-module-paranamer/2.8.6/jackson-module-paranamer-2.8.6.pom
Download 
https://repo1.maven.org/maven2/com/fasterxml/jackson/module/jackson-modules-base/2.8.6/jackson-modules-base-2.8.6.pom
Download 
https://repo1.maven.org/maven2/com/fasterxml/jackson/jackson-bom/2.8.6/jackson-bom-2.8.6.pom
Download 
https://repo1.maven.org/maven2/io/swagger/swagger-annotations/1.5.10/swagger-annotations-1.5.10.pom
Download 
https://repo1.maven.org/maven2/io/swagger/swagger-project/1.5.10/swagger-project-1.5.10.pom
Download 
https://repo1.maven.org/maven2/io/swagger/swagger-models/1.5.10/swagger-models-1.5.10.pom
Download 
https://repo1.maven.org/maven2/io/springfox/springfox-spi/2.6.1/springfox-spi-2.6.1.pom
Download 
https://repo1.maven.org/maven2/io/springfox/springfox-schema/2.6.1/springfox-schema-2.6.1.pom
Download 
https://repo1.maven.org/maven2/io/springfox/springfox-swagger-common/2.6.1/springfox-swagger-common-2.6.1.pom
Download 
https://repo1.maven.org/maven2/io/springfox/springfox-spring-web/2.6.1/springfox-spring-web-2.6.1.pom
Download 
https://repo1.maven.org/maven2/com/fasterxml/classmate/1.3.1/classmate-1.3.1.pom
Download 
https://repo1.maven.org/maven2/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE.pom
Download 
https://repo1.maven.org/maven2/org/springframework/plugin/spring-plugin/1.2.0.RELEASE/spring-plugin-1.2.0.RELEASE.pom
Download 
https://repo1.maven.org/maven2/org/springframework/plugin/spring-plugin-metadata/1.2.0.RELEASE/spring-plugin-metadata-1.2.0.RELEASE.pom
Download 
https://repo1.maven.org/maven2/org/mapstruct/mapstruct/1.0.0.Final/mapstruct-1.0.0.Final.pom
Download 
https://repo1.maven.org/maven2/org/mapstruct/mapstruct-parent/1.0.0.Final/mapstruct-parent-1.0.0.Final.pom
Download 
https://repo1.maven.org/maven2/org/springframework/spring-expression/4.3.5.RELEASE/spring-expression-4.3.5.RELEASE.pom
Download 
https://repo1.maven.org/maven2/io/springfox/springfox-core/2.6.1/springfox-core-2.6.1.pom
Download 
https://repo1.maven.org/maven2/com/fasterxml/jackson/module/jackson-module-scala_2.10/2.8.6/jackson-module-scala_2.10-2.8.6.jar
Download 
https://repo1.maven.org/maven2/io/springfox/springfox-swagger2/2.6.1/springfox-swagger2-2.6.1.jar
Download 
https://repo1.maven.org/maven2/io/springfox/springfox-swagger-ui/2.6.1/springfox-swagger-ui-2.6.1.jar
Download 
https://repo1.maven.org/maven2/org/springframework/hateoas/spring-hateoas/0.23.0.RELEASE/spring-hateoas-0.23.0.RELEASE.jar
Download 
https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.10.6/scala-reflect-2.10.6.jar
Download 
https://repo1.maven.org/maven2/com/fasterxml/jackson/module/jackson-module-paranamer/2.8.6/jackson-module-paranamer-2.8.6.jar
Download 
https://repo1.maven.org/maven2/io/swagger/swagger-annotations/1.5.10/swagger-annotations-1.5.10.jar
Download 
https://repo1.maven.org/maven2/io/swagger/swagger-models/1.5.10/swagger-models-1.5.10.jar
Download 
https://repo1.maven.org/maven2/io/springfox/springfox-spi/2.6.1/springfox-spi-2.6.1.jar
Download 
https://repo1.maven.org/maven2/io/springfox/springfox-schema/2.6.1/springfox-schema-2.6.1.jar
Download 
https://repo1.maven.org/maven2/io/springfox/springfox-swagger-common/2.6.1/springfox-swagger-common-2.6.1.jar
Download 
https://repo1.maven.org/maven2/io/springfox/springfox-spring-web/2.6.1/springfox-spring-web-2.6.1.jar
Download 
https://repo1.maven.org/maven2/com/fasterxml/classmate/1.3.1/classmate-1.3.1.jar
Download 
https://repo1.maven.org/maven2/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE.jar
Download 
https://repo1.maven.org/maven2/org/springframework/plugin/spring-plugin-metadata/1.2.0.RELEASE/spring-plugin-metadata-1.2.0.RELEASE.jar
Download 
https://repo1.maven.org/maven2/org/mapstruct/mapstruct/1.0.0.Final/mapstruct-1.0.0.Final.jar
Download 
https://repo1.maven.org/maven2/io/springfox/springfox-core/2.6.1/springfox-core-2.6.1.jar
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:geode-web-api:process

[Spring CI] Spring Data GemFire > Nightly-ApacheGeode > #681 was SUCCESSFUL (with 2042 tests)

2017-09-17 Thread Spring CI

---
Spring Data GemFire > Nightly-ApacheGeode > #681 was successful.
---
Scheduled
2044 tests in total.

https://build.spring.io/browse/SGF-NAG-681/





--
This message is automatically generated by Atlassian Bamboo