Package com.cloudera.flume.conf

Examples of com.cloudera.flume.conf.Context


   * @throws InterruptedException
   */
  @Test(expected = IOException.class)
  public void testAutoBEChain() throws FlumeSpecException, IOException,
      InterruptedException {
    FlumeBuilder.buildSink(new Context(), "autoBEChain").open();
  }
View Full Code Here


  }

  @Test(expected = IOException.class)
  public void testAutoDFOChain() throws FlumeSpecException, IOException,
      InterruptedException {
    FlumeBuilder.buildSink(new Context(), "autoDFOChain").open();
  }
View Full Code Here

  }

  @Test(expected = IOException.class)
  public void testAutoE2EChain() throws FlumeSpecException, IOException,
      InterruptedException {
    FlumeBuilder.buildSink(new Context(), "autoE2EChain").open();
  }
View Full Code Here

        "{lazyOpen => counter(\"%s\")}");
    LOG.info(agent1);
    assertEquals(
        "failChain(\"{lazyOpen => counter(\\\"%s\\\")}\",\"collector 2\",\"collector 3\",\"collector 1\")",
        agent1);
    CompositeSink snk1 = new CompositeSink(new Context(), agent1);
    snk1.open();
    snk1.close();

    String agent2 = am.getFailChainSinkSpec("agent2",
        "{lazyOpen => counter(\"%s\")}");
    LOG.info(agent2);
    assertEquals(
        "failChain(\"{lazyOpen => counter(\\\"%s\\\")}\",\"collector 1\",\"collector 4\",\"collector 5\")",
        agent2);
    CompositeSink snk2 = new CompositeSink(new Context(), agent2);
    snk2.open();
    snk2.close();

    String agent3 = am.getFailChainSinkSpec("agent3",
        "{lazyOpen => counter(\"%s\")}");
    LOG.info(agent3);
    assertEquals(
        "failChain(\"{lazyOpen => counter(\\\"%s\\\")}\",\"collector 1\",\"collector 2\",\"collector 5\")",
        agent3);
    CompositeSink snk3 = new CompositeSink(new Context(), agent3);
    snk3.open();
    snk3.close();

  }
View Full Code Here

        "{lazyOpen => counter(\"%s\")}");
    LOG.info(agent1);
    assertEquals(
        "failChain(\"{lazyOpen => counter(\\\"%s\\\")}\",\"collector 5\",\"collector 1\",\"collector 3\")",
        agent1);
    CompositeSink snk1 = new CompositeSink(new Context(), agent1);
    snk1.open();
    snk1.close();

    String agent2 = am.getFailChainSinkSpec("agent2",
        "{lazyOpen => counter(\"%s\")}");
    LOG.info(agent2);
    assertEquals(
        "failChain(\"{lazyOpen => counter(\\\"%s\\\")}\",\"collector 2\",\"collector 1\",\"collector 3\")",
        agent2);
    CompositeSink snk2 = new CompositeSink(new Context(), agent2);
    snk2.open();
    snk2.close();

    String agent3 = am.getFailChainSinkSpec("agent3",
        "{lazyOpen => counter(\"%s\")}");
    LOG.info(agent3);
    assertEquals(
        "failChain(\"{lazyOpen => counter(\\\"%s\\\")}\",\"collector 5\",\"collector 1\",\"collector 2\")",
        agent3);
    CompositeSink snk3 = new CompositeSink(new Context(), agent3);
    snk3.open();
    snk3.close();

  }
View Full Code Here

   * No exception expected
   */
  @Test
  public void testBadArgsParseOK() {
    SinkBuilder sb = DFSEventSink.builder();
    sb.build(new Context(), "/foo/msgs");
  }
View Full Code Here

      public String newTag() {
        return "-testtag";
      }
    };
    final File f = FileUtil.mktempdir();
    RollSink snk = new RollSink(new Context(), "test", new TimeTrigger(tagger,
        10000), 250) {
      @Override
      protected EventSink newSink(Context ctx) throws IOException {
        return new EscapedCustomDfsSink("file:///" + f.getPath(),
            "sub-%{service}%{rolltag}");
View Full Code Here

   * wrong # args, exception expected
   */
  @Test(expected = IllegalArgumentException.class)
  public void testBadArgsParseOkInstanceFail() {
    SinkBuilder sb = DFSEventSink.builder();
    sb.build(new Context());
  }
View Full Code Here

  @Test
  public void testBadArgsOpenFail() throws IOException, InterruptedException {
    assumeTrue(!OSUtils.isWindowsOS());

    SinkBuilder sb = DFSEventSink.builder();
    EventSink snk = sb.build(new Context(), "/foo/msgs");
    try {
      snk.open();
    } catch (IOException e) {
      return;
    }
View Full Code Here

      public String newTag() {
        return "-testtag";
      }
    };
    final File f = FileUtil.mktempdir();
    RollSink snk = new RollSink(new Context(), "escapedCustomDfs(\"file:///"
        + f.getPath() + "\", \"sub-%{service}%{rolltag}\")", new TimeTrigger(
        tagger, 10000), 250);

    Event e = new EventImpl("this is a test message".getBytes());
    Attributes.setString(e, "service", "foo");
View Full Code Here

TOP

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

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.