Package com.cloudera.flume.agent

Examples of com.cloudera.flume.agent.LivenessManager


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

    final CountDownLatch done = new CountDownLatch(1);
    new Thread() {
      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(\"invalid\", 12345)");
          master.getSpecMan().addLogicalNode(NetUtils.localhost(), "node1");
          liveMan.heartbeatChecks();
          Thread.sleep(20000); // Takes 10s for dns to fail

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

        } catch (Exception e) {
          LOG.error("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


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

    final CountDownLatch done = new CountDownLatch(1);
    new Thread("TestDiskFailoverAgent") {
      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)",
              "agentE2ESink(\"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");
          liveMan.heartbeatChecks();
          LOG.info("!!! node should be decommissioning on node");

        } catch (Exception e) {
          LOG.error("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

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

    final CountDownLatch done = new CountDownLatch(1);
    new Thread() {
      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)",
              "agentE2ESink(\"localhost\", 12345)");
          master.getSpecMan().addLogicalNode(NetUtils.localhost(), "node1");
          liveMan.heartbeatChecks();
          Thread.sleep(15000); // Takes 10s for dns to fail

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

        } catch (Exception e) {
          LOG.error("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

    walMan = (walMan != null) ? walMan : new NaiveFileWALManager(new File(conf
        .getAgentLogsDir()));
    dfMan = (dfMan != null) ? dfMan : new NaiveFileFailoverManager(new File(
        conf.getAgentLogsDir()));
    colAck = (colAck != null) ? colAck : new CollectorAckListener(mock);
    liveman = (liveman != null) ? liveman : new LivenessManager(nodesMan, mock,
        walMan);

    node = new FlumeNode(NetUtils.localhost(), mock, nodesMan, walMan, dfMan,
        colAck, liveman);
  }
View Full Code Here

    walMan = (walMan != null) ? walMan : new NaiveFileWALManager(new File(conf
        .getAgentLogsDir()));
    dfMan = (dfMan != null) ? dfMan : new NaiveFileFailoverManager(new File(
        conf.getAgentLogsDir()));
    colAck = (colAck != null) ? colAck : new CollectorAckListener(mock);
    liveman = (liveman != null) ? liveman : new LivenessManager(nodesMan, mock,
        walMan);

    node = new FlumeNode(NetUtils.localhost(), mock, nodesMan, walMan, dfMan,
        colAck, liveman);
  }
View Full Code Here

    MasterRPC rpc = new DirectMasterRPC(master);

    final FlumeNode node = new FlumeNode(rpc, false, false);
    // should have nothing.
    assertEquals(0, node.getLogicalNodeManager().getNodes().size());
    LivenessManager liveMan = node.getLivenessManager();
    // update config node to something that will be interrupted.
    LOG.info("setting to invalid dfo host");
    master.getSpecMan().setConfig(lnode, "flow", "asciisynth(0)",
        "agentDFOSink(\"localhost\", 12345)");
    master.getSpecMan().addLogicalNode(NetUtils.localhost(), lnode);
    liveMan.heartbeatChecks();

    LogicalNode n = node.getLogicalNodeManager().get(lnode);
    Driver d = n.getDriver();
    assertTrue("Attempting to start driver timed out",
        d.waitForAtLeastState(DriverState.ACTIVE, 10000));

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

    // as node do heartbeat and update due to decommission
    liveMan.heartbeatChecks();
    LOG.info("!!! node should be decommissioning on node");
    assertTrue("Attempting to decommission driver timed out",
        d.waitForAtLeastState(DriverState.IDLE, 10000));

    assertEquals("Only expected default logical node", 1, node
View Full Code Here

    MasterRPC rpc = new DirectMasterRPC(master);

    final FlumeNode node = new FlumeNode(rpc, false, false);
    // should have nothing.
    assertEquals(0, node.getLogicalNodeManager().getNodes().size());
    LivenessManager liveMan = node.getLivenessManager();
    // update config node to something that will be interrupted.
    LOG.info("setting to invalid dfo host");
    master.getSpecMan().setConfig("node2", "flow", "asciisynth(0)",
        "agentDFOSink(\"invalid\", 12346)");
    master.getSpecMan().addLogicalNode(NetUtils.localhost(), lnode);
    liveMan.heartbeatChecks();

    LogicalNode n = node.getLogicalNodeManager().get(lnode);
    Driver d = n.getDriver();
    assertTrue("Attempting to start driver timed out",
        d.waitForAtLeastState(DriverState.ACTIVE, 20000));

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

    liveMan.heartbeatChecks();
    LOG.info("!!! logical node should be decommissioning on node");
    assertTrue("Attempting to start driver timed out",
        d.waitForAtLeastState(DriverState.IDLE, 20000));
    LOG.info("Clean close.");
View Full Code Here

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

    LivenessManager liveMan = node.getLivenessManager();
    // update config node to something that will be interrupted.
    LOG.info("setting to invalid e2e host");
    master.getSpecMan().setConfig(lnode, "flow", "asciisynth(0)",
        "agentE2ESink(\"localhost\", 12347)");
    master.getSpecMan().addLogicalNode(NetUtils.localhost(), lnode);
    liveMan.heartbeatChecks();

    // TODO It we only wait for opening state, this test can hang
    LogicalNode n = node.getLogicalNodeManager().get(lnode);
    Driver d = n.getDriver();
    assertTrue("Attempting to start driver timed out",
        d.waitForAtLeastState(DriverState.ACTIVE, 10000));

    // update config node to something that will be interrupted.
    LOG.info("!!! decommissioning node on master");
    master.getSpecMan().removeLogicalNode(lnode);
    liveMan.heartbeatChecks();
    assertTrue("Attempting to stop driver timed out",
        d.waitForAtLeastState(DriverState.ERROR, 15000));
  }
View Full Code Here

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

    LivenessManager liveMan = node.getLivenessManager();
    // update config node to something that will be interrupted.
    LOG.info("setting to invalid e2e host");
    master.getSpecMan().setConfig(lnode, "flow", "asciisynth(0)",
        "agentE2ESink(\"localhost\", 12348)");
    master.getSpecMan().addLogicalNode(NetUtils.localhost(), lnode);
    liveMan.heartbeatChecks();

    // TODO It we only wait for opening state, this test can hang
    LogicalNode n = node.getLogicalNodeManager().get(lnode);
    Driver d = n.getDriver();
    assertTrue("Attempting to start driver timed out",
        d.waitForAtLeastState(DriverState.ACTIVE, 15000));

    // update config node to something that will be interrupted.
    LOG.info("!!! decommissioning node on master");
    master.getSpecMan().removeLogicalNode(lnode);
    liveMan.heartbeatChecks();
    assertTrue("Attempting to stop driver timed out",
        d.waitForAtLeastState(DriverState.ERROR, 15000));
  }
View Full Code Here

    walMan = (walMan != null) ? walMan : new NaiveFileWALManager(new File(conf
        .getAgentLogsDir()));
    dfMan = (dfMan != null) ? dfMan : new NaiveFileFailoverManager(new File(
        conf.getAgentLogsDir()));
    colAck = (colAck != null) ? colAck : new CollectorAckListener(mock);
    liveman = (liveman != null) ? liveman : new LivenessManager(nodesMan, mock,
        walMan);

    node = new FlumeNode(NetUtils.localhost(), mock, nodesMan, walMan, dfMan,
        colAck, liveman);
  }
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.