Skip to content

Conversation

@hustfxj
Copy link
Contributor

@hustfxj hustfxj commented Jan 26, 2016

  1. Port "org.apache.storm.zookeeper" to java at "org.apache.storm.zookeeper.Zookeeper".
  2. Update all the callings to the config functions.
  3. Deleted most functions in zookeeper.clj except a few: mk-client (because of "watcher" which is derived by clojure in some .clj files).
  4. add the package "Callback", where callback functions put. I am merging clusters and timer which involves lots of callback functions. I put them into package "Callback".

@hustfxj hustfxj changed the title port org.apache.storm.zookeeper to java [STORM-1257] port backtype.storm.zookeeper to java Jan 26, 2016
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicately here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was supposed to be the leaderlockPath, that was not set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, I made a mistake

@revans2
Copy link
Contributor

revans2 commented Jan 26, 2016

Looks like you missed a reference to in-process-zookeeper (from the CI)

Exception in thread "main" java.lang.RuntimeException: No such var: org.apache.storm.zookeeper/mk-inprocess-zookeeper, compiling:(org/apache/storm/transactional_test.clj:105:5)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is new code that didn't exist in storm proper. I think it would be cleaner to have this be a debug message instead of an info message. Also could you use "{}" substitution instead of +?

        LOG.info("Zookeeper state update: {}, {}, {}", ZkKeeperStates.getStateName(state),  ZkEventTypes.getStateName(type), path);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind about making it debug. I missed original implementation. I still would like to use the "{}" substitution though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous code never caught an exception, and especially did not eat it. Please either update the Interface to support Exceptions or wrap it in a RuntimeException and rethrow it.

@revans2
Copy link
Contributor

revans2 commented Jan 26, 2016

I am done with my first pass through the code. Overall things look good, but there are a few corner cases around error recovery and running on Windows that need to be fixed before this can go in. Also please be sure to run all of the tests and that they all pass.

@hustfxj
Copy link
Contributor Author

hustfxj commented Jan 27, 2016

Thanks @revans2 @wuchong @redsanket for all your thorough comments, I update the PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why we need this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I see that you missed updating zk-leader-elector.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again this is for stubbing, so if you want some help with this please let me know.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I don't know how to be better to port zk-leader-elector by java at nimbus_test.clj

@revans2
Copy link
Contributor

revans2 commented Jan 27, 2016

Even with all of those changes to make the tests compile I am seeing test failures. Please make sure that

mvn clean -Prat -Pall-test integration-test

passes before putting up a pull request. If you run into issues and cannot translate all of zookeeper.clj to java that is fine for a first pass others can help with different parts, but we want to be sure that we never break the build or it will take forever to stabilize later on.

Robert (Bobby) Evans and others added 6 commits January 28, 2016 13:00
Conflicts:
	storm-core/src/clj/org/apache/storm/command/dev_zookeeper.clj
	storm-core/src/clj/org/apache/storm/command/shell_submission.clj
	storm-core/src/clj/org/apache/storm/testing.clj
	storm-core/test/clj/org/apache/storm/nimbus_test.clj

STORM-1257: port backtype.storm.zookeeper to java
Upmerge and add ability to mock Zookeeper functions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to change the log message a little bit more descriptive.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@hustfxj
Copy link
Contributor Author

hustfxj commented Jan 29, 2016

@revans2 Thanks, I learned a lot about storm&clojure.

@revans2
Copy link
Contributor

revans2 commented Jan 29, 2016

The changes look good to me now and I am +1 on merging them in.

But because I helped contribute some of the code I want at least one other committer to also give a +1.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a newline

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@knusbaum
Copy link
Contributor

Very minor nit.

Otherwise, +1

@revans2
Copy link
Contributor

revans2 commented Jan 30, 2016

A line of white space is simple enough for me to do as I check it in.

@asfgit asfgit merged commit 9442b4a into apache:master Jan 30, 2016
@hustfxj hustfxj deleted the zookeeper branch March 6, 2016 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants