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
NIFI-4118 First commit of RethinkDB put processor #1942
Conversation
The integration tests failed because RethinkDB was not available. I've disabled the integration tests. |
Hey Folks: Can you please give me your feedback on this RethinkDB Put processor ? Thanks Mans |
Reviewing |
static final Relationship REL_SUCCESS = new Relationship.Builder().name("success") | ||
.description("Sucessful FlowFiles are routed to this relationship").build(); | ||
|
||
static final Relationship REL_FAILURE = new Relationship.Builder().name("success") |
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 this be named failure
?
@mans2singh, thanks for contributing this! I have a few general comments from a first pass:
And I have a question about connection management. I don't have any experience with RethinkDB. A brief search for documentation suggests that the Java connection might be thread safe (RethinkDB Issue #1041). Is that your understanding? |
…ed classes to match RethinkDB conventions, and updated notice files
Hi @jvwing - Thanks for your comments and feedback. I've updated the code (added RethinkDB site link to the description, renamed classes to match RethinkDB conventions, updated notice files and corrected the relation) based on your review. Regarding thread safety of the driver - as you pointed out, it is thread safe. Here is thread safety issue closed (rethinkdb/rethinkdb#5166) and the closed pull request (rethinkdb/rethinkdb#5292). Please let me know if you have any additional observations/recommendations. Thanks again for your thorough review. Mans |
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.
Thanks for the update, @mans2singh. Everything is looking pretty good, I just found the one test issue and the question about strings.
} catch (Exception exception) { | ||
getLogger().error("Failed to insert into RethinkDB due to {}", | ||
new Object[]{exception.getLocalizedMessage()}, exception); | ||
flowFile = session.putAttribute(flowFile, RETHINKDB_ERROR_MESSAGE, exception.getMessage() + ""); |
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 notice you use the + ""
method to cast objects to strings in several places. Any special reason? It does not appear too much in the NiFi codebase, as opposed to String.valueOf()
.
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.
Thanks for the suggestion - I've updated the code to use String.valueOf method.
runner.run(1,true,true); | ||
|
||
flowFiles = runner.getFlowFilesForRelationship(PutRethinkDB.REL_FAILURE); | ||
assertEquals(flowFiles.get(1).getAttribute(PutRethinkDB.RETHINKDB_INSERT_RESULT_DELETED_KEY), "0"); |
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 integration test failed for me. I believe the failing flowfile is now at index 0, since REL_FAILURE is separate.
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 are right - it was an oversight on my part. I've corrected the test.
@jvwing - I've updated the code based on your comments. Please let me know if there is anything else required. Thanks again. Mans |
nifi-assembly/NOTICE
Outdated
|
||
Copyright 2010-2012 RethinkDB | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); |
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.
Lines 1035-1045 should be removed. See other ASLv2 dependencies as examples.
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.
Removed the extra lines.
RethinkDB Language Drivers | ||
|
||
Copyright 2010-2012 RethinkDB | ||
|
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.
lines 18-29 can be removed. Also need to add 'commons-io' in here. Can copy it from the top level NOTICE that has it.
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.
Removed extra lines and added commons-io as recommended.
Thanks @mans2singh! This has been merged in. |
Thanks @jvwing |
Thank you for submitting a contribution to Apache NiFi.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
[x ] Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
[x ] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
[x ] Has your PR been rebased against the latest commit within the target branch (typically master)?
[x ] Is your initial contribution a single, squashed commit?
For code changes:
For documentation related changes:
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.