You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apex.apache.org by bhupeshchawda <gi...@git.apache.org> on 2016/08/01 10:49:34 UTC

[GitHub] apex-malhar pull request #358: [review only]APEXMALHAR-2172: Updates to JDBC...

Github user bhupeshchawda commented on a diff in the pull request:

    https://github.com/apache/apex-malhar/pull/358#discussion_r72958642
  
    --- Diff: library/src/main/java/com/datatorrent/lib/db/jdbc/AbstractJdbcPollInputOperator.java ---
    @@ -80,201 +93,48 @@
      * @tags database, sql, jdbc, partitionable,exactlyOnce
      */
     @Evolving
    -public abstract class AbstractJdbcPollInputOperator<T> extends AbstractStoreInputOperator<T, JdbcStore>
    -    implements ActivationListener<Context>, IdleTimeHandler, Partitioner<AbstractJdbcPollInputOperator<T>>
    +public abstract class AbstractJdbcPollInputOperator<T> extends AbstractStoreInputOperator<T, JdbcStore> implements
    +    ActivationListener<OperatorContext>, IdleTimeHandler, Partitioner<AbstractJdbcPollInputOperator<T>>
     {
    +  private static int DEFAULT_QUEUE_CAPACITY = 4 * 1024 * 1024;
    +  private static int DEFAULT_POLL_INTERVAL = 10 * 1000;
    +  private static int DEFAULT_FETCH_SIZE = 20000;
       /**
        * poll interval in milliseconds
        */
    -  private static int pollInterval = 10000;
    +  private int pollInterval = DEFAULT_POLL_INTERVAL;
    +  private int queueCapacity = DEFAULT_QUEUE_CAPACITY;
    +  private int fetchSize = DEFAULT_FETCH_SIZE;
     
       @Min(1)
       private int partitionCount = 1;
       protected transient int operatorId;
    -  protected transient boolean isReplayed;
    -  protected transient boolean isPollable;
    +  protected boolean isPollerPartition;
       protected int batchSize;
    -  protected static int fetchSize = 20000;
    +
       /**
        * Map of windowId to <lower bound,upper bound> of the range key
        */
    -  protected transient MutablePair<String, String> currentWindowRecoveryState;
    +  protected transient MutablePair<Integer, Integer> currentWindowRecoveryState;
    +  private transient DSLContext create;
     
    -  /**
    -   * size of the emit queue used to hold polled records before emit
    -   */
    -  private static int queueCapacity = 4 * 1024 * 1024;
       private transient volatile boolean execute;
       private transient AtomicReference<Throwable> cause;
    +  private String tableName;
    +  private String columnsExpression;
    +  private String whereCondition = null;
    +  private String key;
       protected transient int spinMillis;
    -  private transient OperatorContext context;
    -  protected String tableName;
    -  protected String key;
       protected long currentWindowId;
    -  protected KeyValPair<String, String> rangeQueryPair;
    -  protected String lower;
    -  protected String upper;
    -  protected boolean recovered;
    -  protected boolean isPolled;
    -  protected String whereCondition = null;
    -  protected String previousUpperBound;
    -  protected String highestPolled;
    -  private static final String user = "";
    -  private static final String password = "";
    -  /**
    -   * thread to poll database
    -   */
    -  private transient Thread dbPoller;
    -  protected transient ArrayBlockingQueue<List<T>> emitQueue;
    +  protected KeyValPair<Integer, Integer> rangeQueryPair;
    +  protected Integer lower;
    +  protected transient boolean isPolled;
    +  protected transient Integer lastPolledBound;
    +  protected transient Integer lastEmittedRecord;
    --- End diff --
    
    Can lower, lastPolledBound and lastEmittedRecord be int instead of Integer?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---