Package com.linkedin.databus.core

Examples of com.linkedin.databus.core.Checkpoint


  /** Test BOOTSTRAP transition - Servers exhausted */
  public void testTransition_ServersExhausted() throws Exception
  {
    BootstrapPullThread bsPuller = createBootstrapPullThread(false, true, false);

    Checkpoint cp = _ckptHandlerSource1.createInitialBootstrapCheckpoint(null, 1L);

    bsPuller.getComponentStatus().start();
    ConnectionState connState = bsPuller.getConnectionState();
    connState.switchToBootstrap(cp);
    testTransitionCase(bsPuller, StateId.BOOTSTRAP, StateId.BOOTSTRAP, "SUSPEND_ON_ERROR", cp);
View Full Code Here


  /** Test Bootstrap transition: Connection Factory returned null with resumeCkpt startScn not set*/
  public void testTransition_ResumeCkptMissingStartScn() throws Exception
  {
    BootstrapPullThread bsPuller = createBootstrapPullThread(true, false, false);

    Checkpoint cp = _ckptHandlerTwoSources.createInitialBootstrapCheckpoint(null, 100L);

    bsPuller.getComponentStatus().start();
    ConnectionState connState = bsPuller.getConnectionState();
    connState.switchToBootstrap(cp);
    testTransitionCase(bsPuller, StateId.BOOTSTRAP, StateId.BOOTSTRAP, "SUSPEND_ON_ERROR", cp);
View Full Code Here

  /** Test Bootstrap transition: Connection Factory returned null with resumeCkpt startScn set*/
  public void testTransition_NullResumeCkptWithStartScn() throws Exception
  {
    BootstrapPullThread bsPuller = createBootstrapPullThread(true, false, false);

    Checkpoint cp = _ckptHandlerSource1.createInitialBootstrapCheckpoint(null, 50L);
    //TODO remove
    //cp.setConsumptionMode(DbusClientMode.BOOTSTRAP_SNAPSHOT);
    //cp.setBootstrapSinceScn(50L);
    cp.setBootstrapStartScn(100L);

    bsPuller.getComponentStatus().start();
    ConnectionState connState = bsPuller.getConnectionState();
    connState.switchToBootstrap(cp);
    testTransitionCase(bsPuller, StateId.BOOTSTRAP, StateId.BOOTSTRAP, "SUSPEND_ON_ERROR", cp);
View Full Code Here

  @Test
  /** Test bootstrap transition: Request_Start_Scn to Start_Scn_Sent */
  public void testTransition_RequestStartScnToStartScnSent() throws Exception
  {
    BootstrapPullThread bsPuller = createBootstrapPullThread(false, false, true);
    Checkpoint cp = _ckptHandlerSource1.createInitialBootstrapCheckpoint(null, 0L);

    bsPuller.getComponentStatus().start();
    ConnectionState connState = bsPuller.getConnectionState();
    connState.switchToBootstrap(cp);
    testTransitionCase(bsPuller, StateId.BOOTSTRAP, StateId.REQUEST_START_SCN, cp);
View Full Code Here

  @Test
  /** Test bootstrap transition: Request_StartSCN to StarSCN_Response_Success*/
  public void testTransition_RequestStartSCNToStartSCNResponseSuccess() throws Exception
  {
    BootstrapPullThread bsPuller = createBootstrapPullThread(false, false, false);
    Checkpoint cp = _ckptHandlerSource1.createInitialBootstrapCheckpoint(null, 0L);

    bsPuller.getComponentStatus().start();
    ConnectionState connState = bsPuller.getConnectionState();
    connState.switchToBootstrap(cp);
    testTransitionCase(bsPuller, StateId.BOOTSTRAP, StateId.REQUEST_START_SCN, cp);
View Full Code Here

  @Test
  /** Test bootstrap transition: StartSCN_Response_Success : Happy path */
  public void testTransition_StartScnResponseSuccessHappyPath() throws Exception
  {
    BootstrapPullThread bsPuller = createBootstrapPullThread(false, false, false);
    Checkpoint cp = _ckptHandlerTwoSources.createInitialBootstrapCheckpoint(null, 1000L);
    cp.setBootstrapServerInfo(_serverInfoName);

    bsPuller.getComponentStatus().start();
    ConnectionState connState = bsPuller.getConnectionState();
    connState.switchToBootstrap(cp);
    testTransitionCase(bsPuller, StateId.BOOTSTRAP, StateId.REQUEST_START_SCN, cp);
View Full Code Here

  @Test
  /** StartSCN_Response_Success : when ServerInfo does not match */
  public void testTransition_StartScnResponseSuccessSIMismatch() throws Exception
  {
    BootstrapPullThread bsPuller = createBootstrapPullThread(false, false, false);
    Checkpoint cp = _ckptHandlerSource1.createInitialBootstrapCheckpoint(null, 0L);
    cp.setBootstrapServerInfo("localhost" + ":" + 9999);

    bsPuller.getComponentStatus().start();
    ConnectionState connState = bsPuller.getConnectionState();
    connState.switchToBootstrap(cp);
    testTransitionCase(bsPuller, StateId.BOOTSTRAP, StateId.REQUEST_START_SCN, cp);
View Full Code Here

  @Test
  /** Test bootstrap transition: StartSCN_Response_Success : when no ServerInfo */
  public void testTransition_StartSCNResponseSuccessNoSI() throws Exception
  {
    BootstrapPullThread bsPuller = createBootstrapPullThread(false, false, false);
    Checkpoint cp = _ckptHandlerTwoSources.createInitialBootstrapCheckpoint(null, 0L);

    bsPuller.getComponentStatus().start();
    ConnectionState connState = bsPuller.getConnectionState();
    connState.switchToBootstrap(cp);
    testTransitionCase(bsPuller, StateId.BOOTSTRAP, StateId.REQUEST_START_SCN, cp);
View Full Code Here

  public void testTransition_StartSCNResponseSuccessErrorCase() throws Exception
  {
    BootstrapPullThread bsPuller = createBootstrapPullThread(false, false, false, false, false, null, 12000, 1, true,
                                                             -10, 50);

    Checkpoint cp = _ckptHandlerSource1.createInitialBootstrapCheckpoint(null, 0L);
    cp.setBootstrapServerInfo(_serverInfoName);

    bsPuller.getComponentStatus().start();
    ConnectionState connState = bsPuller.getConnectionState();
    connState.switchToBootstrap(cp);
    testTransitionCase(bsPuller, StateId.BOOTSTRAP, StateId.REQUEST_START_SCN, cp);

    bsPuller.getMessageQueue().clear();
    testTransitionCase(bsPuller, StateId.REQUEST_START_SCN, StateId.START_SCN_RESPONSE_ERROR, null);
    Assert.assertFalse(cp.isSnapShotSourceCompleted());
    Assert.assertEquals(cp.getBootstrapStartScn().longValue(), Checkpoint.UNSET_BOOTSTRAP_START_SCN);
    Assert.assertEquals(cp.getConsumptionMode(), DbusClientMode.BOOTSTRAP_SNAPSHOT);
  }
View Full Code Here

  /** Test bootstrap transition: Request_Stream when not enough space in the buffer */
  public void testTransition_RequestStreamFullBuffer() throws Exception
  {
    // available space is 10 which is less than the threshold of 10000
    BootstrapPullThread bsPuller = createBootstrapPullThread(false, false, false, 10, 1);
    Checkpoint cp = _ckptHandlerSource1.createInitialBootstrapCheckpoint(null, 0L);
    //TODO remove
    //cp.setSnapshotSource("source1");
    //cp.setCatchupSource("source1");
    //cp.setConsumptionMode(DbusClientMode.BOOTSTRAP_SNAPSHOT);
    cp.setBootstrapServerInfo(_serverInfoName);

    bsPuller.getComponentStatus().start();
    ConnectionState connState = bsPuller.getConnectionState();
    connState.switchToBootstrap(cp);
    testTransitionCase(bsPuller, StateId.BOOTSTRAP, StateId.REQUEST_START_SCN, cp);
View Full Code Here

TOP

Related Classes of com.linkedin.databus.core.Checkpoint

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.