Package com.cloudera.flume.master

Examples of com.cloudera.flume.master.ConfigurationManager


    out.close();

    retval = sh.executeLine("exec load '" + saveFile.getAbsolutePath() + "'");
    assertEquals(0, retval);

    ConfigurationManager manager = flumeMaster.getSpecMan();
    FlumeConfigData data = manager.getConfig("foo");
    assertEquals(data.getSinkConfig(), "console");
    assertEquals(data.getSourceConfig(), "null");
  }
View Full Code Here


  /**
   * Instantiate and expose managers
   */
  void setupNewManagers() {
    ConfigurationManager parent = new ConfigManager();
    ConfigurationManager self = new ConfigManager();
    FailoverChainManager fcMan = new ConsistentHashFailoverChainManager(3);
    ConfigurationManager self2 = new ConfigManager();

    failover = new FailoverConfigurationManager(parent, self2, fcMan);
    statman = new StatusManager();
    logical = new LogicalConfigurationManager(failover, self, statman);
    trans = logical;
View Full Code Here

  /**
   * Test the core of the LogicalConfigManager
   */
  @Test
  public void testLogicalTrans() throws IOException, FlumeSpecException {
    ConfigurationManager parent = new ConfigManager();
    ConfigurationManager self = new ConfigManager();
    StatusManager statman = new StatusManager();
    ConfigurationManager trans = new LogicalConfigurationManager(parent, self,
        statman);

    // make it so that the local host info is present
    statman.updateHeartbeatStatus("foo", "foo", "foo", NodeState.HELLO, Clock
        .unixTime());
    statman.updateHeartbeatStatus("bar", "bar", "bar", NodeState.HELLO, Clock
        .unixTime());

    // Next spawn so that all are mapped onto a node and now gets a physical
    trans.addLogicalNode("foo", "foo");
    trans.addLogicalNode("bar", "bar");

    // now set configs
    trans.setConfig("foo", DEFAULTFLOW, "logicalSource", "null");
    trans.setConfig("bar", DEFAULTFLOW, "null", "logicalSink(\"foo\")");

    // update the configurations
    trans.updateAll();
    int port = FlumeConfiguration.get().getCollectorPort();

    // check if translated
    FlumeConfigData transData = trans.getConfig("bar");
    assertEquals("null", transData.getSourceConfig());
    assertEquals("rpcSink( \"foo\", " + port + " )", transData.getSinkConfig());

    FlumeConfigData transData2 = trans.getConfig("foo");
    assertEquals("rpcSource( " + port + " )", transData2.getSourceConfig());
    assertEquals("null", transData2.getSinkConfig());

    // self is same as translated
    FlumeConfigData selfData = self.getConfig("bar");
View Full Code Here

   * Test to ensure attempts to map a single logical node to multiple physicals
   * is discarded with a warning. This may be exception worthy.
   */
  @Test
  public void testDuplicateAssignment() {
    ConfigurationManager parent = new ConfigManager();
    ConfigurationManager self = new ConfigManager();
    StatusManager statman = new StatusManager();
    ConfigurationManager trans = new LogicalConfigurationManager(parent, self,
        statman);

    trans.addLogicalNode("hostA", "foo");
    assertEquals(1, trans.getLogicalNodeMap().size());

    trans.addLogicalNode("hostB", "foo");
    assertEquals(1, trans.getLogicalNodeMap().size());

    assertEquals(Arrays.asList("foo"), trans.getLogicalNode("hostA"));
    assertEquals(Collections.EMPTY_LIST, trans.getLogicalNode("hostB"));
  }
View Full Code Here

TOP

Related Classes of com.cloudera.flume.master.ConfigurationManager

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.