Package com.cloudera.flume.conf

Examples of com.cloudera.flume.conf.FlumeConfigData


      String source, String sink) throws IOException, FlumeSpecException {

    // if parent and self are different, save original to parent.
    if (parentMan != selfMan) {
      parentMan.setConfig(logicalnode, flowid, source, sink);
      FlumeConfigData fcd = parentMan.getConfig(logicalnode);
      // parent may have translated
      source = fcd.getSourceConfig();
      sink = fcd.getSinkConfig();
    }

    String xsink = translateSink(logicalnode, sink);
    String xsource = translateSource(logicalnode, source);
View Full Code Here


   */
  static void appendHtmlTranslatedFlumeConfigData(StringBuilder html,
      String name, FlumeConfigData fcd, FlumeConfigData xfcd) {
    html.append("\n<tr>");
    html.append("<td>" + name + "</td>");
    FlumeConfigData cfg = fcd;
    html.append("<td>" + new Date(cfg.timestamp) + "</td>");
    html.append("<td>" + cfg.flowID + "</td>");
    html.append("<td>" + cfg.sourceConfig + "</td>");
    html.append("<td>" + cfg.sinkConfig + "</td>");
    if (xfcd != null) {
View Full Code Here

   * user specified node to a different value, we actually read the user
   * specified source-sink pair and then use this manager's setConfig method to
   * include the autogenerated source-sink pair.
   */
  synchronized public void refresh(String logicalNode) throws IOException {
    FlumeConfigData fcd = parentMan.getConfig(logicalNode);
    if (fcd == null) {
      throw new IOException("original " + logicalNode + " not found");
    }
    try {
      setConfig(logicalNode, fcd.getFlowID(), fcd.getSourceConfig(), fcd
          .getSinkConfig());
    } catch (FlumeSpecException e) {
      throw new IOException(e);
    }
  }
View Full Code Here

    for (Entry<String, FlumeConfigData> ent : parentMan.getTranslatedConfigs()
        .entrySet()) {
      String node = ent.getKey();

      // get the original name
      FlumeConfigData fcd = ent.getValue();
      String src = fcd.getSourceConfig();
      String snk = fcd.getSinkConfig();

      String xsnk, xsrc;
      try {
        xsnk = translateSink(node, snk);
        xsrc = translateSource(node, src);

        FlumeConfigData selfData = selfMan.getConfig(node);

        if (selfData != null && xsnk.equals(selfData.getSinkConfig())
            && xsrc.equals(selfData.getSourceConfig())) {
          // same as before? do nothing
          LOG.debug("xsnk==snk = " + xsnk);
          LOG.debug("xsrc==src = " + xsrc);
          continue;
        }
        FlumeConfigData xfcd = new FlumeConfigData(fcd);
        xfcd.setSourceConfig(xsrc);
        xfcd.setSinkConfig(xsnk);
        updates.put(node, xfcd);
      } catch (FlumeSpecException e) {
        LOG.error("Internal Error: " + e.getLocalizedMessage(), e);
        throw new IOException("Internal Error: " + e.getMessage());
      }
View Full Code Here

    for (Entry<String, FlumeConfigData> ent : parentMan.getTranslatedConfigs()
        .entrySet()) {
      String node = ent.getKey();

      // get the original name
      FlumeConfigData fcd = ent.getValue();
      String src = fcd.getSourceConfig();
      String snk = fcd.getSinkConfig();

      String xsnk, xsrc;
      try {
        xsnk = translateSink(node, snk);
        xsrc = translateSource(node, src);
        FlumeConfigData xfcd = new FlumeConfigData(fcd);
        xfcd.setSinkConfig(xsnk);
        xfcd.setSourceConfig(xsrc);
        updates.put(node, xfcd);
      } catch (FlumeSpecException e) {
        LOG.error("Internal Error: " + e.getLocalizedMessage(), e);
        throw new IOException("Internal Error: " + e.getMessage());
      }
View Full Code Here

      String xsnk, xsrc;
      try {
        xsnk = translateSink(node, snk);
        xsrc = translateSource(node, src);
        if (selfMan != parentMan) {
          FlumeConfigData fcd = new FlumeConfigData(ent.getValue());
          updates.put(node, fcd);
        }
        FlumeConfigData xfcd = new FlumeConfigData(ent.getValue());
        xfcd.setSinkConfig(xsnk);
        xfcd.setSourceConfig(xsrc);
        selfupdates.put(node, xfcd);
      } catch (FlumeSpecException e) {
        LOG.error("Internal Error: " + e.getLocalizedMessage(), e);
        throw new IOException("Internal Error: " + e.getMessage());
      }
View Full Code Here

        .size());
    assertEquals(5, flowed.getConfigManForFlow("flow1").getAllConfigs().size());
    assertEquals(5, flowed.getConfigManForFlow("flow2").getAllConfigs().size());
    assertEquals(10, flowed.getTranslatedConfigs().size());

    FlumeConfigData agent1 = logical.getConfig("agent1");
    FlumeConfigData agent2 = logical.getConfig("agent2");

    String host = NetUtils.localhost();
    LOG.info(agent1);
    assertEquals("< { lazyOpen => rpcSink( \"" + host + "\", 35856 ) } ? "
        + "< { lazyOpen => rpcSink( \"" + host + "\", 35853 ) } ? "
        + "< { lazyOpen => rpcSink( \"" + host + "\", 35855 ) } ? null > > >",
        agent1.sinkConfig);
    LOG.info(agent2);
    assertEquals("< { lazyOpen => rpcSink( \"" + host + "\", 35859 ) } ? "
        + "< { lazyOpen => rpcSink( \"" + host + "\", 35858 ) } ? "
        + "< { lazyOpen => rpcSink( \"" + host + "\", 35857 ) } ? null > > >",
        agent2.sinkConfig);

    // change the flow group of one of the relevent logicalSinks.
    logical.setConfig("coll14", "flow2", "autoCollectorSource", "null");
    FlumeConfigData nextAgent1 = logical.getConfig("agent1");
    FlumeConfigData nextAgent2 = logical.getConfig("agent2");

    // look, the coll14 was removed from agent1 and into agent2
    LOG.info(nextAgent1);
    assertEquals("< { lazyOpen => rpcSink( \"" + host + "\", 35853 ) } ? "
        + "< { lazyOpen => rpcSink( \"" + host + "\", 35855 ) } ? "
View Full Code Here

    // Note: version and lastSeen aren't kept up-to-date on the logical node.
    // The master fills them in when it receives a NodeStatus heartbeat.
    state = new NodeStatus(NodeState.HELLO, 0, 0, NetUtils.localhost(),
        FlumeNode.getInstance().getPhysicalNodeName());
    // Set version to -1 so that all non-negative versions will be 'later'
    lastGoodCfg = new FlumeConfigData(0, "null", "null", VERSION_INFIMUM,
        VERSION_INFIMUM, FlumeConfiguration.get().getDefaultFlowName());
  }
View Full Code Here

   */
  static void appendHtmlFlumeConfigData(StringBuilder html, String name,
      FlumeConfigData fcd) {
    html.append("\n<tr>");
    html.append("<td>" + name + "</td>");
    FlumeConfigData cfg = fcd;
    html.append("<td>" + new Date(cfg.timestamp) + "</td>");
    html.append("<td>" + cfg.flowID + "</td>");
    html.append("<td>" + cfg.sourceConfig + "</td>");
    html.append("<td>" + cfg.sinkConfig + "</td>");
    html.append("</tr>\n");
View Full Code Here

   * This reads a configuration and the sets it again. This updates the version
   * stamp and forces nodes to update their configurations.
   */
  @Override
  synchronized public void refresh(String logicalNode) throws IOException {
    FlumeConfigData fcd = cfgStore.getConfig(logicalNode);
    if (fcd == null) {
      throw new IOException("Unable to refresh logicalNode " + logicalNode
          + ".  It doesn't exist!");
    }

    cfgStore.setConfig(logicalNode, fcd.getFlowID(), fcd.getSourceConfig(), fcd
        .getSinkConfig());
  }
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.