Package com.cloudera.flume.conf

Examples of com.cloudera.flume.conf.LogicalNodeContext


        try {
          List<FlumeNodeSpec> cfgs = FlumeSpecGen.generate(argv[0]);
          // check all cfgs to make sure they are valid
          for (FlumeNodeSpec spec : cfgs) {
            // TODO: first arg should be physical node
            Context ctx = new LogicalNodeContext(spec.node, spec.node);
            FlumeBuilder.buildSource(ctx, spec.src);
            FlumeBuilder.buildSink(ctx, spec.sink);
          }

          // set all cfgs to make sure they are valid.
View Full Code Here


    try {
      // make sure the sink specified is parsable and instantiable.

      // TODO the first arg should be physical node name
      Context ctx = new LogicalNodeContext(logicalNode, logicalNode);
      FlumeBuilder.buildSink(ctx, sink);
      FlumeBuilder.buildSource(ctx, source);
    } catch (Exception e) {
      throw new IllegalArgumentException(
          "Attempted to write an invalid sink/source: " + e.getMessage(), e);
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

  }

  LogicalNode setupAgent(long count, String agentSink) throws IOException,
      RuntimeException, FlumeSpecException {
    LogicalNode agent = new LogicalNode(
        new LogicalNodeContext("phys", "agent"), "agent");
    FlumeConfigData fcd = new FlumeConfigData(0, "asciisynth(" + count + ")",
        agentSink, 1, 1, "flow");
    agent.loadConfig(fcd);
    return agent;
  }
View Full Code Here

    return agent;
  }

  LogicalNode setupColl(long port, String name, String acc) throws IOException,
      RuntimeException, FlumeSpecException {
    Context ctx = new LogicalNodeContext(new ReportTestingContext(), "phys",
        name);
    LogicalNode coll = new LogicalNode(ctx, name);
    FlumeConfigData fcd2 = new FlumeConfigData(0, "rpcSource(" + port + ")",
        "accumulator(\"" + acc + "\")", 1, 1, "flow");
    coll.loadConfig(fcd2);
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

    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(ReportUtil.toJSONObject(rpt).toString());

    // just check a sample of the values:
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

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.