Package com.cloudera.flume.agent

Examples of com.cloudera.flume.agent.LivenessManager


    FlumeNode node = new FlumeNode(rpc, false, false);
    // should have nothing.
    assertEquals(0, node.getLogicalNodeManager().getNodes().size());

    LivenessManager liveMan = node.getLivenessManager();
    liveMan.checkLogicalNodes();
    // the two added nodes, plus the always present physnode/logical
    assertEquals(3, node.getLogicalNodeManager().getNodes().size());

  }
View Full Code Here


    master.getSpecMan().addLogicalNode(NetUtils.localhost(),
        node.getPhysicalNodeName());
    master.getSpecMan().addLogicalNode(NetUtils.localhost(), "bar");
    master.getSpecMan().addLogicalNode(NetUtils.localhost(), "baz");

    LivenessManager liveMan = node.getLivenessManager();
    liveMan.checkLogicalNodes();
    // the two added nodes, plus the always present physnode/logical
    assertEquals(3, node.getLogicalNodeManager().getNodes().size());
  }
View Full Code Here

    master.getSpecMan().addLogicalNode(NetUtils.localhost(),
        node.getPhysicalNodeName());
    master.getSpecMan().addLogicalNode(NetUtils.localhost(), "bar");
    master.getSpecMan().addLogicalNode(NetUtils.localhost(), "baz");

    LivenessManager liveMan = node.getLivenessManager();
    liveMan.checkLogicalNodes();
    // the two added nodes, plus the always present physnode/logical
    assertEquals(3, node.getLogicalNodeManager().getNodes().size());
  }
View Full Code Here

    master.getSpecMan().addLogicalNode(local, node.getPhysicalNodeName());
    master.getSpecMan().addLogicalNode(local, "bar");
    master.getSpecMan().addLogicalNode(local, "baz");

    LivenessManager liveMan = node.getLivenessManager();
    liveMan.checkLogicalNodes();

    assertEquals(local, master.getSpecMan().getPhysicalNode("bar"));
    assertEquals(local, master.getSpecMan().getPhysicalNode("baz"));
    assertEquals(local, master.getSpecMan().getPhysicalNode(local));
    assertNull(master.getSpecMan().getConfig("bar"));
    assertNull(master.getSpecMan().getConfig("baz"));
    assertNull(master.getSpecMan().getConfig(local));

    master.getSpecMan().unmapLogicalNode(local, "bar");
    liveMan.checkLogicalNodes();
    assertEquals(null, master.getSpecMan().getPhysicalNode("bar"));
    assertEquals(local, master.getSpecMan().getPhysicalNode("baz"));
    assertEquals(local, master.getSpecMan().getPhysicalNode(local));
    assertNull(master.getSpecMan().getConfig("bar"));
    assertNull(master.getSpecMan().getConfig("baz"));
    assertNull(master.getSpecMan().getConfig(local));

    master.getSpecMan().unmapLogicalNode(local, "baz");
    liveMan.checkLogicalNodes();
    assertEquals(null, master.getSpecMan().getPhysicalNode("bar"));
    assertEquals(null, master.getSpecMan().getPhysicalNode("baz"));
    assertEquals(local, master.getSpecMan().getPhysicalNode(local));
    assertNull(master.getSpecMan().getConfig("bar"));
    assertNull(master.getSpecMan().getConfig("baz"));
    assertNull(master.getSpecMan().getConfig(local));

    master.getSpecMan().unmapLogicalNode(local, local);
    liveMan.checkLogicalNodes();
    assertNull(master.getSpecMan().getConfig("bar"));
    assertNull(master.getSpecMan().getConfig("baz"));
    assertNull(master.getSpecMan().getConfig(local));
    assertEquals(null, master.getSpecMan().getPhysicalNode("bar"));
    assertEquals(null, master.getSpecMan().getPhysicalNode("baz"));
View Full Code Here

    master.getSpecMan().addLogicalNode(local, "baz");

    Multimap<String, String> mapping = master.getSpecMan().getLogicalNodeMap();
    assertEquals(3, mapping.size());

    LivenessManager liveMan = node.getLivenessManager();
    liveMan.checkLogicalNodes();
    assertEquals(3, node.getLogicalNodeManager().getNodes().size());
  }
View Full Code Here

    master.getSpecMan().addLogicalNode(local, "baz");
    master.getSpecMan().setConfig(local, "my-test-flow", "null", "null");
    master.getSpecMan().setConfig("bar", "my-test-flow", "null", "null");
    master.getSpecMan().setConfig("baz", "my-test-flow", "null", "null");

    LivenessManager liveMan = node.getLivenessManager();
    liveMan.heartbeatChecks();
    // liveMan.checkLogicalNodes();

    assertEquals(local, master.getSpecMan().getPhysicalNode("bar"));
    assertEquals(local, master.getSpecMan().getPhysicalNode("baz"));
    assertEquals(local, master.getSpecMan().getPhysicalNode(local));
    assertNotNull(master.getSpecMan().getConfig("bar"));
    assertNotNull(master.getSpecMan().getConfig("baz"));
    assertNotNull(master.getSpecMan().getConfig(local));

    master.getSpecMan().removeLogicalNode("bar");
    liveMan.heartbeatChecks();
    // liveMan.checkLogicalNodes();
    assertEquals(null, master.getSpecMan().getPhysicalNode("bar"));
    assertEquals(local, master.getSpecMan().getPhysicalNode("baz"));
    assertEquals(local, master.getSpecMan().getPhysicalNode(local));
    assertNull(master.getSpecMan().getConfig("bar"));
    assertNotNull(master.getSpecMan().getConfig("baz"));
    assertNotNull(master.getSpecMan().getConfig(local));

    master.getSpecMan().removeLogicalNode("baz");
    liveMan.heartbeatChecks();
    // liveMan.checkLogicalNodes();
    assertEquals(null, master.getSpecMan().getPhysicalNode("bar"));
    assertEquals(null, master.getSpecMan().getPhysicalNode("baz"));
    assertEquals(local, master.getSpecMan().getPhysicalNode(local));
    assertNull(master.getSpecMan().getConfig("bar"));
    assertNull(master.getSpecMan().getConfig("baz"));
    assertNotNull(master.getSpecMan().getConfig(local));

    master.getSpecMan().removeLogicalNode(local);
    liveMan.heartbeatChecks();
    // liveMan.checkLogicalNodes();
    assertNull(master.getSpecMan().getConfig("bar"));
    assertNull(master.getSpecMan().getConfig("baz"));
    assertNull(master.getSpecMan().getConfig(local));
    assertEquals(null, master.getSpecMan().getPhysicalNode("bar"));
View Full Code Here

    master.getSpecMan().addLogicalNode(NetUtils.localhost(),
        node.getPhysicalNodeName());
    master.getSpecMan().addLogicalNode(NetUtils.localhost(), "bar");
    master.getSpecMan().addLogicalNode(NetUtils.localhost(), "baz");

    LivenessManager liveMan = node.getLivenessManager();
    liveMan.checkLogicalNodes();
    // the two added nodes, plus the always present physnode/logical
    assertEquals(3, node.getLogicalNodeManager().getNodes().size());
  }
View Full Code Here

    master.getSpecMan().addLogicalNode(local, node.getPhysicalNodeName());
    master.getSpecMan().addLogicalNode(local, "bar");
    master.getSpecMan().addLogicalNode(local, "baz");

    LivenessManager liveMan = node.getLivenessManager();
    liveMan.checkLogicalNodes();

    assertEquals(local, master.getSpecMan().getPhysicalNode("bar"));
    assertEquals(local, master.getSpecMan().getPhysicalNode("baz"));
    assertEquals(local, master.getSpecMan().getPhysicalNode(local));
    assertNull(master.getSpecMan().getConfig("bar"));
    assertNull(master.getSpecMan().getConfig("baz"));
    assertNull(master.getSpecMan().getConfig(local));

    master.getSpecMan().unmapLogicalNode(local, "bar");
    liveMan.checkLogicalNodes();
    assertEquals(null, master.getSpecMan().getPhysicalNode("bar"));
    assertEquals(local, master.getSpecMan().getPhysicalNode("baz"));
    assertEquals(local, master.getSpecMan().getPhysicalNode(local));
    assertNull(master.getSpecMan().getConfig("bar"));
    assertNull(master.getSpecMan().getConfig("baz"));
    assertNull(master.getSpecMan().getConfig(local));

    master.getSpecMan().unmapLogicalNode(local, "baz");
    liveMan.checkLogicalNodes();
    assertEquals(null, master.getSpecMan().getPhysicalNode("bar"));
    assertEquals(null, master.getSpecMan().getPhysicalNode("baz"));
    assertEquals(local, master.getSpecMan().getPhysicalNode(local));
    assertNull(master.getSpecMan().getConfig("bar"));
    assertNull(master.getSpecMan().getConfig("baz"));
    assertNull(master.getSpecMan().getConfig(local));

    master.getSpecMan().unmapLogicalNode(local, local);
    liveMan.checkLogicalNodes();
    assertNull(master.getSpecMan().getConfig("bar"));
    assertNull(master.getSpecMan().getConfig("baz"));
    assertNull(master.getSpecMan().getConfig(local));
    assertEquals(null, master.getSpecMan().getPhysicalNode("bar"));
    assertEquals(null, master.getSpecMan().getPhysicalNode("baz"));
View Full Code Here

    master.getSpecMan().addLogicalNode(local, "baz");
    master.getSpecMan().setConfig(local, "my-test-flow", "null", "null");
    master.getSpecMan().setConfig("bar", "my-test-flow", "null", "null");
    master.getSpecMan().setConfig("baz", "my-test-flow", "null", "null");

    LivenessManager liveMan = node.getLivenessManager();
    liveMan.heartbeatChecks();
    // liveMan.checkLogicalNodes();

    assertEquals(local, master.getSpecMan().getPhysicalNode("bar"));
    assertEquals(local, master.getSpecMan().getPhysicalNode("baz"));
    assertEquals(local, master.getSpecMan().getPhysicalNode(local));
    assertNotNull(master.getSpecMan().getConfig("bar"));
    assertNotNull(master.getSpecMan().getConfig("baz"));
    assertNotNull(master.getSpecMan().getConfig(local));

    master.getSpecMan().removeLogicalNode("bar");
    liveMan.heartbeatChecks();
    // liveMan.checkLogicalNodes();
    assertEquals(null, master.getSpecMan().getPhysicalNode("bar"));
    assertEquals(local, master.getSpecMan().getPhysicalNode("baz"));
    assertEquals(local, master.getSpecMan().getPhysicalNode(local));
    assertNull(master.getSpecMan().getConfig("bar"));
    assertNotNull(master.getSpecMan().getConfig("baz"));
    assertNotNull(master.getSpecMan().getConfig(local));

    master.getSpecMan().removeLogicalNode("baz");
    liveMan.heartbeatChecks();
    // liveMan.checkLogicalNodes();
    assertEquals(null, master.getSpecMan().getPhysicalNode("bar"));
    assertEquals(null, master.getSpecMan().getPhysicalNode("baz"));
    assertEquals(local, master.getSpecMan().getPhysicalNode(local));
    assertNull(master.getSpecMan().getConfig("bar"));
    assertNull(master.getSpecMan().getConfig("baz"));
    assertNotNull(master.getSpecMan().getConfig(local));

    master.getSpecMan().removeLogicalNode(local);
    liveMan.heartbeatChecks();
    // liveMan.checkLogicalNodes();
    assertNull(master.getSpecMan().getConfig("bar"));
    assertNull(master.getSpecMan().getConfig("baz"));
    assertNull(master.getSpecMan().getConfig(local));
    assertEquals(null, master.getSpecMan().getPhysicalNode("bar"));
View Full Code Here

    assertEquals(0, node.getLogicalNodeManager().getNodes().size());

    final CountDownLatch done = new CountDownLatch(1);
    new Thread("ActiveDFOClose") {
      public void run() {
        LivenessManager liveMan = node.getLivenessManager();
        try {
          // update config node to something that will be interrupted.
          LOG.info("setting to invalid dfo host");
          master.getSpecMan().setConfig("node1", "flow", "asciisynth(0)",
              "agentDFOSink(\"localhost\", 12345)");
          master.getSpecMan().addLogicalNode(NetUtils.localhost(), "node1");
          liveMan.heartbeatChecks();
          Thread.sleep(10000);

          // update config node to something that will be interrupted.
          LOG.info("!!! decommissioning node on master");
          master.getSpecMan().removeLogicalNode("node1");

          // as node do heartbeat and update due to decommission
          liveMan.heartbeatChecks();
          LOG.info("!!! node should be decommissioning on node");

        } catch (Exception e) {
          LOG.info("closed caused an error out: " + e.getMessage(), e);
          // Right now it takes about 10 seconds for the dfo deco to error out.
View Full Code Here

TOP

Related Classes of com.cloudera.flume.agent.LivenessManager

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.