Package com.cloudera.flume.conf

Examples of com.cloudera.flume.conf.FlumeConfigData


    @Override
    public AvroFlumeConfigData getConfig(CharSequence sourceId)
        throws AvroRemoteException {
      Log.info("getConfig called at server on " + this.server.getPort());
      FlumeConfigData out = new FlumeConfigData();
      out.flowID = "flowID";
      out.sinkConfig = "sinkConfig";
      out.sinkVersion = 112233;
      out.sourceConfig = "sourceConfig";
      out.sourceVersion = 445566;
View Full Code Here


    }

    @Override
    public ThriftFlumeConfigData getConfig(String sourceId) throws TException {
      Log.info("getConfig called at server on " + this.port);
      FlumeConfigData out = new FlumeConfigData();
      out.flowID = "flowID";
      out.sinkConfig = "sinkConfig";
      out.sinkVersion = 112233;
      out.sourceConfig = "sourceConfig";
      out.sourceVersion = 445566;
View Full Code Here

  }

  public void dequeueCheckConfig() throws InterruptedException {
    Pair<LogicalNode, FlumeConfigData> pair = fcdQ.take();
    LogicalNode ln = pair.getLeft();
    FlumeConfigData fcd = pair.getRight();
    LOG.debug("Taking another heartbeat");
    ln.checkConfig(fcd); // if heartbeats responses queue up, subsequent
                         // changes will essentially be noops
  }
View Full Code Here

    }
    for (String ln : lns) {
      // a logical node is not present? spawn it.
      if (nodesman.get(ln) == null) {
        try {
          final FlumeConfigData data = master.getConfig(ln);
          if (data == null) {
            LOG.debug("Logical Node '" + ln + "' not configured on master");
            nodesman.spawn(ln, "null", "null");
          } else {
            nodesman.spawn(ln, data.getSourceConfig(), data.getSinkConfig());
          }
        } catch (FlumeSpecException e) {
          LOG.error("This should never happen", e);
        }
      }
View Full Code Here

    // request.

    for (LogicalNode nd : nodesman.getNodes()) {
      boolean needsCfg = master.heartbeat(nd);
      if (needsCfg) {
        final FlumeConfigData data = master.getConfig(nd.getName());
        if (data == null) {
          LOG.debug("Logical Node '" + nd.getName()
              + "' not configured on master");
        }
        final LogicalNode node = nd;
View Full Code Here

    tmp.delete();
    tmp.deleteOnExit();
    MemoryBackedConfigStore store = new MemoryBackedConfigStore();
    ConfigManager manager = new ConfigManager(store);
    manager.setConfig("foo", "my-test-flow", "null", "console");
    FlumeConfigData data = manager.getConfig("foo");
    assertEquals(data.getSinkConfig(), "console");
    assertEquals(data.getSourceConfig(), "null");

    manager.saveConfigFile(tmp.getAbsolutePath());

    manager = new ConfigManager(new MemoryBackedConfigStore());
    manager.loadConfigFile(tmp.getAbsolutePath());
    data = manager.getConfig("foo");
    assertEquals(data.getSinkConfig(), "console");
    assertEquals(data.getSourceConfig(), "null");
  }
View Full Code Here

    f.deleteOnExit();
    cm.saveConfigFile(f.getAbsolutePath());
    assertTrue(f.exists());
    assertTrue(f.length() > 0);

    FlumeConfigData data = cm.getConfig("test1");
    assertEquals(data.sinkConfig, "console");
    assertEquals(data.sourceConfig, "console");

    // overwrite previous config.
    cm.setConfig("test1", "test-flow", "null", "null");
View Full Code Here

        return set;
      }
    });

    // 0 is the first cfg version
    FlumeConfigData cfg = new FlumeConfigData(0, "null", "null", 0, 0,
        "my-test-flow");
    node.loadConfig(cfg); // this will load the NextExnSource and a NullSink

    ReportEvent rpt = node.getMetrics();
    LOG.info(rpt.toString());
View Full Code Here

      LOG.info("creating new logical node " + name);
      nd = new LogicalNode(ctx, name);
      threads.put(nd.getName(), nd);
    }
    long ver = Clock.unixTime();
    FlumeConfigData fcd = new FlumeConfigData(ver, src, snk, ver, ver,
        FlumeConfiguration.get().getDefaultFlowName());
    nd.loadConfig(fcd);

  }
View Full Code Here

    LogicalNode node = new LogicalNode(new Context(), "test-logical-node");

    assertFalse(node.checkConfig(null));

    // Are new configs accepted?
    FlumeConfigData cfgData = new FlumeConfigData(0, "null", "null", 0, 0,
        "my-test-flow");
    assertTrue(node.checkConfig(cfgData));
    assertFalse(node.checkConfig(cfgData));

    // Are updated configs accepted?
    FlumeConfigData cfgData2 = new FlumeConfigData(0, "null", "null", 1, 0,
        "my-test-flow");
    assertTrue(node.checkConfig(cfgData2));
    assertFalse(node.checkConfig(cfgData2));
    assertFalse(node.checkConfig(cfgData));

    // Are configs with the same version rejected?
    FlumeConfigData cfgData3 = new FlumeConfigData(0, "null", "null", 1, 1,
        "my-test-flow");
    assertFalse(node.checkConfig(cfgData));
    assertFalse(node.checkConfig(cfgData2));
    assertFalse(node.checkConfig(cfgData3));
View Full Code Here

TOP

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

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.