New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GEODE-5032: Update cluster configuration objects for more intuitive consumption #1848
Conversation
I meant to put this in the commit message, but it must've gotten lost when I rebased: Changes include:
I have included the This PR does not update or adjust any of the configuration objects in |
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
<xsd:schema |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we need to check both the cluster-config.xsd, the *.xjb and the generated POJOs into the source tree? It would be ideal if we can do either:
- keeping the xsd, and xjb and have the POJOs generated by the build process. Which gives us a nice one place to see all the changes we've made to the schema.
- keeping the POJOs only. It would be easier for the developer to add/modify the methods instead of trying to find the way to transform it using a binding file (.xjb).
A third option is:
3. keeping the massaged xsd and the POJOs. the XSD is just a reference to keep all the changes in one place and for future reference. it's not used in the build process.
Not sure which way we would like to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd love to get to the point where we could just generate the POJOs as part of the build process, even if it has to be based on an "internal only" XSD.
During iteration, I found there is some trouble with getting CacheElement
to selectively apply to some but not all classes. There are some 3rd party libraries that could help on that front and with gradle integration. I was hesitant to introduce a new dependency for this, though, and don't remember which licenses are compatible with the Apache 2.0.
I don't like the idea that the config classes are all treated like first-class citizens. We're already pushing the line where some config classes are special cases. Every special case is a pitfall for a future developer.
If the massaged XSD isn't actually consumed (and won't be in the future), then I should just remove it from this PR. Future developers won't remember to update the XSD or bindings file with every update to the POJOs, and once it's out of date, its existence will just add confusion.
configProperty.setType("test"); | ||
configProperty.setValue("test"); | ||
jndiBinding.getConfigProperties().add(configProperty); | ||
cacheConfig.getJndiBindings().getJndiBindings().add(jndiBinding); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be `cacheConfig.getJndiBindings().add(jndiBinding)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops! Looks like my build alias skips compiling on the test side. That's something I need to fix!
@@ -65,7 +65,7 @@ public void noServiceNoMember() { | |||
@Test | |||
public void hasServiceNoBindingNoMember() { | |||
doReturn(ccService).when(command).getConfigurationService(); | |||
when(cacheConfig.getJndiBindings()).thenReturn(Collections.emptyList()); | |||
when(cacheConfig.getJndiBindings().getJndiBindings()).thenReturn(Collections.emptyList()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... another one of these getJndiBindings().getJndiBindings()
…his branch's history for future reference.
@XmlElement(name = "config-property-name", namespace = "http://geode.apache.org/schema/cache", | ||
required = true) | ||
protected String configPropertyName; | ||
protected String name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we changed the name to be "configPropertyName" for some json serialization which requires this name. Do all tests pass?
@@ -174,8 +174,9 @@ | |||
*/ | |||
@XmlAccessorType(XmlAccessType.FIELD) | |||
@XmlType(name = "", propOrder = {"className"}) | |||
public static class Instantiator { | |||
public static class Instantiator implements Serializable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to add the class to geode-core-sanctioned-serializable.txt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice that for every change we made to the POJO, we would have a junit test to make sure the resulting xml still pass the xsd validation.
Oops, I messed up my branches and accidentally pushed the restoration of the build files. Considering the drift between this and the extant iteration, I think I'll just close this PR for now and open a new one if it comes to that. |
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?
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.