Examples of Checkpoint


Examples of com.linkedin.databus.core.Checkpoint

  /** Test bootstrap transition: Target_Scn_Success : Happy Path */
  public void testTransition_TargetScnSuccessHappyPath() throws Exception
  {
    BootstrapPullThread bsPuller = createBootstrapPullThread(false, false, false, false, false, null, 12000, 1, true);

    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);

    bsPuller.getMessageQueue().clear();
    testTransitionCase(bsPuller, StateId.REQUEST_START_SCN, StateId.START_SCN_RESPONSE_SUCCESS, null);
    bsPuller.getMessageQueue().clear();
    Map<Long, List<RegisterResponseEntry>> entries = new HashMap<Long, List<RegisterResponseEntry>>();

    entries.put(1L, new ArrayList<RegisterResponseEntry>());
    connState.setSourcesSchemas(entries);

    testTransitionCase(bsPuller, StateId.START_SCN_RESPONSE_SUCCESS, StateId.REQUEST_STREAM, null);
    bsPuller.getMessageQueue().clear();

    connState.getSourcesNameMap().put("source1", new IdNamePair(1L, "source1"));
    connState.getSourceIdMap().put(1L, new IdNamePair(1L, "source1"));
    testTransitionCase(bsPuller, StateId.REQUEST_STREAM, StateId.STREAM_REQUEST_SUCCESS, null);

    bsPuller.getMessageQueue().clear();
    testTransitionCase(bsPuller, StateId.STREAM_REQUEST_SUCCESS, StateId.STREAM_RESPONSE_DONE, null);

    bsPuller.getMessageQueue().clear();
    cp.setSnapshotOffset(-1);
    testTransitionCase(bsPuller, StateId.STREAM_RESPONSE_DONE, StateId.REQUEST_TARGET_SCN, null);
    Assert.assertEquals(cp.getConsumptionMode(), DbusClientMode.BOOTSTRAP_SNAPSHOT, "Consumption Mode check");
    Assert.assertFalse(cp.isBootstrapTargetScnSet());

    bsPuller.getMessageQueue().clear();
    testTransitionCase(bsPuller, StateId.REQUEST_TARGET_SCN, StateId.TARGET_SCN_RESPONSE_SUCCESS, null);

    bsPuller.getMessageQueue().clear();
    entries = new HashMap<Long, List<RegisterResponseEntry>>();

    entries.put(1L, new ArrayList<RegisterResponseEntry>());
    connState.setSourcesSchemas(entries);

    testTransitionCase(bsPuller, StateId.TARGET_SCN_RESPONSE_SUCCESS, StateId.REQUEST_STREAM, null);
    Assert.assertEquals(cp.getConsumptionMode(), DbusClientMode.BOOTSTRAP_CATCHUP, "Consumption Mode check");
    Assert.assertTrue(cp.isBootstrapTargetScnSet());
    Assert.assertEquals(cp.getBootstrapTargetScn().longValue(), 10L);
    Assert.assertEquals(cp.getWindowScn(), cp.getBootstrapStartScn().longValue());
    Assert.assertEquals(cp.getWindowOffset().longValue(), 0L);
  }
View Full Code Here

Examples of com.linkedin.databus.core.Checkpoint

  {
    // targetScn = 50 < 100 = startScn
    BootstrapPullThread bsPuller = createBootstrapPullThread(false, false, false, false, false, null, 12000, 1, true,
                                                             100, 50);

    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);

    bsPuller.getMessageQueue().clear();
    testTransitionCase(bsPuller, StateId.REQUEST_START_SCN, StateId.START_SCN_RESPONSE_SUCCESS, null);
    bsPuller.getMessageQueue().clear();
    Map<Long, List<RegisterResponseEntry>> entries = new HashMap<Long, List<RegisterResponseEntry>>();

    entries.put(1L, new ArrayList<RegisterResponseEntry>());
    connState.setSourcesSchemas(entries);

    testTransitionCase(bsPuller, StateId.START_SCN_RESPONSE_SUCCESS, StateId.REQUEST_STREAM, null);
    bsPuller.getMessageQueue().clear();

    connState.getSourcesNameMap().put("source1", new IdNamePair(1L, "source1"));
    connState.getSourceIdMap().put(1L, new IdNamePair(1L, "source1"));
    testTransitionCase(bsPuller, StateId.REQUEST_STREAM, StateId.STREAM_REQUEST_SUCCESS, null);

    bsPuller.getMessageQueue().clear();
    testTransitionCase(bsPuller, StateId.STREAM_REQUEST_SUCCESS, StateId.STREAM_RESPONSE_DONE, null);

    bsPuller.getMessageQueue().clear();
    cp.setSnapshotOffset(-1);
    testTransitionCase(bsPuller, StateId.STREAM_RESPONSE_DONE, StateId.REQUEST_TARGET_SCN, null);
    Assert.assertEquals(cp.getConsumptionMode(), DbusClientMode.BOOTSTRAP_SNAPSHOT, "Consumption Mode check");
    Assert.assertFalse(cp.isBootstrapTargetScnSet());

    bsPuller.getMessageQueue().clear();
//    testTransitionCase(bsPuller, StateId.REQUEST_TARGET_SCN, StateId.TARGET_SCN_RESPONSE_SUCCESS, null);
    testTransitionCase(bsPuller, StateId.REQUEST_TARGET_SCN, StateId.TARGET_SCN_RESPONSE_ERROR, null);

    bsPuller.getMessageQueue().clear();
    testTransitionCase(bsPuller, StateId.TARGET_SCN_RESPONSE_ERROR, StateId.PICK_SERVER, null);
    Assert.assertEquals(cp.getConsumptionMode(), DbusClientMode.BOOTSTRAP_SNAPSHOT, "Consumption Mode check");
    Assert.assertFalse(cp.isBootstrapTargetScnSet());
    Assert.assertEquals(cp.getBootstrapTargetScn().longValue(), Checkpoint.UNSET_BOOTSTRAP_TARGET_SCN);

  }
View Full Code Here

Examples of com.persistit.CheckpointManager.Checkpoint

        if (_closed.get() || !_initialized.get()) {
            return null;
        }
        cleanup();
        _journalManager.pruneObsoleteTransactions();
        final Checkpoint result = _checkpointManager.checkpoint();
        _journalManager.pruneObsoleteTransactions();
        return result;
    }
View Full Code Here

Examples of com.pointcliki.dizgruntled.logic.Checkpoint

    } else if (logic.equals("ExitTrigger")) {
      l = new Fort();
    } else if (logic.equals("FortressFlag")) {
      l = new FortressFlag();
    } else if (logic.equals("CheckpointTrigger")) {
      l = new Checkpoint();
    } else if (logic.equals("InGameText")) {
      l = new HelpBook();
    } else if (logic.equals("GruntPuddle")) {
      l = new GruntPuddle();
    } else if (logic.equals("GruntCreationPoint")) {
View Full Code Here

Examples of com.sun.grid.jgdi.configuration.Checkpoint


                try {

                    // Create a new checkpoint object which intialized with default values
                    Checkpoint ckpt = ConfigurationFactory.createCheckpointWithDefaults();
                    ckpt.setName("sample");
                    ckpt.setCkptCommand("/usr/bin/ckpt");
                    ckpt.setCkptDir("/tmp");

                    jgdi.addCheckpoint(ckpt);
                    try {
                        System.out.println("Checkpoint " + ckpt.getName() + " successfully added");
                        ckpt = jgdi.getCheckpoint(ckpt.getName());
                        ckpt.setRestCommand("/tmp/blubber");
                        jgdi.updateCheckpoint(ckpt);
                        System.out.println("Checkpoint " + ckpt.getName() + " successfully modified");
                    } finally {
                        jgdi.deleteCheckpoint(ckpt);
                        System.out.println("Checkpoint " + ckpt.getName() + " successfully deleted");
                    }

                    Thread.sleep(60000);
                } finally {
                    evc.close();
View Full Code Here

Examples of fr.imag.adele.apam.pax.test.performance.util.Checkpoint

     
      fibonacci.callsInit(0);
     
      for (int i = 0; i <= SIZE; i++) {
       
        Checkpoint p1 = new Checkpoint();

        int value = fibonacci.compute(i);

        Checkpoint p2 = new Checkpoint();

        MeasureHolder holder = Measure.time(p1, p2);

        System.err.println(String.format("%d\t%d\t%s\t%s\t%d", i,
            value, holder.usedMemory(), holder.asMili(),
View Full Code Here

Examples of org.agilewiki.jfile.transactions.db.Checkpoint

                Eval eval = new Eval(block.getTimestamp());
                if (generateCheckpoints) {
                    RP evalrp = new RP() {
                        @Override
                        public void processResponse(Object response) throws Exception {
                            Checkpoint checkpoint = new Checkpoint(
                                    block.getCurrentPosition(),
                                    block.getTimestamp(), block.getFileName());
                            checkpoint.send(TransactionProcessor.this, getParent(), rp);
                        }
                    };
                    eval.send(TransactionProcessor.this, evaluator, evalrp);
                } else {
                    eval.send(TransactionProcessor.this, evaluator, rp);
View Full Code Here

Examples of org.apache.jackrabbit.jcr2spi.operation.Checkpoint

        Operation co = Checkout.create(nodeState, this);
        workspaceManager.execute(co);
    }

    public NodeEntry checkpoint(NodeState nodeState) throws RepositoryException {
        Checkpoint cp = Checkpoint.create(nodeState, this);
        workspaceManager.execute(cp);
        return workspaceManager.getHierarchyManager().getNodeEntry(cp.getNewVersionId());
    }
View Full Code Here

Examples of org.archive.checkpointing.Checkpoint

        return Checkpoint.class.isAssignableFrom(cls);
    }

    @Override
    public void validate(Object target, Errors errors) {
        Checkpoint cp = ((CheckpointService)target).getRecoveryCheckpoint();
        if(cp==null) {
            return;
        }
        if(!Checkpoint.hasValidStamp(cp.getCheckpointDir().getFile())) {
            errors.rejectValue(
                "recoveryCheckpoint.checkpointDir",
                null,
                "Configured recovery checkpoint "+cp.getName()
                +" incomplete: lacks valid stamp file.");
        }
    }
View Full Code Here

Examples of org.exist.storage.txn.Checkpoint

     * @param switchLogFiles
     * @throws TransactionException
     */
    public void checkpoint(long txnId, boolean switchLogFiles) throws TransactionException {
        LOG.debug("Checkpoint reached");
        writeToLog(new Checkpoint(txnId));
        if (switchLogFiles)
            // if we switch files, we don't need to sync.
            // the file will be removed anyway.
            {flushBuffer();}
        else
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.