Package com.cloudera.flume.conf

Examples of com.cloudera.flume.conf.SinkFactoryImpl


  }

  @Test
  public void testFailCloseSink() throws IOException, RuntimeException,
      FlumeSpecException, InterruptedException {
    SinkFactoryImpl snkfact = new SinkFactoryImpl();
    snkfact.setSink("failClose", new SinkBuilder() {
      @Override
      public EventSink build(Context context, String... argv) {
        return new EventSink.Base() {
          @Override
          public void open() throws IOException {
View Full Code Here


   */
  @Test
  public void testNoHang() throws IOException, InterruptedException,
      FlumeSpecException {
    // add a hanging sink.
    SinkFactoryImpl sf = new SinkFactoryImpl();
    sf.setSink("hang", new SinkBuilder() {

      @Override
      public EventSink build(Context context, String... argv) {
        return new EventSink.Base() {
          @Override
View Full Code Here

public class ReportTestUtils {
  /**
   * Adds a few simple sinks with known names
   */
  public static void setupSinkFactory() {
    SinkFactoryImpl sf = new SinkFactoryImpl();
    sf.setSink("one", new SinkBuilder() {
      @Override
      public EventSink build(Context context, String... argv) {
        return new EventSink.Base() {
          public String getName() {
            return "One";
          }
        };
      }
    });
    sf.setSink("two", new SinkBuilder() {
      @Override
      public EventSink build(Context context, String... argv) {
        return new EventSink.Base() {
          public String getName() {
            return "Two";
          }
        };
      }
    });
    sf.setSink("three", new SinkBuilder() {
      @Override
      public EventSink build(Context context, String... argv) {
        return new EventSink.Base() {
          public String getName() {
            return "Three";
View Full Code Here

  final MemorySinkSource mem = new MemorySinkSource();

  @Before
  public void replaceEscapedCustomDfsSink() {
    // Replace the null with a memory buffer that we have a reference to
    SinkFactoryImpl sf = new SinkFactoryImpl();
    sf.setSink("null", new SinkBuilder() {
      @Override
      public EventSink build(Context context, String... argv) {
        LOG.info("excapedCustomDfs replaced with MemorySinkSource");
        mem.reset();
        return mem;
View Full Code Here

    }
  }

  @Before
  public void addCheckSink() {
    SinkFactoryImpl sf = new SinkFactoryImpl();
    sf.setSink("check", CheckSink.builder());
    FlumeBuilder.setSinkFactory(sf);
  }
View Full Code Here

  }

  @Test
  public void testFailOpenSink() throws IOException, RuntimeException,
      FlumeSpecException, InterruptedException {
    SinkFactoryImpl snkfact = new SinkFactoryImpl();
    snkfact.setSink("failOpen", new SinkBuilder() {
      @Override
      public EventSink build(Context context, String... argv) {
        return new EventSink.Base() {
          @Override
          public void open() throws IOException {
View Full Code Here

  }

  @Test
  public void testFailAppendSink() throws IOException, RuntimeException,
      FlumeSpecException, InterruptedException {
    SinkFactoryImpl snkfact = new SinkFactoryImpl();
    snkfact.setSink("failAppend", new SinkBuilder() {
      @Override
      public EventSink build(Context context, String... argv) {
        return new EventSink.Base() {
          @Override
          public void append(Event e) throws IOException {
View Full Code Here

  public static Logger LOG = LoggerFactory
      .getLogger(TestHBaseSinkBuilder.class);

  @BeforeClass
  public static void setup() throws Exception {
    SinkFactoryImpl sf = new SinkFactoryImpl();
    sf.setSink("hbase", HBaseSink.builder());
    FlumeBuilder.setSinkFactory(sf);
  }
View Full Code Here

   */
  @Test
  public void testNoHang() throws IOException, InterruptedException,
      FlumeSpecException {
    // add a hanging sink.
    SinkFactoryImpl sf = new SinkFactoryImpl();
    sf.setSink("hang", new SinkBuilder() {

      @Override
      public EventSink build(Context context, String... argv) {
        return new EventSink.Base() {
          @Override
View Full Code Here

      @Override
      public EventSink build(Context context, String... argv) {
        return snk;
      }
    };
    SinkFactoryImpl sf = new SinkFactoryImpl();
    sf.setSink("cnf", sb);
    FlumeBuilder.setSinkFactory(sf);

    final EventSink coll = FlumeBuilder.buildSink(
        LogicalNodeContext.testingContext(), "collector(5000) { cnf }");
    coll.open();
View Full Code Here

TOP

Related Classes of com.cloudera.flume.conf.SinkFactoryImpl

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.