-
Notifications
You must be signed in to change notification settings - Fork 152
APEXMALHAR-2172: Updates to JDBC Poll Input Operator #358
APEXMALHAR-2172: Updates to JDBC Poll Input Operator #358
Conversation
@bhupeshchawda and @devtagare please review |
import org.slf4j.LoggerFactory; | ||
|
||
import org.apache.apex.malhar.lib.wal.FSWindowDataManager; | ||
import org.apache.apex.malhar.lib.wal.WindowDataManager; | ||
import org.apache.commons.lang3.tuple.MutablePair; | ||
import org.apache.hadoop.classification.InterfaceStability.Evolving; | ||
|
||
/** |
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.
Multiple file headers and import statements mixed.
How does 2. work? The query needs to be repeatable, so you will still need to sort on the primary key? |
The jooq license isn't one of those listed here: http://www.apache.org/legal/resolved.html#category-a Where is the analysis on license compatibility? |
Building the range query is currently based on limit and offset.
|
Reading further, I guess right thing to do will be use "order by" and also avoid using "offset". Here are some good reads about it: I will check if I can modify our query to be more efficient, also would clarify assumptions about "key" column if any. |
8e962ad
to
e7b87c2
Compare
Thomas, using "order by" key column in queries to ensure right results. Would evaluate options to optimize performance by avoiding use of "offset" |
protected Integer lower; | ||
protected transient boolean isPolled; | ||
protected transient Integer lastPolledBound; | ||
protected transient Integer lastEmittedRecord; |
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 lower, lastPolledBound and lastEmittedRecord be int instead of Integer?
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 am doing a null check and those variables are compared and assigned to each other so won't do that.
What if the user wants to use RDBMS specific SQL? |
Thomas, |
00e7020
to
8113c44
Compare
private transient ScheduledExecutorService scanService; | ||
protected transient boolean isPolled; | ||
protected transient Integer lastPolledBound; | ||
protected transient Integer lastEmittedRecord; |
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 you make lowerBound
, lastPolledBound
and lastEmittedRecord
as int
instead of Integer
|
||
/** | ||
* A concrete implementation for {@link AbstractJdbcPollInputOperator}} for | ||
* A concrete implementation for {@link AbstractJdbcPollInputOperator} for | ||
* consuming data from MySQL using JDBC interface <br> |
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 we remove explicit mention for MySQL? I think it is generic as of now..
@DT-Priyanka I have a few outstanding comments. Please address them. |
5526efa
to
fae2c8b
Compare
do { | ||
boolean submitted = false; | ||
while (!submitted) { | ||
submitted = emitQueue.offer(getTuple(result)); |
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.
while(!emitQueue.offer(getTuple(result))) { Thread.sleep(10); }
?
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.
Also 1000 sounds too much?
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 I change it to 500, as it's our default window size?
Sorry had missed couple of comments before, addressing remaining comments. |
f5a231a
to
2ebcdd8
Compare
Looks good to me. If there are no other comments, will merge by tomorrow. |
2ebcdd8
to
26fa9d7
Compare
File Splitter test is failing reopening to re-run tests. |
Changes include: