Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

APEXMALHAR-2066 JdbcPolling,idempotent,partitionable #282

Merged
merged 1 commit into from Jul 15, 2016

Conversation

devtagare
Copy link
Contributor

@devtagare devtagare commented May 18, 2016

JdbcPolling,idempotent,partitionable #282

@devtagare devtagare closed this May 18, 2016
@devtagare
Copy link
Contributor Author

JdbcPolling,idempotent,partitionable

@devtagare devtagare reopened this May 18, 2016
protected transient boolean isReplayed;
protected transient boolean isPollable;
protected int batchSize;
protected int fetchSize;
Copy link
Contributor

Choose a reason for hiding this comment

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

add javadocs for properties

@devtagare devtagare force-pushed the APEXMALHAR-2066-JdbcPolling branch from 1538b57 to 8ad2fae Compare May 26, 2016 20:28

} catch (SQLException e) {
LOG.error("Exception in initializing the range query for a given partition", e);
throw new RuntimeException();
Copy link
Contributor

Choose a reason for hiding this comment

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

throw new RuntimeException(e);

No need to log error

Copy link
Contributor

Choose a reason for hiding this comment

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

Should also wrap original exception, use Throwables.propagate

@sandeepdeshmukh
Copy link
Contributor

What are the challenges in extending AbstractJdbcInputOperator to support new features ? As AbstractJdbcInputOperator is Evolving, there is no backward compatibility issue.

@pramodin
Copy link
Contributor

pramodin commented Jun 1, 2016

@sandeepdeshmukh I will let @devtagare comment but I believe this operator makes assumptions on how data is organized in the database and expects the implementations to provide that information whereas the original operator makes no such assumptions.

@gauravgopi123
Copy link
Contributor

Any updates?

@devtagare
Copy link
Contributor Author

I have updated the JIRA with assumptions for the operator - https://issues.apache.org/jira/browse/APEXMALHAR-2066.

Waiting for comments from more folks before making final changes.

protected String upper;
protected boolean recovered;
protected boolean isPolled;
protected String whereCondition = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also clarify which subset of SQL will be supported here? How complex can the where clause be?

@gauravgopi123
Copy link
Contributor

@devtagare : I wen through the Jira but it still doesn't mention how is this different from existing version and why can't existing version be enhanced?

* Dont flush if its pollable*/
if (!hasNext) {
if ((isPollable && isPolled) || !isPollable) {
emitQueue.add(metaList);
Copy link
Contributor

Choose a reason for hiding this comment

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

This might throw an exception if the queue is full. Use offer() instead?

ResultSet rs = preparedStatement.executeQuery();

while (rs.next()) {
rowCount = Long.parseLong(rs.getString("RowCount"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest to use index instead of a column alias. Also seems like this is a simple count utility. Can you rename it to something like "getTupleCount()" ?

@bhupeshchawda
Copy link
Contributor

@devtagare Apart from the existing comments I am fine with the changes.

The only major concern I have is related to the way polling is done might be dependent on a lot of things like the target database implementation and the organization of data in the database.
Request you to please mention the design of the operator (the core part on how you are planning to achieve polling functionality) on dev@apex. I guess, this will be done sooner or later as part of documentation :-)
Apologies for the delay.

@devtagare devtagare force-pushed the APEXMALHAR-2066-JdbcPolling branch 2 times, most recently from 4ed207d to 6687bad Compare July 11, 2016 23:44
@devtagare
Copy link
Contributor Author

@bhupeshchawda - review comments are incorporated.Could you please check.

pollableInstance.beginWindow(1);
Thread.sleep(700);
pollableInstance.endWindow();
pollableInstance.emitTuples();
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 emitting outside the window. Needs to be between begin and end window.

@bhupeshchawda
Copy link
Contributor

@devtagare I can still see a lot of open comments. Can you please address them?
Also, as I suggested, please provide the description of the design on the dev mailing list. I think this will serve the larger purpose of letting the community know about this operator and its use, in contrast to the existing Jdbc operator in Malhar.

@devtagare devtagare force-pushed the APEXMALHAR-2066-JdbcPolling branch from 6687bad to 6d8f237 Compare July 12, 2016 18:19
@devtagare
Copy link
Contributor Author

@bhupeshchawda - fixed the latest comments and pushed the changes.Mail sent to dev@.

long endTs = System.currentTimeMillis();
long ioTime = endTs - startTs;
long sleepTime = pollInterval - ioTime;
LOG.debug("pollInterval = " + pollInterval + " I/O time = " + ioTime + " sleepTime = " + sleepTime);
Copy link
Contributor

Choose a reason for hiding this comment

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

use {} syntax for log message, the string gets evaluated even if log level is not enabled.

@tweise
Copy link
Contributor

tweise commented Jul 13, 2016

Why would this not be part of the javadoc?

sent from mobile
On Jul 11, 2016 2:31 PM, "Bhupesh" notifications@github.com wrote:

@devtagare https://github.com/devtagare Apart from the existing
comments I am fine with the changes.

The only major concern I have is related to the way polling is done might
be dependent on a lot of things like the target database implementation and
the organization of data in the database.
Request you to please mention the design of the operator (the core part on
how you are planning to achieve polling functionality) on dev@apex. I
guess, this will be done sooner or later as part of documentation :-)
Apologies for the delay.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#282 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAQGD57_10pm8NcpMusPBEAJTfA1IkU_ks5qUjexgaJpZM4Ihwkj
.

@bhupeshchawda
Copy link
Contributor

Yes, this should be part of javadoc as well.

@devtagare devtagare force-pushed the APEXMALHAR-2066-JdbcPolling branch from 6d8f237 to 4c7d268 Compare July 14, 2016 18:43
@asfgit asfgit merged commit 4c7d268 into apache:master Jul 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
8 participants