-
Notifications
You must be signed in to change notification settings - Fork 683
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-6117: Makes modules out of geode-core and geode-cq #2915
Conversation
- Moves all o.a.g.internal.cq(ish) classes to o.a.g.cq.internal. - Fixes dependencies - Temporarily removes runtime dependency on Shiro to fix client modules. Co-authored-by: Jacob Barrett <jbarrett@pivotal.io> Co-authored-by: Owen Nichols <onichols@pivotal.io>
Authored-by: Jacob Barrett <jbarrett@pivotal.io>
Authored-by: Jacob Barrett <jbarrett@pivotal.io>
Co-authored-by: Jacob Barrett <jbarrett@pivotal.io> Co-authored-by: Owen Nichols <onichols@pivotal.io>
Co-authored-by: Jacob Barrett <jbarrett@pivotal.io> Co-authored-by: Owen Nichols <onichols@pivotal.io>
Co-authored-by: Jacob Barrett <jbarrett@pivotal.io> Co-authored-by: Owen Nichols <onichols@pivotal.io>
Authored-by: Jacob Barrett <jbarrett@pivotal.io>
@@ -66,7 +66,7 @@ private QueryOp() { | |||
/** | |||
* Note: this class is extended by CreateCQWithIROpImpl. | |||
*/ | |||
protected static class QueryOpImpl extends AbstractOp { | |||
public static class QueryOpImpl extends AbstractOp { |
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.
Why does this need to be public now? I suppose it is part of an internal package, so does that mean we don't need to worry about this being a public API change? Mainly I'm just curious why this became public, I'm not seeing the corresponding usage that requires it to be public in this PR.
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.
There is a class in the geode-cq
that inherits from this inner class. Tt was able to before because it was in the same package but to support modules we can't split packages across jars anymore. In order for the geode-cq
class to access this class it must now be public. Since it is "internal" it should not be considered public API. In fact it isn't exported in a way that any module other than geode-cq
can access it in the module-info.java
.
@@ -287,6 +287,9 @@ public static String processIncomingClassName(String name) { | |||
if (name.startsWith(oldPackage)) { | |||
return newPackage + name.substring(oldPackage.length()); | |||
} | |||
if (name.equals("org.apache.geode.cache.query.internal.cq.ServerCQImpl")) { |
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.
This string and the one below it are used twice in this class. Maybe extract them into static final
fields?
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.
Sure could. Was staying consistent with the other swizzle happening here.
} | ||
|
||
private String removeModuleFromGradlePath(String classpath, String module) { | ||
// geode-cq/build/classes/java/main |
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.
Not sure this comment is very helpful
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 isn't, got left on accident. Thanks!
@mcmellawatt can we get a re-review and blessing? |
* limitations under the License. | ||
*/ | ||
|
||
jar.enabled = false |
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.
No changes needed, but it would be nice if the build didn't assume that every subdirectory is a java
project.
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 know right? This is a result of us putting java
in a subproject
block. Gradle treats all directories as projects so all directories are Java!
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 don't think org.apache.geode.cq
is a good package name. We're moving these classes from org.apache.geode.cache.query.internal.cq
and cq (Continuous Query) is a sub-feature of query. I think it should be:
org.apache.geode.cache.query.cq
@kirklund I tried to keep the package names, module names and project names consistent. I am up for any naming really but we need consistency that we don't have today. The rational for package So you are asking for classes in I think over time what we will see then is that stuff in Feels a little verbose but works for me I guess. What module name would you suggest? |
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.
Looks solid. My only real complaint is with the ext.
in the gradles. Great cleanups throughout in addition to the moves.
@@ -91,7 +91,7 @@ If you are deploying an ear file: | |||
lib/fastutil-7.0.2.jar | |||
lib/geode-core-1.0.0.jar | |||
lib/geode-json-1.0.0.jar | |||
lib/javax.transaction-api-1.2.jar | |||
lib/javax.transaction-api-1.3.jar |
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 don't really know what this file is documenting, but every other version here is wildly out of date
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.
These are the minimum changes to get modules working from a client. Yes other deps may be old but out of scope for this work.
"org.apache.geode.distributed.internal.tcpserver"; | ||
private static final String POST_GEODE_190_SERVER_CQIMPL = | ||
"org.apache.geode.cq.internal.cache.query.ServerCQImpl"; | ||
private static final String PRE_GEODE_190_SERVER_CQIMPL = |
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.
Always love to see these simple sorts of cleanups.
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.
👍
private String[] buildJavaCommand(int vmNum, int namingPort, String version) { | ||
String cmd = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java"; | ||
String cmd = System.getProperty("java.home") + File.separator | ||
+ "bin" + File.separator + "java"; |
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.
Just a reminder that, by popular request, spotless
will no longer remove extra whitespace within a line, even if the result will no longer exceed the 80-width limit. For instance, this line's diff isn't necessary for spotless (but I assume it was at some point during your iteration).
@@ -104,6 +104,8 @@ task createVersionPropertiesFile(dependsOn: ':writeBuildInfo') { | |||
} | |||
} | |||
|
|||
ext.moduleName = group + '.core' |
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'm really not a fan of bloating out the ext
in our project / subprojects. Is there a reason this shouldn't just be in-lined below?
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.
The modules "plugin" expects it project. It is consistent with the experimental plugin from Gradle. Eventually they will have first level support for this.
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 also mention that it goes away completely with the upcoming module-info.java
changes.
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.
Ah, makes sense and good to hear.
@@ -60,3 +60,12 @@ dependencies { | |||
|
|||
upgradeTestRuntime(project(':geode-old-versions')) | |||
} | |||
|
|||
ext.moduleName = group + '.cq' |
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.
Ditto ext
comment in core.
I forgot geode-cq is a module but geode-query is not [edited]. It still seems like cq is part of query(ing) though. We can't use org.apache.geode.cache.query.cq inside geode-cq? Or is that just convention? Would we ever create geode-query to contain org.apache.geode.cache.query and then geode-cq adds cq onto that? I'm thinking that geode-core will eventually contain org.apache.geode.logging to contain our LogService and SPI for the LogWriter and Alert appenders (or even move that to geode-logging). Then geode-log4j would contain our default impls of that SPI which are the LogWriter and Alert appenders that are written with log4j-core. Then geode-core uses geode-logging and geode-log4j is an optional provider to the SPI in geode-logging. Or is that too many sub-modules (I'm new to modules!)? So, my input on cq is based mainly on cq being something that builds on query. If org.apache.geode.cache.query.cq is ugly because of geode-cq or if we would never split out query to geode-query then my suggestion probably isn't very relevant. Either way I'll mark my request as resolved and let you decide which way to go. [I edited the package names to include ".cache."] |
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.
See my latest comment on the PR itself.
Since package
Maybe... We can alway refactor later if we do and it feels better to have cq someone logically grouped under query at that point. Having two modules that contain the same bits with different names would be fine as long as one and only one is on the module path at any time. You would simply stop including the deprecated on in the BOM.
No, that sounds perfect.
All valid thoughts. It would be good for us to get it right and not have to deprecate and refactor a module later. I guess I could fall sort of in the middle. I wouldn't have the package name to deviate too far from the module name unless there is a really strong argument. To me the "cache" part feels redundant since Geode is the "cache". So I could see module and package name of Any additional thoughts before I flip a coin? |
The difference between |
@kirklund So lets do this: Yes? |
Thumbs up! Already approved. |
Co-authored-by: Jacob Barrett jbarrett@pivotal.io
Co-authored-by: Owen Nichols onichols@pivotal.io
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.