Package org.archive.checkpointing

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


                    new Supplier<IdentityCacheableWrapper>(
                            new IdentityCacheableWrapper(key, value))).get();
            assertSame("unexpected prior entry",value,cached)
        }
       
        Checkpoint checkpointInProgress = new Checkpoint();
        ConfigPath checkpointsPath = new ConfigPath("checkpoints","checkpoints");
        checkpointsPath.setBase(basePath);
        checkpointInProgress.generateFrom(checkpointsPath,998);

        bdb.doCheckpoint(checkpointInProgress);
        String firstCheckpointName = checkpointInProgress.getName();
       
        for (int i2 = 1000; i2 < 2000; i2++) {
            String key = String.valueOf(i2);
            final String value = String.valueOf(randomFactor*i2);
            String cached = (String)testData.getOrUse(
                    key,
                    new Supplier<IdentityCacheableWrapper>(
                            new IdentityCacheableWrapper(key, value))).get();
            assertSame("unexpected prior entry",value,cached)
        }

        checkpointInProgress = new Checkpoint();
        checkpointInProgress.generateFrom(checkpointsPath,999);

        bdb.doCheckpoint(checkpointInProgress);
       
        bdb.stop();
        bdb.destroy();
       
        BdbModule bdb2 = new BdbModule();
        bdb2.setDir(bdbDir);
       
        Checkpoint recoveryCheckpoint = new Checkpoint();
        ConfigPath recoverPath = new ConfigPath("recover",firstCheckpointName);
        recoverPath.setBase(basePath);
        recoveryCheckpoint.setCheckpointDir(recoverPath);
        recoveryCheckpoint.afterPropertiesSet();
       
        bdb2.setRecoveryCheckpoint(recoveryCheckpoint);
       
        bdb2.start();
       
View Full Code Here

            actions.add("terminate");
        if (crawlJob.hasApplicationContext())
            actions.add("teardown");

        if (crawlJob.getCheckpointService() != null) {
            Checkpoint recoveryCheckpoint = crawlJob.getCheckpointService().getRecoveryCheckpoint();
            if (recoveryCheckpoint != null)
                this.put("checkpointName", recoveryCheckpoint.getName());
        }
       
        List<String> checkpointFiles = new ArrayList<String>();
        if (crawlJob.getCheckpointService() != null) {
            if (crawlJob.isLaunchable() && crawlJob.getCheckpointService().hasAvailableCheckpoints()) {
View Full Code Here

        Map<String,Checkpointable> toCheckpoint = appCtx.getBeansOfType(Checkpointable.class);
        if (LOGGER.isLoggable(Level.FINE)) {
            LOGGER.fine("checkpointing beans " + toCheckpoint);
        }
       
        checkpointInProgress = new Checkpoint();
        try {
            checkpointInProgress.setForgetAllButLatest(getForgetAllButLatest());
            checkpointInProgress.generateFrom(getCheckpointsDir(),
                    getNextCheckpointNumber());
View Full Code Here

     */
    public synchronized void setRecoveryCheckpointByName(String selectedCheckpoint) {
        if(isRunning) {
            throw new RuntimeException("may not set recovery Checkpoint after launch");
        }
        Checkpoint recoveryCheckpoint = new Checkpoint();
        recoveryCheckpoint.getCheckpointDir().setBase(getCheckpointsDir());
        recoveryCheckpoint.getCheckpointDir().setPath(selectedCheckpoint);
        recoveryCheckpoint.getCheckpointDir().setConfigurer(appCtx.getBean(ConfigPathConfigurer.class));
        recoveryCheckpoint.afterPropertiesSet();
        setRecoveryCheckpoint(recoveryCheckpoint);
        Map<String,Checkpointable> toSetRecovery = appCtx.getBeansOfType(Checkpointable.class);
       
        for(Checkpointable c : toSetRecovery.values()) {
            c.setRecoveryCheckpoint(recoveryCheckpoint);
View Full Code Here

TOP

Related Classes of org.archive.checkpointing.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.