You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by "jdeppe-pivotal (GitHub)" <gi...@apache.org> on 2019/01/16 19:46:10 UTC

[GitHub] [geode] jdeppe-pivotal opened pull request #3083: GEODE-6280: Create new public module for the Management API

- This moves various 'config' classes into a public module

Signed-off-by: Peter Tran <pt...@pivotal.io>

PLEASE DO NOT REVIEW YET - Thanks.

Thank you for submitting a contribution to Apache Geode.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?

- [ ] Has your PR been rebased against the latest commit within the target branch (typically `develop`)?

- [ ] Is your initial contribution a single, squashed commit?

- [ ] Does `gradlew build` run cleanly?

- [ ] Have you written or updated unit tests to verify your changes?

- [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?

### Note:
Please ensure that once the PR is submitted, you check travis-ci for build issues and
submit an update to your PR as soon as possible. If you need help, please send an
email to dev@geode.apache.org.


[ Full content available at: https://github.com/apache/geode/pull/3083 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org

[GitHub] [geode] kohlmu-pivotal commented on pull request #3083: GEODE-6280: Create new public module for the Management API

Posted by "kohlmu-pivotal (GitHub)" <gi...@apache.org>.
What is `V` supposed to be? `V extends *SomeSpecificType` or `V extends Object`? Without declaration of what `V` is, you might just as well return `Object`

[ Full content available at: https://github.com/apache/geode/pull/3083 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org

[GitHub] [geode] kohlmu-pivotal commented on pull request #3083: GEODE-6280: Create new public module for the Management API

Posted by "kohlmu-pivotal (GitHub)" <gi...@apache.org>.
you'll have to define the `ConfigTypeInstantiator` as follows:
`public interface ConfigTypeInstantiator<T,Q>{
<V extends Q> V newInstance(T type)
}`

and then the `DeclarableTypeInstantiator` can become:
`public class DeclarableTypeInstantiator implements ConfigTypeInstantiator<DeclarableType,Declarable>{
@Override
public <T extends Declarable> T newInstance(DeclarableType type){...
...
...
}`

[ Full content available at: https://github.com/apache/geode/pull/3083 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org

[GitHub] [geode] jdeppe-pivotal commented on pull request #3083: GEODE-6280: Create new public module for the Management API

Posted by "jdeppe-pivotal (GitHub)" <gi...@apache.org>.
The class is marked as `@Experimental` which would allow for changes

[ Full content available at: https://github.com/apache/geode/pull/3083 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org

[GitHub] [geode] jdeppe-pivotal commented on pull request #3083: GEODE-6280: Create new public module for the Management API

Posted by "jdeppe-pivotal (GitHub)" <gi...@apache.org>.
Unfortunately that also doesn't get to what you'd like. For this to work, the concrete method declaration would then need to be `public <V> V newInstance(ConfigTypeInstantiator<DeclarableType, Declarable> instantiator) {`. However that then requires the `Declarable` class to be visible to this module. The only way I see to get this to compile, is to replace `Declarable` with `?` which ends up again not restricting the returned type. 

[ Full content available at: https://github.com/apache/geode/pull/3083 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org

[GitHub] [geode] jinmeiliao commented on pull request #3083: GEODE-6280: Create new public module for the Management API

Posted by "jinmeiliao (GitHub)" <gi...@apache.org>.
I see the need to move this functionality out of here. We can probably completely get rid of this method, and have an instantiator to instantiate the instance. e.g.
```
mutator.setCacheLoader(ConfigInstantiator.instantiate(config, cache));
```

[ Full content available at: https://github.com/apache/geode/pull/3083 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org

[GitHub] [geode] kohlmu-pivotal commented on pull request #3083: GEODE-6280: Create new public module for the Management API

Posted by "kohlmu-pivotal (GitHub)" <gi...@apache.org>.
you'll have to define the `ConfigTypeInstantiator` as follows:
`public interface ConfigTypeInstantiator<T,Q>{
<V extends Q> V newInstance(T type)
}`

and then the `DeclarableTypeInstantiator` can become:
`public class DeclarableTypeInstantiator implements ConfigTypeInstantiator<DeclarableType,Declarable>{
@Override
public <T extends Declarable> T newInstance(DeclarableType type){...
...
...
}`

[ Full content available at: https://github.com/apache/geode/pull/3083 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org

[GitHub] [geode] jdeppe-pivotal closed pull request #3083: GEODE-6280: Create new public module for the Management API

Posted by "jdeppe-pivotal (GitHub)" <gi...@apache.org>.
[ pull request closed by jdeppe-pivotal ]

[ Full content available at: https://github.com/apache/geode/pull/3083 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org

[GitHub] [geode] kohlmu-pivotal commented on pull request #3083: GEODE-6280: Create new public module for the Management API

Posted by "kohlmu-pivotal (GitHub)" <gi...@apache.org>.
Maybe `T extends Declarable`

[ Full content available at: https://github.com/apache/geode/pull/3083 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org

[GitHub] [geode] jdeppe-pivotal commented on pull request #3083: GEODE-6280: Create new public module for the Management API

Posted by "jdeppe-pivotal (GitHub)" <gi...@apache.org>.
Yes - thanks!

[ Full content available at: https://github.com/apache/geode/pull/3083 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org

[GitHub] [geode] jdeppe-pivotal commented on pull request #3083: GEODE-6280: Create new public module for the Management API

Posted by "jdeppe-pivotal (GitHub)" <gi...@apache.org>.
Doesn't seem to be syntactically possible, but my Generic foo is weak...

[ Full content available at: https://github.com/apache/geode/pull/3083 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org

[GitHub] [geode] kohlmu-pivotal commented on pull request #3083: GEODE-6280: Create new public module for the Management API

Posted by "kohlmu-pivotal (GitHub)" <gi...@apache.org>.
you'll have to define the `ConfigTypeInstantiator` as follows:
`public interface ConfigTypeInstantiator<T,Q>{
<V extends Q> V newInstance(T type)
}`

and then the `DeclarableTypeInstantiator` can become:
`public class DeclarableTypeInstantiator implements ConfigTypeInstantiator<DeclarableType,Declarable>{

@Override
public <T extends Declarable> T newInstance(DeclarableType type){...
...
...
}`

[ Full content available at: https://github.com/apache/geode/pull/3083 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org

[GitHub] [geode] jdeppe-pivotal commented on issue #3083: GEODE-6280: Create new public module for the Management API

Posted by "jdeppe-pivotal (GitHub)" <gi...@apache.org>.
@aditya87 - for your review

[ Full content available at: https://github.com/apache/geode/pull/3083 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org

[GitHub] [geode] jinmeiliao commented on pull request #3083: GEODE-6280: Create new public module for the Management API

Posted by "jinmeiliao (GitHub)" <gi...@apache.org>.
should this be <T> T instead?

[ Full content available at: https://github.com/apache/geode/pull/3083 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org

[GitHub] [geode] kohlmu-pivotal commented on pull request #3083: GEODE-6280: Create new public module for the Management API

Posted by "kohlmu-pivotal (GitHub)" <gi...@apache.org>.
We cannot change this method declaration. :( public API... or at least this Class is not in the "internal" namespace and therefore can be seen as public. We'd have to deprecate this in favor of the alternative of asking the `ConfigTypeInstantiator` create this instance

[ Full content available at: https://github.com/apache/geode/pull/3083 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org