Review Board 1.7.22


FLUME-1930. Inflights should clean up executors on close.

Review Request #9659 - Created Feb. 27, 2013 and updated

Hari Shreedharan
FLUME-1930
Reviewers
Flume
flume-git
Kill the executors in in flights in queue.close method.

 
flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/FileChannel.java
Revision d98209b New Change
[20] 24 lines
[+20]
25
import java.util.concurrent.LinkedBlockingDeque;
25
import java.util.concurrent.LinkedBlockingDeque;
26
import java.util.concurrent.Semaphore;
26
import java.util.concurrent.Semaphore;
27
import java.util.concurrent.TimeUnit;
27
import java.util.concurrent.TimeUnit;
28

    
   
28

   
29
import com.google.common.annotations.VisibleForTesting;
29
import com.google.common.annotations.VisibleForTesting;

    
   
30
import com.google.common.base.Throwables;
30
import org.apache.flume.Channel;
31
import org.apache.flume.Channel;
31
import org.apache.flume.ChannelException;
32
import org.apache.flume.ChannelException;
32
import org.apache.flume.Context;
33
import org.apache.flume.Context;
33
import org.apache.flume.Event;
34
import org.apache.flume.Event;
34
import org.apache.flume.annotations.InterfaceAudience;
35
import org.apache.flume.annotations.InterfaceAudience;
[+20] [20] 343 lines
[+20] [+] protected BasicTransactionSemantics createTransaction() {
378
    return queue.getSize();
379
    return queue.getSize();
379
  }
380
  }
380
  void close() {
381
  void close() {
381
    if(open) {
382
    if(open) {
382
      open = false;
383
      open = false;

    
   
384
      try {
383
      log.close();
385
        log.close();

    
   
386
      } catch (InterruptedException e) {

    
   
387
        LOG.error("Interrupted while waiting for log to close.", e);

    
   
388
        Thread.currentThread().interrupt();

    
   
389
        Throwables.propagate(e);

    
   
390
      }
384
      log = null;
391
      log = null;
385
      queueRemaining = null;
392
      queueRemaining = null;
386
    }
393
    }
387
  }
394
  }
388

    
   
395

   
[+20] [20] 224 lines
flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/FlumeEventQueue.java
Revision 0f9456b New Change
 
flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/Log.java
Revision 7da8c49 New Change
 
flume-ng-channels/flume-file-channel/src/test/java/org/apache/flume/channel/file/TestLog.java
Revision 6751714 New Change
 
  1. flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/FileChannel.java: Loading...
  2. flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/FlumeEventQueue.java: Loading...
  3. flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/Log.java: Loading...
  4. flume-ng-channels/flume-file-channel/src/test/java/org/apache/flume/channel/file/TestLog.java: Loading...