-
Notifications
You must be signed in to change notification settings - Fork 87
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
Nodetool over REST #121
base: master
Are you sure you want to change the base?
Nodetool over REST #121
Conversation
@elcallio @amnonh @haaawk hi guys, if you will have a moment, please review this is the first step, basically after this moving all the rest of RESTNodeProbe to REST is just a matter of moving the rest calls from scylla-jmx to the probe (I don't expect such troubles as I had with cfstats dtests) also @bhalevy - I've only run dtest in byo , are there some better test suites to run for nodetool compliance? (so it behaves and reports same values like the old one?) |
nodetool compactionstats nodetool describecluster nodetool tablestats nodetool tablehistograms nodetool status nodetool info nodetool cfstats
6e17cd3
to
eb38f68
Compare
reruning dtest after adding all commands the were requested: |
I have a general concern, I think that copying the logic from scylla-jmx to the nodetool is the wrong way around it. For the long term, I think that taking the objects from scylla-jmx and plug them inside node_probe is the better approach. This way is more robust to changes both in the API and in nodetool. |
@amnonh hmm, I agree, but that would mean I will need to refactor scylla-jmx even more and break it to smaller pieces again (same way how I extracted api client) |
@amnonh also I will have to make weird changes to scylla-jmx, since lots of mxbeans have private access + lack simple constructors (and I will need to add compatibility constructors) also - how to deduplicate the same class names from different jars? (I'd have to do a special shading it seems, or you have a better idea?) |
@amnonh @elcallio
|
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.
Right. I think having the MBean stuff in a REST nodeprobe is a bad solution (copied, shaded or otherwise). It is going across the river for water. Doing multiple transformations for no good reason.
I think an initial approach should copy the code from scylla-jmx (I hate copying as much as anyone, but still), even REST API stuff. Or just use new jersey-code, allowing for using typed objects and automatic serialization (see sstableinfo in scylla-jmx). And do the ops required at given nodeprobe function.
All code will be cleaner in the nodeprobe, because it will not use artificial transfer types limited by JMX. And maybe we can extract a shared sublayer instead.
<dependency groupId="javax.activation" artifactId="activation" version="1.1" /> | ||
<dependency groupId="javax.annotation" artifactId="javax.annotation-api" version="1.2" /> | ||
<dependency groupId="org.glassfish.jersey.bundles.repackaged" artifactId="jersey-guava" version="2.22.1" /> | ||
|
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.
Good. Maven deps.
But why are some (also maven avail) files binaries 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.
ant and local run, it still expects libraries to be copied to lib properly (so above code is only published to exported maven poms, not really used locally :-( )
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 easy enough to use the maven fetch to add stuff to class path... Or simply add all maven deps to compile class path?
[submodule "scylla-jmx"] | ||
path = scylla-jmx | ||
url = [email protected]:scylladb/scylla-jmx.git | ||
branch = master |
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.
Can't we avoid submodules + build?
The cassandra build.xml has support for fetching maven dependencies. We should use this with a local maven repo (easy to set up in jenkins).
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 had this talk with Pekka and all repos need to build (ideally) independently + we are not publishing maven artifacts from scylla-jmx and there is no plan for our own maven server
so I guess this could be solved by pushing all consumable artifacts from scylla-jmx to maven repos and having a proper scylla-jmx release cycle ... but since this doesn't make sense and is extra work we ended up deciding that submodule will be the easiest thing to do
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.
You can easily have automatic maven repo generation in jenkins via the maven-repo plugin. Would literally be 5 minutes work to set up for our maven projects.
); | ||
)); | ||
|
||
if (REST) { commands.add(RESTInfo.class); } else { commands.add(Info.class); } |
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 is not accepable formatting.
if (...) {
...
} else {
...
}
Always braces.
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.
will fix
this PR is kinda waiting for something else - I am duplicating code, |
the is another issue with this - we need to support security - I am not sure we have this for the rest-api |
Should be closed, native nodetool is almost ready. |
DTest is done in
https://jenkins.scylladb.com/view/master/job/scylla-master/job/manual-and-scheduled-tests/job/byo_build_tests_dtest/653/