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

    https://github.com/apache/flink/pull/2330#discussion_r79469573
  
    --- Diff: 
flink-batch-connectors/flink-hbase/src/main/java/org/apache/flink/addons/hbase/TableInputFormat.java
 ---
    @@ -131,37 +153,27 @@ public T nextRecord(T reuse) throws IOException {
        }
     
        @Override
    -   public void open(TableInputSplit split) throws IOException {
    -           if (split == null){
    -                   throw new IOException("Input split is null!");
    -           }
    -           if (table == null){
    -                   throw new IOException("No HTable provided!");
    -           }
    -           if (scan == null){
    -                   throw new IOException("No Scan instance provided");
    +   public void close() throws IOException {
    +           LOG.info("Closing split (scanned {} rows)", scannedRows);
    +           this.lastRow = null;
    +           try {
    +                   if(resultScanner !=null) {
    +                           this.resultScanner.close();
    +                   }
    +           } finally {
    +                   this.resultScanner = null;
                }
    -
    -           logSplitInfo("opening", split);
    -           scan.setStartRow(split.getStartRow());
    -           lastRow = split.getEndRow();
    -           scan.setStopRow(lastRow);
    -
    -           this.rs = table.getScanner(scan);
    -           this.endReached = false;
    -           this.scannedRows = 0;
        }
     
        @Override
    -   public void close() throws IOException {
    -           if(rs!=null){
    -                   this.rs.close();
    -           }
    -           if(table!=null){
    -                   this.table.close();
    +   public void closeInputFormat() throws IOException {
    +           try {
    +                   if(table!=null) {
    --- End diff --
    
    insert spaces


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to