Package com.cloudera.flume.conf

Examples of com.cloudera.flume.conf.LogicalNodeContext


    c2Src.open();

    // create agentDFOChain sink
    File tmpDir = FileUtil.mktempdir();
    String spec = "agentDFOChain(\"localhost:1234\", \"localhost:1235\")";
    CompositeSink snk = new CompositeSink(new LogicalNodeContext(
        tmpDir.getName(), tmpDir.getName()), spec);
    snk.open();

    Event e1 = new EventImpl("test 1".getBytes());
    Event e2 = new EventImpl("test 2".getBytes());
View Full Code Here


      String spec = cmd.getOptionValue("c");
      LOG.info("Loading spec from command line: '" + spec + "'");

      try {
        // TODO the first one should be physical node name
        Context ctx = new LogicalNodeContext(nodename, nodename);
        Map<String, Pair<String, String>> cfgs = FlumeBuilder.parseConf(ctx,
            spec);
        Pair<String, String> node = cfgs.get(nodename);
        flume.nodesMan.spawn(nodename, node.getLeft(), node.getRight());
      } catch (Exception e) {
View Full Code Here

      String spec = cmd.getOptionValue("c");
      LOG.info("Loading spec from command line: '" + spec + "'");

      try {
        // TODO the first one should be physical node name
        Context ctx = new LogicalNodeContext(nodename, nodename);
        Map<String, Pair<String, String>> cfgs = FlumeBuilder.parseConf(ctx,
            spec);
        Pair<String, String> node = cfgs.get(nodename);
        flume.nodesMan.spawn(nodename, node.getLeft(), node.getRight());
      } catch (Exception e) {
View Full Code Here

    String spec = AgentFailChainSink.genE2EChain("counter(\"foo1\")",
        "counter(\"foo2\")", "counter(\"foo3\")");

    LOG.info("waled failchain: " + spec);
    String node = NetUtils.localhost();
    EventSink snk = FlumeBuilder.buildSink(new LogicalNodeContext(node, node),
        spec);
    ReportEvent rpt = ReportUtil.getFlattenedReport(snk);
    LOG.info(ReportUtil.toJSONObject(rpt).toString());

    // just check a sample of the values:
View Full Code Here

    ReportManager.get().clear();
    String spec = "agentE2EChain(\"foo:123\",\"bar\",\"baz\")";

    LOG.info("waled failchain: " + spec);
    String node = NetUtils.localhost();
    new CompositeSink(new LogicalNodeContext(node, node), spec);
  }
View Full Code Here

    ReportManager.get().clear();
    String spec = AgentFailChainSink.genDfoChain("counter(\"foo1\")",
        "counter(\"foo2\")", "counter(\"foo3\")");
    LOG.info("disk failover failchain: " + spec);
    String node = NetUtils.localhost();
    EventSink snk = FlumeBuilder.buildSink(new LogicalNodeContext(node, node),
        spec);
    ReportEvent rpt = ReportUtil.getFlattenedReport(snk);
    LOG.info("testDFOFailchain report {}", ReportUtil.toJSONObject(rpt)
        .toString());
View Full Code Here

    ReportManager.get().clear();
    String spec = "agentDFOChain(\"foo:123\",\"bar\",\"baz\")";

    LOG.info("waled failchain: " + spec);
    String node = NetUtils.localhost();
    new CompositeSink(new LogicalNodeContext(node, node), spec);
  }
View Full Code Here

    c2Src.open();

    // create agentDFOChain sink
    File tmpDir = FileUtil.mktempdir();
    String spec = "agentDFOChain(\"localhost:1236\", \"localhost:1237\")";
    CompositeSink snk = new CompositeSink(new LogicalNodeContext(
        tmpDir.getName(), tmpDir.getName()), spec);
    snk.open();

    Event e1 = new EventImpl("test 1".getBytes());
    Event e2 = new EventImpl("test 2".getBytes());
View Full Code Here

   * Give a logical node name, and src and a sink spec, generate a new logical
   * node.
   */
  synchronized public void spawn(String name, String src, String snk)
      throws IOException, FlumeSpecException {
    Context ctx = new LogicalNodeContext(physicalNode, name);
    spawn(ctx, name, FlumeBuilder.buildSource(ctx, src), new CompositeSink(ctx,
        snk));
  }
View Full Code Here

   */
  synchronized public void testingSpawn(String name, String src, String snk)
      throws IOException, FlumeSpecException {
    LogicalNode nd = threads.get(name);
    if (nd == null) {
      Context ctx = new ReportTestingContext(new LogicalNodeContext(
          physicalNode, name));

      LOG.info("creating new logical node " + name);
      nd = new LogicalNode(ctx, name);
      threads.put(nd.getName(), nd);
View Full Code Here

TOP

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

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.