Java Code Examples for org.apache.flume.lifecycle.LifecycleState#STOP

The following examples show how to use org.apache.flume.lifecycle.LifecycleState#STOP . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PollingPropertiesFileConfigurationProvider.java    From pulsar with Apache License 2.0 6 votes vote down vote up
@Override
public void stop() {
    LOGGER.info("Configuration provider stopping");

    executorService.shutdown();
    try {
        if (!executorService.awaitTermination(500, TimeUnit.MILLISECONDS)) {
            LOGGER.debug("File watcher has not terminated. Forcing shutdown of executor.");
            executorService.shutdownNow();
            while (!executorService.awaitTermination(500, TimeUnit.MILLISECONDS)) {
                LOGGER.debug("Waiting for file watcher to terminate");
            }
        }
    } catch (InterruptedException e) {
        LOGGER.debug("Interrupted while waiting for file watcher to terminate");
        Thread.currentThread().interrupt();
    }
    lifecycleState = LifecycleState.STOP;
    LOGGER.debug("Configuration provider stopped");
}
 
Example 2
Source File: PollableSourceRunner.java    From mt-flume with Apache License 2.0 6 votes vote down vote up
@Override
public void stop() {

  runner.shouldStop.set(true);

  try {
    runnerThread.interrupt();
    runnerThread.join();
  } catch (InterruptedException e) {
    logger
    .warn(
        "Interrupted while waiting for polling runner to stop. Please report this.",
        e);
    Thread.currentThread().interrupt();
  }

  Source source = getSource();
  source.stop();
  ChannelProcessor cp = source.getChannelProcessor();
  cp.close();

  lifecycleState = LifecycleState.STOP;
}
 
Example 3
Source File: SinkRunner.java    From mt-flume with Apache License 2.0 6 votes vote down vote up
@Override
public void stop() {

  if (runnerThread != null) {
    runner.shouldStop.set(true);
    runnerThread.interrupt();

    while (runnerThread.isAlive()) {
      try {
        logger.debug("Waiting for runner thread to exit");
        runnerThread.join(500);
      } catch (InterruptedException e) {
        logger
        .debug(
            "Interrupted while waiting for runner thread to exit. Exception follows.",
            e);
      }
    }
  }

  getPolicy().stop();
  lifecycleState = LifecycleState.STOP;
}
 
Example 4
Source File: PollingPropertiesFileConfigurationProvider.java    From mt-flume with Apache License 2.0 6 votes vote down vote up
@Override
public void stop() {
  LOGGER.info("Configuration provider stopping");

  executorService.shutdown();
  try{
    while(!executorService.awaitTermination(500, TimeUnit.MILLISECONDS)) {
      LOGGER.debug("Waiting for file watcher to terminate");
    }
  } catch (InterruptedException e) {
    LOGGER.debug("Interrupted while waiting for file watcher to terminate");
    Thread.currentThread().interrupt();
  }
  lifecycleState = LifecycleState.STOP;
  LOGGER.debug("Configuration provider stopped");
}
 
Example 5
Source File: NifiSessionFactoryChannel.java    From localization_nifi with Apache License 2.0 5 votes vote down vote up
@Override
protected BasicTransactionSemantics createTransaction() {
    LifecycleState lifecycleState = getLifecycleState();
    if (lifecycleState == LifecycleState.STOP) {
        throw new ChannelFullException("Can't write to a stopped channel");
    }
    return new NifiTransaction(sessionFactory.createSession(), relationship);
}
 
Example 6
Source File: AbstractSinkProcessor.java    From mt-flume with Apache License 2.0 5 votes vote down vote up
@Override
public void stop() {
  for(Sink s : sinkList) {
    //s.start();
    s.stop(); //modify by judasheng, FLUME-1718
  }
  state = LifecycleState.STOP;
}
 
Example 7
Source File: EventDrivenSourceRunner.java    From mt-flume with Apache License 2.0 5 votes vote down vote up
@Override
public void stop() {
  Source source = getSource();
  source.stop();
  ChannelProcessor cp = source.getChannelProcessor();
  cp.close();
  lifecycleState = LifecycleState.STOP;
}
 
Example 8
Source File: NifiSessionFactoryChannel.java    From nifi with Apache License 2.0 5 votes vote down vote up
@Override
protected BasicTransactionSemantics createTransaction() {
    LifecycleState lifecycleState = getLifecycleState();
    if (lifecycleState == LifecycleState.STOP) {
        throw new ChannelFullException("Can't write to a stopped channel");
    }
    return new NifiTransaction(sessionFactory.createSession(), relationship);
}
 
Example 9
Source File: AbstractChannel.java    From mt-flume with Apache License 2.0 4 votes vote down vote up
@Override
public synchronized void stop() {
  lifecycleState = LifecycleState.STOP;
}
 
Example 10
Source File: DefaultSinkProcessor.java    From mt-flume with Apache License 2.0 4 votes vote down vote up
@Override
public void stop() {
  Preconditions.checkNotNull(sink, "DefaultSinkProcessor sink not set");
  sink.stop();
  lifecycleState = LifecycleState.STOP;
}
 
Example 11
Source File: AbstractSink.java    From mt-flume with Apache License 2.0 4 votes vote down vote up
@Override
public synchronized void stop() {
  lifecycleState = LifecycleState.STOP;
}
 
Example 12
Source File: AbstractSinkSelector.java    From mt-flume with Apache License 2.0 4 votes vote down vote up
@Override
public void stop() {
  state = LifecycleState.STOP;
}
 
Example 13
Source File: AbstractSource.java    From mt-flume with Apache License 2.0 4 votes vote down vote up
@Override
public synchronized void stop() {
  lifecycleState = LifecycleState.STOP;
}
 
Example 14
Source File: TestFailoverSinkProcessor.java    From mt-flume with Apache License 2.0 4 votes vote down vote up
@Override
public void stop() {
  state = LifecycleState.STOP;
}