Package com.cloudera.flume.util

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


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

    // 0 // this never registers!
    m.forward(501);

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


    // 0 // this never registers!
    m.forward(501);

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

    r.append(e);

    long[] times = { 0, 501, 1002, 1503, 2004 };
    long[] ans = { 3, 2, 4, 0, 1 };
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

    rptMan.add(reportable);

    reportPusher.start();

    // Trigger the report pusher
    mockClock.forward(FlumeConfiguration.get().getReporterPollPeriod() * 2);

    // Wait for 'real' 5s delay for report pusher to a) get on a CPU and b) do
    // the push
    assertTrue("putReports not called within 5 seconds", latch.await(5,
        TimeUnit.SECONDS));
View Full Code Here

    System.out.printf("pri: %4d sec: %4d fail: %4d\n", primary.getCount(),
        secondary.getCount(), failsink.getFails());
    Assert.assertEquals(2, primary.getCount());
    Assert.assertEquals(0, secondary.getCount());

    mock.forward(100);
    twiddle.setAppendOk(false); // go to fail over.
    failsink.append(e); // primary fails and automatically go to 2ndary
    System.out.println(mock);
    System.out.printf("pri: %4d sec: %4d fail: %4d\n", primary.getCount(),
        secondary.getCount(), failsink.getFails());
View Full Code Here

        secondary.getCount(), failsink.getFails());
    Assert.assertEquals(1, failsink.getFails()); // one attempt on primary failed.
    Assert.assertEquals(2, primary.getCount()); // same as before,
    Assert.assertEquals(1, secondary.getCount()); // message went to the secondary

    mock.forward(50);
    failsink.append(e); // skip primary and just go to 2ndary
    System.out.println(mock);
    System.out.printf("pri: %4d sec: %4d fail: %4d\n", primary.getCount(),
        secondary.getCount(), failsink.getFails());
    Assert.assertEquals(1, failsink.getFails()); // still only one attempt on primary
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.