Package com.cloudera.flume.util

Examples of com.cloudera.flume.util.MockClock.forward()


        "physnode", "foo", NodeState.HELLO, 0);
    LOG.info(stats.getNodeStatuses());
    assertTrue(needsRefresh);

    // move forward in time, but not far enough to trigger being lost
    clk.forward(FlumeConfiguration.get().getConfigHeartbeatPeriod() * 5);
    stats.checkup();
    StatusManager.NodeStatus ns = stats.getNodeStatuses().get("foo");
    assertEquals(0, ns.version);
    assertTrue(prev <= ns.lastseen);
    assertEquals(NodeState.HELLO, ns.state);
View Full Code Here


    assertEquals(0, ns.version);
    assertTrue(prev <= ns.lastseen);
    assertEquals(NodeState.HELLO, ns.state);
    prev = ns.lastseen;

    clk.forward(FlumeConfiguration.get().getConfigHeartbeatPeriod() * 20);
    stats.checkup();
    ns = stats.getNodeStatuses().get("foo");
    assertEquals(0, ns.version);
    assertTrue(prev <= ns.lastseen);
    assertEquals(NodeState.LOST, ns.state);
View Full Code Here

      }

      @Override
      public void open() throws IOException {
        // Forward by 100ms, should cause IOD to try eleven times then give up
        m.forward(100);
        throw new IOException("fail open");
      }
    };

    Clock.setClock(m);
View Full Code Here

                                                                          // time
                                                                          // 0
    long cfgtime = Clock.unixTime();
    boolean changed1, changed2, changed3, changed4;

    mclk.forward(250);

    // make the first stamp in the "past" to force an update
    changed1 = delegate.heartbeat("foo", "foo", NetUtils.localhost(),
        StatusManager.NodeState.HELLO, cfgtime); // new
    // node
View Full Code Here

    // make the first stamp in the "past" to force an update
    changed1 = delegate.heartbeat("foo", "foo", NetUtils.localhost(),
        StatusManager.NodeState.HELLO, cfgtime); // new
    // node
    assertTrue(changed1);
    mclk.forward(500);

    changed2 = delegate.heartbeat("foo", "foo", NetUtils.localhost(),
        StatusManager.NodeState.HELLO, cfgtime);
    assertFalse(changed2);
View Full Code Here

    master.getSpecMan().setConfig("foo", "my-test-flow", "null", "null");
    long oldcfgtime = cfgtime;
    cfgtime = Clock.unixTime();

    mclk.forward(500);

    // "check with the last version we had"

    changed3 = delegate.heartbeat("foo", "foo", NetUtils.localhost(),
        StatusManager.NodeState.HELLO, oldcfgtime);
View Full Code Here

    // "check with the last version we had"

    changed3 = delegate.heartbeat("foo", "foo", NetUtils.localhost(),
        StatusManager.NodeState.HELLO, oldcfgtime);
    assertTrue(changed3);
    mclk.forward(500);

    // "ok, we did a config update on the node"

    changed4 = delegate.heartbeat("foo", "foo", NetUtils.localhost(),
        StatusManager.NodeState.HELLO, cfgtime);
View Full Code Here

    // "ok, we did a config update on the node"

    changed4 = delegate.heartbeat("foo", "foo", NetUtils.localhost(),
        StatusManager.NodeState.HELLO, cfgtime);
    assertFalse(changed4);
    mclk.forward(500);

    mas.getNodeStatuses();

    // calls
    mas.getConfigs();
View Full Code Here

    // just a little forward to make things slighlty "out of sync"
    // 3
    r.append(e);
    r.append(e);
    r.append(e);
    m.forward(501);

    // 2
    r.append(e);
    r.append(e);
    m.forward(501);
View Full Code Here

    m.forward(501);

    // 2
    r.append(e);
    r.append(e);
    m.forward(501);

    // 4
    r.append(e);
    r.append(e);
    r.append(e);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.