Package org.apache.flume.PollableSource

Examples of org.apache.flume.PollableSource.Status


    kafkaServer.produce(topicName, "", "hello, world");
    kafkaServer.produce(topicName, "", "foo, bar");

    Thread.sleep(500L);

    Status status = kafkaSource.process();
    assertEquals(Status.READY, status);
    Assert.assertEquals("hello, world", new String(events.get(0).getBody(),
            Charsets.UTF_8));
    Assert.assertEquals("foo, bar", new String(events.get(1).getBody(),
            Charsets.UTF_8));
View Full Code Here


          IllegalAccessException, InterruptedException {
    kafkaSource.configure(context);
    kafkaSource.start();
    Thread.sleep(500L);

    Status status = kafkaSource.process();
    assertEquals(Status.BACKOFF, status);
  }
View Full Code Here

    context.put(KafkaSourceConstants.TOPIC,"faketopic");
    kafkaSource.configure(context);
    kafkaSource.start();
    Thread.sleep(500L);

    Status status = kafkaSource.process();
    assertEquals(Status.BACKOFF, status);
  }
View Full Code Here

    context.put(KafkaSourceConstants.ZOOKEEPER_CONNECT_FLUME,"blabla:666");
    kafkaSource.configure(context);
    kafkaSource.start();
    Thread.sleep(500L);

    Status status = kafkaSource.process();
    assertEquals(Status.BACKOFF, status);
  }
View Full Code Here

      kafkaServer.produce(topicName, "", "hello, world " + i);
    }
    Thread.sleep(500L);

    long startTime = System.currentTimeMillis();
    Status status = kafkaSource.process();
    long endTime = System.currentTimeMillis();
    assertEquals(Status.READY, status);
    assertTrue(endTime - startTime <
            ( context.getLong(KafkaSourceConstants.BATCH_DURATION_MS) +
            context.getLong("kafka.consumer.timeout.ms")) );
View Full Code Here

TOP

Related Classes of org.apache.flume.PollableSource.Status

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.