コード例 #1
0
  @Override
  public synchronized void stop() {
    executor.shutdown();
    try {
      executor.awaitTermination(10L, TimeUnit.SECONDS);
    } catch (InterruptedException ex) {
      logger.info("Interrupted while awaiting termination", ex);
    }
    executor.shutdownNow();

    super.stop();
    sourceCounter.stop();
    logger.info("SpoolDir source {} stopped. Metrics: {}", getName(), sourceCounter);
  }
コード例 #2
0
ファイル: ThriftSource.java プロジェクト: LXiong/UserAnalysis
 public void stop() {
   if (server != null && server.isServing()) {
     server.stop();
   }
   servingExecutor.shutdown();
   try {
     if (!servingExecutor.awaitTermination(5, TimeUnit.SECONDS)) {
       servingExecutor.shutdownNow();
     }
   } catch (InterruptedException e) {
     throw new FlumeException("Interrupted while waiting for server to be " + "shutdown.");
   }
   sourceCounter.stop();
   // Thrift will shutdown the executor passed to it.
   super.stop();
 }
コード例 #3
0
 /** Stops the Source's event processing and shuts down the Twitter stream. */
 @Override
 public void stop() {
   logger.debug("Shutting down Twitter sample stream...");
   twitterStream.shutdown();
   super.stop();
 }
コード例 #4
0
 /** What happens when the stream is shutdown */
 @Override
 public void stop() {
   System.out.println("Shutting down");
   twitterStream.shutdown();
   super.stop();
 }
コード例 #5
0
 @Override
 public synchronized void stop() {
   RabbitMQUtil.close(_Connection, _Channel);
   super.stop();
 }