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

The following examples show how to use org.apache.flume.lifecycle.LifecycleState#START . 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 start() {
    LOGGER.info("Configuration provider starting");

    Preconditions.checkState(file != null,
            "The parameter file must not be null");

    executorService = Executors.newSingleThreadScheduledExecutor(
            new ThreadFactoryBuilder().setNameFormat("conf-file-poller-%d")
                    .build());

    FileWatcherRunnable fileWatcherRunnable =
            new FileWatcherRunnable(file, counterGroup);

    executorService.scheduleWithFixedDelay(fileWatcherRunnable, 0, interval,
            TimeUnit.SECONDS);

    lifecycleState = LifecycleState.START;

    LOGGER.debug("Configuration provider started");
}
 
Example 2
Source File: PollableSourceRunner.java    From mt-flume with Apache License 2.0 6 votes vote down vote up
@Override
public void start() {
  PollableSource source = (PollableSource) getSource();
  ChannelProcessor cp = source.getChannelProcessor();
  cp.initialize();
  source.start();

  runner = new PollingRunner();

  runner.source = source;
  runner.counterGroup = counterGroup;
  runner.shouldStop = shouldStop;

  runnerThread = new Thread(runner);
  runnerThread.setName(getClass().getSimpleName() + "-" + 
      source.getClass().getSimpleName() + "-" + source.getName());
  runnerThread.start();

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

  policy.start();

  runner = new PollingRunner();

  runner.policy = policy;
  runner.counterGroup = counterGroup;
  runner.shouldStop = new AtomicBoolean();

  runnerThread = new Thread(runner);
  runnerThread.setName("SinkRunner-PollingRunner-" +
      policy.getClass().getSimpleName());
  runnerThread.start();

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

  Preconditions.checkState(file != null,
      "The parameter file must not be null");

  executorService = Executors.newSingleThreadScheduledExecutor(
          new ThreadFactoryBuilder().setNameFormat("conf-file-poller-%d")
              .build());

  FileWatcherRunnable fileWatcherRunnable =
      new FileWatcherRunnable(file, counterGroup);

  executorService.scheduleWithFixedDelay(fileWatcherRunnable, 0, interval,
      TimeUnit.SECONDS);

  lifecycleState = LifecycleState.START;

  LOGGER.debug("Configuration provider started");
}
 
Example 5
Source File: AbstractSinkProcessor.java    From mt-flume with Apache License 2.0 5 votes vote down vote up
@Override
public void start() {
  for(Sink s : sinkList) {
    s.start();
  }

  state = LifecycleState.START;
}
 
Example 6
Source File: AbstractSource.java    From mt-flume with Apache License 2.0 5 votes vote down vote up
@Override
public synchronized void start() {
  Preconditions.checkState(channelProcessor != null,
      "No channel processor configured");

  lifecycleState = LifecycleState.START;
}
 
Example 7
Source File: EventDrivenSourceRunner.java    From mt-flume with Apache License 2.0 5 votes vote down vote up
@Override
public void start() {
  Source source = getSource();
  ChannelProcessor cp = source.getChannelProcessor();
  cp.initialize();
  source.start();
  lifecycleState = LifecycleState.START;
}
 
Example 8
Source File: AbstractChannel.java    From mt-flume with Apache License 2.0 4 votes vote down vote up
@Override
public synchronized void start() {
  lifecycleState = LifecycleState.START;
}
 
Example 9
Source File: DefaultSinkProcessor.java    From mt-flume with Apache License 2.0 4 votes vote down vote up
@Override
public void start() {
  Preconditions.checkNotNull(sink, "DefaultSinkProcessor sink not set");
  sink.start();
  lifecycleState = LifecycleState.START;
}
 
Example 10
Source File: AbstractSink.java    From mt-flume with Apache License 2.0 4 votes vote down vote up
@Override
public synchronized void start() {
  Preconditions.checkState(channel != null, "No channel configured");

  lifecycleState = LifecycleState.START;
}
 
Example 11
Source File: AbstractSinkSelector.java    From mt-flume with Apache License 2.0 4 votes vote down vote up
@Override
public void start() {
  state = LifecycleState.START;
}
 
Example 12
Source File: BasicSourceSemantics.java    From mt-flume with Apache License 2.0 4 votes vote down vote up
protected boolean isStarted() {
  return getLifecycleState() == LifecycleState.START;
}
 
Example 13
Source File: TestFailoverSinkProcessor.java    From mt-flume with Apache License 2.0 4 votes vote down vote up
@Override
public void start() {
  state = LifecycleState.START;
}