[
https://issues.apache.org/jira/browse/APEXMALHAR-2172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15414731#comment-15414731
]
ASF GitHub Bot commented on APEXMALHAR-2172:
--------------------------------------------
Github user bhupeshchawda commented on a diff in the pull request:
https://github.com/apache/apex-malhar/pull/358#discussion_r74187569
--- Diff:
library/src/main/java/com/datatorrent/lib/db/jdbc/AbstractJdbcPollInputOperator.java
---
@@ -638,24 +504,191 @@ public void partitioned(
public void run()
{
while (execute) {
- try {
- long startTs = System.currentTimeMillis();
- if ((isPollable && !isPolled) || !isPollable) {
- pollRecords(ps);
- }
- long endTs = System.currentTimeMillis();
- long ioTime = endTs - startTs;
- long sleepTime = pollInterval - ioTime;
- LOG.debug("pollInterval = {} , I/O time = {} , sleepTime = {}",
pollInterval, ioTime, sleepTime);
- Thread.sleep(sleepTime > 0 ? sleepTime : 0);
- } catch (Exception ex) {
- cause.set(ex);
- execute = false;
+ if ((isPollerPartition && !isPolled) || !isPollerPartition) {
+ pollRecords();
}
}
}
}
- private static final org.slf4j.Logger LOG =
LoggerFactory.getLogger(AbstractJdbcPollInputOperator.class);
+ @VisibleForTesting
+ protected void setScheduledExecutorService(ScheduledExecutorService
service)
+ {
+ scanService = service;
+ }
+
+ /**
+ * Gets {@link WindowDataManager}
+ *
+ * @return
+ */
+ public WindowDataManager getWindowManager()
+ {
+ return windowManager;
+ }
+
+ /**
+ * Sets {@link WindowDataManager}
+ *
+ * @return
--- End diff --
```@param``` needed instead of ```@return```
> Update JDBC poll input operator to fix issues
> ---------------------------------------------
>
> Key: APEXMALHAR-2172
> URL: https://issues.apache.org/jira/browse/APEXMALHAR-2172
> Project: Apache Apex Malhar
> Issue Type: Improvement
> Reporter: Priyanka Gugale
> Assignee: Priyanka Gugale
>
> Update JDBCPollInputOperator to:
> 1. Fix small bugs
> 2. Use jooq query dsl library to construct sql queries
> 3. Make code more readable
> 4. Use row counts rather than key column values to partition reads
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)