Package org.apache.flume.source

Examples of org.apache.flume.source.SequenceGeneratorSource


  public void testLifecycle() throws LifecycleException, InterruptedException {

    Channel channel = new MemoryChannel();
    Configurables.configure(channel, new Context());

    Source generatorSource = new SequenceGeneratorSource();
    List<Channel> channels = new ArrayList<Channel>();
    channels.add(channel);

    ChannelSelector rcs = new ReplicatingChannelSelector();
    rcs.setChannels(channels);

    generatorSource.setChannelProcessor(new ChannelProcessor(rcs));

    NullSink nullSink = new NullSink();
    nullSink.configure(new Context());
    nullSink.setChannel(channel);
View Full Code Here


  InterruptedException {

    Channel channel = new MemoryChannel();
    Configurables.configure(channel, new Context());

    Source source = new SequenceGeneratorSource();
    List<Channel> channels = new ArrayList<Channel>();
    channels.add(channel);
    ChannelSelector rcs = new ReplicatingChannelSelector();
    rcs.setChannels(channels);

    source.setChannelProcessor(new ChannelProcessor(rcs));

    NullSink sink = new NullSink();
    sink.configure(new Context());
    sink.setChannel(channel);
View Full Code Here

    context.put(FileChannelConfiguration.MAX_FILE_SIZE,
        String.valueOf(1024 * 1024 * 5));
    // do reconfiguration
    Configurables.configure(channel, context);

    SequenceGeneratorSource source = new SequenceGeneratorSource();
    CountingSourceRunner sourceRunner = new CountingSourceRunner(source, channel);

    NullSink sink = new NullSink();
    sink.setChannel(channel);
    CountingSinkRunner sinkRunner = new CountingSinkRunner(sink);
View Full Code Here

    Assert.assertTrue("Node manager didn't reach START or ERROR",
        LifecycleController.waitForOneOf(nodeManager,
            LifecycleState.START_OR_ERROR, 5000));

    for (int i = 0; i < 3; i++) {
      SequenceGeneratorSource source = new SequenceGeneratorSource();
      List<Channel> channels = new ArrayList<Channel>();
      channels.add(new MemoryChannel());
      ChannelSelector rcs = new ReplicatingChannelSelector();
      rcs.setChannels(channels);

      source.setChannelProcessor(new ChannelProcessor(rcs));

      PollableSourceRunner sourceRunner = new PollableSourceRunner();
      sourceRunner.setSource(source);

      nodeManager.add(sourceRunner);
View Full Code Here

      InterruptedException {

    Set<LifecycleAware> testNodes = new HashSet<LifecycleAware>();

    for (int i = 0; i < 30; i++) {
      SequenceGeneratorSource source = new SequenceGeneratorSource();
      List<Channel> channels = new ArrayList<Channel>();
      channels.add(new MemoryChannel());
      ChannelSelector rcs = new ReplicatingChannelSelector();
      rcs.setChannels(channels);

      source.setChannelProcessor(new ChannelProcessor(rcs));

      PollableSourceRunner sourceRunner = new PollableSourceRunner();
      sourceRunner.setSource(source);

      testNodes.add(sourceRunner);
View Full Code Here

  public void testErrorNode() throws LifecycleException, InterruptedException {

    Set<LifecycleAware> testNodes = new HashSet<LifecycleAware>();

    for (int i = 0; i < 30; i++) {
      SequenceGeneratorSource source = new SequenceGeneratorSource();
      List<Channel> channels = new ArrayList<Channel>();
      channels.add(new MemoryChannel());
      ChannelSelector rcs = new ReplicatingChannelSelector();
      rcs.setChannels(channels);

      source.setChannelProcessor(new ChannelProcessor(rcs));

      PollableSourceRunner sourceRunner = new PollableSourceRunner();
      sourceRunner.setSource(source);

      testNodes.add(sourceRunner);
View Full Code Here

  public void testLifecycle() throws LifecycleException, InterruptedException {

    Channel channel = new MemoryChannel();
    Configurables.configure(channel, new Context());

    Source generatorSource = new SequenceGeneratorSource();
    List<Channel> channels = new ArrayList<Channel>();
    channels.add(channel);

    ChannelSelector rcs = new ReplicatingChannelSelector();
    rcs.setChannels(channels);

    generatorSource.setChannelProcessor(new ChannelProcessor(rcs));

    Sink nullSink = new NullSink();
    nullSink.setChannel(channel);

    nodeManager.add(SourceRunner.forSource(generatorSource));
View Full Code Here

  InterruptedException {

    Channel channel = new MemoryChannel();
    Configurables.configure(channel, new Context());

    Source source = new SequenceGeneratorSource();
    List<Channel> channels = new ArrayList<Channel>();
    channels.add(channel);
    ChannelSelector rcs = new ReplicatingChannelSelector();
    rcs.setChannels(channels);

    source.setChannelProcessor(new ChannelProcessor(rcs));

    Sink sink = new NullSink();
    sink.setChannel(channel);

    nodeManager.add(SourceRunner.forSource(source));
View Full Code Here

        LifecycleState.START_OR_ERROR, 5000);

    Assert.assertTrue("Matched a known state", reached);
    Assert.assertEquals(LifecycleState.START, node.getLifecycleState());

    SourceRunner n1 = SourceRunner.forSource(new SequenceGeneratorSource());

    node.getNodeManager().add(n1);

    node.stop();
    reached = LifecycleController.waitForOneOf(node,
View Full Code Here

    channel.setName("FileChannel-" + UUID.randomUUID());
    Configurables.configure(channel, context);
    channel.start();
    Assert.assertTrue(channel.isOpen());

    SequenceGeneratorSource source = new SequenceGeneratorSource();
    CountingSourceRunner sourceRunner = new CountingSourceRunner(source, channel);

    NullSink sink = new NullSink();
    sink.setChannel(channel);
    CountingSinkRunner sinkRunner = new CountingSinkRunner(sink);
View Full Code Here

TOP

Related Classes of org.apache.flume.source.SequenceGeneratorSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.