/** * Start a backup node daemon. */ private void runCheckpointDaemon(Configuration conf) throws IOException { checkpointManager = new Checkpointer(conf, this); checkpointManager.start(); }
shouldCheckpoint = true; } else { long txns = countUncheckpointedTxns(); if(txns >= checkpointConf.getTxnCount()) shouldCheckpoint = true; doCheckpoint(); lastCheckpointTime = now; } catch(Throwable e) { LOG.error("Throwable Exception in doCheckpoint: ", e); shutdown(); break;
private long countUncheckpointedTxns() throws IOException { long curTxId = getRemoteNamenodeProxy().getTransactionID(); long uncheckpointedTxns = curTxId - getFSImage().getStorage().getMostRecentCheckpointTxId(); assert uncheckpointedTxns >= 0; return uncheckpointedTxns; }
/** * Create a connection to the primary namenode. */ Checkpointer(Configuration conf, BackupNode bnNode) throws IOException { this.conf = conf; this.backupNode = bnNode; try { initialize(conf); } catch(IOException e) { LOG.warn("Checkpointer got exception", e); shutdown(); throw e; } }
BackupImage bnImage = getFSImage(); NNStorage bnStorage = bnImage.getStorage(); getRemoteNamenodeProxy().startCheckpoint(backupNode.getRegistration()); CheckpointCommand cpCmd = null; switch(cmd.getAction()) { case NamenodeProtocol.ACT_SHUTDOWN: shutdown(); throw new IOException("Name-node " + backupNode.nnRpcAddress + " requested shutdown."); LOG.debug("Doing checkpoint. Last applied: " + lastApplied); RemoteEditLogManifest manifest = getRemoteNamenodeProxy().getEditLogManifest(bnImage.getLastAppliedTxId() + 1); bnImage.reloadFromImageFile(file, backupNode.getNamesystem()); rollForwardByApplyingLogs(manifest, bnImage, backupNode.getNamesystem()); getRemoteNamenodeProxy().endCheckpoint(backupNode.getRegistration(), sig);
/** * Checkpoint.<br> * Tests may use it to initiate a checkpoint process. * @throws IOException */ void doCheckpoint() throws IOException { checkpointManager.doCheckpoint(); }
Checkpointer.rollForwardByApplyingLogs(manifest, dstImage, dstNamesystem);
checkpointManager.interrupt(); checkpointManager = null;
BackupImage bnImage = getFSImage(); NNStorage bnStorage = bnImage.getStorage(); getRemoteNamenodeProxy().startCheckpoint(backupNode.getRegistration()); CheckpointCommand cpCmd = null; switch(cmd.getAction()) { case NamenodeProtocol.ACT_SHUTDOWN: shutdown(); throw new IOException("Name-node " + backupNode.nnRpcAddress + " requested shutdown."); LOG.debug("Doing checkpoint. Last applied: " + lastApplied); RemoteEditLogManifest manifest = getRemoteNamenodeProxy().getEditLogManifest(bnImage.getLastAppliedTxId() + 1); bnImage.reloadFromImageFile(file, backupNode.getNamesystem()); rollForwardByApplyingLogs(manifest, bnImage, backupNode.getNamesystem()); getRemoteNamenodeProxy().endCheckpoint(backupNode.getRegistration(), sig);
/** * Create a connection to the primary namenode. */ Checkpointer(Configuration conf, BackupNode bnNode) throws IOException { this.conf = conf; this.backupNode = bnNode; try { initialize(conf); } catch(IOException e) { LOG.warn("Checkpointer got exception", e); shutdown(); throw e; } }
/** * Checkpoint.<br> * Tests may use it to initiate a checkpoint process. * @throws IOException */ void doCheckpoint() throws IOException { checkpointManager.doCheckpoint(); }
Checkpointer.rollForwardByApplyingLogs(manifest, dstImage, dstNamesystem);
checkpointManager.interrupt(); checkpointManager = null;
BackupImage bnImage = getFSImage(); NNStorage bnStorage = bnImage.getStorage(); getRemoteNamenodeProxy().startCheckpoint(backupNode.getRegistration()); CheckpointCommand cpCmd = null; switch(cmd.getAction()) { case NamenodeProtocol.ACT_SHUTDOWN: shutdown(); throw new IOException("Name-node " + backupNode.nnRpcAddress + " requested shutdown."); LOG.debug("Doing checkpoint. Last applied: " + lastApplied); RemoteEditLogManifest manifest = getRemoteNamenodeProxy().getEditLogManifest(bnImage.getLastAppliedTxId() + 1); bnImage.reloadFromImageFile(file, backupNode.getNamesystem()); rollForwardByApplyingLogs(manifest, bnImage, backupNode.getNamesystem()); getRemoteNamenodeProxy().endCheckpoint(backupNode.getRegistration(), sig);
shouldCheckpoint = true; } else { long txns = countUncheckpointedTxns(); if(txns >= checkpointConf.getTxnCount()) shouldCheckpoint = true; doCheckpoint(); lastCheckpointTime = now; } catch(Throwable e) { LOG.error("Throwable Exception in doCheckpoint: ", e); shutdown(); break;
private long countUncheckpointedTxns() throws IOException { long curTxId = getRemoteNamenodeProxy().getTransactionID(); long uncheckpointedTxns = curTxId - getFSImage().getStorage().getMostRecentCheckpointTxId(); assert uncheckpointedTxns >= 0; return uncheckpointedTxns; }
/** * Start a backup node daemon. */ private void runCheckpointDaemon(Configuration conf) throws IOException { checkpointManager = new Checkpointer(conf, this); checkpointManager.start(); }
/** * Create a connection to the primary namenode. */ Checkpointer(Configuration conf, BackupNode bnNode) throws IOException { this.conf = conf; this.backupNode = bnNode; try { initialize(conf); } catch(IOException e) { LOG.warn("Checkpointer got exception", e); shutdown(); throw e; } }
/** * Checkpoint.<br> * Tests may use it to initiate a checkpoint process. * @throws IOException */ void doCheckpoint() throws IOException { checkpointManager.doCheckpoint(); }
Checkpointer.rollForwardByApplyingLogs(manifest, dstImage, dstNamesystem);