Package com.cloudera.flume.conf

Examples of com.cloudera.flume.conf.FlumeConfigData


          // set all cfgs to make sure they are valid.
          ConfigurationManager specman = master.getSpecMan();
          Map<String, FlumeConfigData> configs = new HashMap<String, FlumeConfigData>();
          for (FlumeNodeSpec spec : cfgs) {

            configs.put(spec.node, new FlumeConfigData(0, spec.src, spec.sink,
                LogicalNode.VERSION_INFIMUM, LogicalNode.VERSION_INFIMUM,
                FlumeConfiguration.get().getDefaultFlowName()));

            if (spec.src.contains("collectorSource")) {
              needsRefresh = true;
View Full Code Here


        + host + " but missing source!");
    Preconditions.checkArgument(sink != null, "Attempted to set config " + host
        + " but missing sink");

    long time = Clock.unixTime();
    cfgs.put(host, new FlumeConfigData(time, source, sink, time, time, flowid));
  }
View Full Code Here

  @Override
  public void bulkSetConfig(Map<String, FlumeConfigData> configs)
      throws IOException {
    for (Entry<String, FlumeConfigData> e : configs.entrySet()) {
      FlumeConfigData f = e.getValue();
      setConfig(e.getKey(), f.getFlowID(), f.getSourceConfig(), f
          .getSinkConfig());
    }
  }
View Full Code Here

   */
  @Test
  public void testMasterNoNode() {
    Map<String, FlumeConfigData> xcfgs = flumeMaster.getSpecMan()
        .getTranslatedConfigs();
    FlumeConfigData agentFcd = xcfgs.get("agent");
    String ans1 = "< < { lazyOpen => fail( \"logicalSink( \\\"node4\\\" )\" ) } ?"
        + " < { lazyOpen => fail( \"logicalSink( \\\"node2\\\" )\" ) } ?"
        + " { lazyOpen => fail( \"logicalSink( \\\"node1\\\" )\" ) } > > ?"
        + " { diskFailover => { insistentAppend => { stubbornAppend =>"
        + " { insistentOpen =>"
View Full Code Here

    // Look, no explicit updates!

    // check new config
    Map<String, FlumeConfigData> xcfgs2 = flumeMaster.getSpecMan()
        .getTranslatedConfigs();
    FlumeConfigData agentFcd2 = xcfgs2.get("agent");
    String ans2 = "< < { lazyOpen => fail( \"logicalSink( \\\"node4\\\" )\" ) } ?"
        + " < { lazyOpen => fail( \"logicalSink( \\\"node1\\\" )\" ) } ?"
        + " { lazyOpen => fail( \"logicalSink( \\\"node3\\\" )\" ) } > > ?"
        + " { diskFailover => { insistentAppend => { stubbornAppend =>"
        + " { insistentOpen =>"
View Full Code Here

    // Look, no explicit update call!

    // check new config
    Map<String, FlumeConfigData> xcfgs2 = flumeMaster.getSpecMan()
        .getTranslatedConfigs();
    FlumeConfigData agentFcd2 = xcfgs2.get("agent");
    // This is wrong -- there should be a different logicalSink replacing node2
    String ans2 = "< < { lazyOpen => fail( \"logicalSink( \\\"node4\\\" )\" ) } ?"
        + " < { lazyOpen => fail( \"logicalSink( \\\"node1\\\" )\" ) } ?"
        + " { lazyOpen => fail( \"logicalSink( \\\"node3\\\" )\" ) } > > ?"
        + " { diskFailover => { insistentAppend => { stubbornAppend =>"
View Full Code Here

    // Look, no explicit update call!

    // check new config
    Map<String, FlumeConfigData> xcfgs2 = flumeMaster.getSpecMan()
        .getTranslatedConfigs();
    FlumeConfigData agentFcd2 = xcfgs2.get("agent");
    String ans2 = "< < { lazyOpen => fail( \"logicalSink( \\\"nodeNew\\\" )\" ) } ?"
        + " < { lazyOpen => fail( \"logicalSink( \\\"node4\\\" )\" ) } ?"
        + " { lazyOpen => fail( \"logicalSink( \\\"node2\\\" )\" ) } > > ?"
        + " { diskFailover => { insistentAppend => { stubbornAppend =>"
        + " { insistentOpen =>"
View Full Code Here

    // Look, no explicit update call!

    // check new config
    Map<String, FlumeConfigData> xcfgs2 = flumeMaster.getSpecMan()
        .getTranslatedConfigs();
    FlumeConfigData agentFcd2 = xcfgs2.get("agent");
    // This is wrong -- there should be a different logicalSink replacing node2
    String ans2 = "< < { lazyOpen => rpcSink( \"" + host + "\", 35856 ) } ?"
        + " < { lazyOpen => rpcSink( \"" + host + "\", 35854 ) } ?"
        + " { lazyOpen => rpcSink( \"" + host + "\", 35853 ) } > > ?"
        + " { diskFailover => { insistentAppend => { stubbornAppend =>"
View Full Code Here

    // Look, no explicit update call!

    // check new config
    Map<String, FlumeConfigData> xcfgs2 = flumeMaster.getSpecMan()
        .getTranslatedConfigs();
    FlumeConfigData agentFcd2 = xcfgs2.get("agent");
    String ans2 = "< < { lazyOpen => fail( \"logicalSink( \\\"node4\\\" )\" ) } ?"
        + " < { lazyOpen => fail( \"logicalSink( \\\"node2\\\" )\" ) } ?"
        + " { lazyOpen => fail( \"logicalSink( \\\"node1\\\" )\" ) } > > ?"
        + " { diskFailover => { insistentAppend => { stubbornAppend =>"
        + " { insistentOpen => < { lazyOpen => fail( \"logicalSink( \\\"node4\\\" )\" ) } ?"
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 = flowed.getConfig("agent1");
    FlumeConfigData agent2 = flowed.getConfig("agent2");

    LOG.info(agent1);
    assertEquals("< { lazyOpen => logicalSink( \"coll14\" ) } ? "
        + "< { lazyOpen => logicalSink( \"coll11\" ) } ? "
        + "< { lazyOpen => logicalSink( \"coll13\" ) } ? null > > >",
        agent1.sinkConfig);
    LOG.info(agent2);
    assertEquals("< { lazyOpen => logicalSink( \"coll23\" ) } ? "
        + "< { lazyOpen => logicalSink( \"coll22\" ) } ? "
        + "< { lazyOpen => logicalSink( \"coll21\" ) } ? null > > >",
        agent2.sinkConfig);

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

    // look, the coll14 was removed from agent1 and into agent2
    LOG.info(nextAgent1);
    assertEquals("< { lazyOpen => logicalSink( \"coll11\" ) } ? "
        + "< { lazyOpen => logicalSink( \"coll13\" ) } ? "
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.