Skip to content

Conversation

@knusbaum
Copy link
Contributor

@knusbaum knusbaum commented Feb 3, 2016

This PR converts nearly the entirety of util.clj into Java.

What's left in util.clj will never be translated, but will disappear when the clojure code using it is rewritten in java. For now it's cleaner to leave these few functions and macros in place instead of trying to inline them everywhere.

The only operation that should need to be performed on util.clj after this PR is merged is git rm

@knusbaum knusbaum mentioned this pull request Feb 3, 2016
@knusbaum knusbaum changed the title STORM-1226: Port backtype.storm.util to java ☠STORM-1226☠: Port backtype.storm.util to java Feb 3, 2016
@knusbaum knusbaum changed the title ☠STORM-1226☠: Port backtype.storm.util to java ☠ STORM-1226☠ : Port backtype.storm.util to java Feb 3, 2016
@knusbaum knusbaum changed the title ☠ STORM-1226☠ : Port backtype.storm.util to java ☠STORM-1226☠ : Port backtype.storm.util to java (not ready for merge yet) Feb 3, 2016
@d2r
Copy link

d2r commented Feb 8, 2016

Test failures appear to be unrelated.

I am +1, however I also worked on much of this.

It would also be good to squash this before it is merged.

@knusbaum
Copy link
Contributor Author

knusbaum commented Feb 8, 2016

Squashed the commits.
Contributors were @rfarivar, @d2r, and myself.

Test failures are unrelated as far as I can tell. There appear to be test problems affecting all PRs.

@knusbaum knusbaum changed the title ☠STORM-1226☠ : Port backtype.storm.util to java (not ready for merge yet) STORM-1226: Port backtype.storm.util to java Feb 8, 2016
even though maven does not officially support ordering of the classpath.-->
<dependency>
<groupId>uk.org.lidalia</groupId>
<artifactId>sysout-over-slf4j</artifactId>
Copy link
Contributor

Choose a reason for hiding this comment

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

The new dependency seems OK, and it is unlikely that we will encounter some topology already using this, but could we please shade it anyways?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

List<String> streams = new ArrayList<>(common.get_streams().keySet());
streamNametoId.put(name, idify(streams));
streamIdToName.put(name, Utils.reverseMap(streamNametoId.get(name)));
//TODO: Can the call to simpleReverseMap be replaced wih Utils.reverseMap ?
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't know either delete this message or replace the call.

return Time.currentTimeSecs() - timeInSeconds;
}

public static long deltaMs(long timeInMilliseconds) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Most other places in this file uses Millis not Ms, or milliseconds is considered the default. Could we follow and rename this deltaMillis, or rename all of the others to use Ms instead of Millis?

@knusbaum
Copy link
Contributor Author

knusbaum commented Feb 9, 2016

@abhishekagarwal87 @revans2
I believe I've addressed all of the concerns.

(uncaughtException [this _ error]
((:report-error <>) error)
(when (Utils/exceptionCauseIsInstanceOf ClassCastException error)
(log-message "CLASS CAST EXCEPTION WOOOOOOOOOOOOOOOO!"))
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 probably leftover from debugging.

new ThriftAccessLogger().log(
String.format("Request ID: {} access from: {} principal: {} operation: {}",
requestId, remoteAddress, principal, operation));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought it would be something like

LOG.info("Request ID: {} access from: {} principal: {} operation: {}",
                 requestId, remoteAddress, principal, operation);

and ThriftAccessLogger.log would just go away

@revans2
Copy link
Contributor

revans2 commented Feb 10, 2016

One minor nit with the logging and then I am +1

execCommand("kill", "-" + signum, pid);
}
} catch (ExecuteException e) {
LOG.info("Error when trying to kill " + pid + ". Process is probably already dead.");
Copy link

Choose a reason for hiding this comment

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

Minor, but we could use {} format strings like elsewhere.

@d2r
Copy link

d2r commented Feb 10, 2016

OK, looked again and noticed some things that might be good to address now.

@d2r
Copy link

d2r commented Feb 10, 2016

OK looks good I am +1 again. I would like other +1s since I contributed some of this.

@asfgit asfgit merged commit 88bc6af into apache:master Feb 11, 2016
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.

5 participants