/** * Increment number of safe blocks if current block has * reached minimal replication. * @param replication current replication */ private synchronized void incrementSafeBlockCount(short replication) { if (replication == safeReplication) { this.blockSafe++; // Report startup progress only if we haven't completed startup yet. StartupProgress prog = NameNode.getStartupProgress(); if (prog.getStatus(Phase.SAFEMODE) != Status.COMPLETE) { if (this.awaitingReportedBlocksCounter == null) { this.awaitingReportedBlocksCounter = prog.getCounter(Phase.SAFEMODE, STEP_AWAITING_REPORTED_BLOCKS); } this.awaitingReportedBlocksCounter.increment(); } checkMode(); } }
/** * Increment number of safe blocks if current block has * reached minimal replication. * @param replication current replication */ private synchronized void incrementSafeBlockCount(short replication) { if (replication == safeReplication) { this.blockSafe++; // Report startup progress only if we haven't completed startup yet. StartupProgress prog = NameNode.getStartupProgress(); if (prog.getStatus(Phase.SAFEMODE) != Status.COMPLETE) { if (this.awaitingReportedBlocksCounter == null) { this.awaitingReportedBlocksCounter = prog.getCounter(Phase.SAFEMODE, STEP_AWAITING_REPORTED_BLOCKS); } this.awaitingReportedBlocksCounter.increment(); } checkMode(); } }
/** * Set total number of blocks. */ private synchronized void setBlockTotal(int total) { this.blockTotal = total; this.blockThreshold = (int) (blockTotal * threshold); this.blockReplQueueThreshold = (int) (blockTotal * replQueueThreshold); if (haEnabled) { // After we initialize the block count, any further namespace // modifications done while in safe mode need to keep track // of the number of total blocks in the system. this.shouldIncrementallyTrackBlocks = true; } if(blockSafe < 0) this.blockSafe = 0; checkMode(); }
/** * Set total number of blocks. */ private synchronized void setBlockTotal(int total) { this.blockTotal = total; this.blockThreshold = (int) (blockTotal * threshold); this.blockReplQueueThreshold = (int) (blockTotal * replQueueThreshold); if (haEnabled) { // After we initialize the block count, any further namespace // modifications done while in safe mode need to keep track // of the number of total blocks in the system. this.shouldIncrementallyTrackBlocks = true; } if(blockSafe < 0) this.blockSafe = 0; checkMode(); }
/** * Decrement number of safe blocks if current block has * fallen below minimal replication. * @param replication current replication */ private synchronized void decrementSafeBlockCount(short replication) { if (replication == safeReplication-1) { this.blockSafe--; //blockSafe is set to -1 in manual / low resources safemode assert blockSafe >= 0 || isManual() || areResourcesLow(); checkMode(); } }
/** * Decrement number of safe blocks if current block has * fallen below minimal replication. * @param replication current replication */ synchronized void decrementSafeBlockCount(short replication) { if (replication == safeReplication-1) this.blockSafe--; checkMode(); }
/** * Set total number of blocks. */ synchronized void setBlockTotal(int total) { this.blockTotal = total; checkMode(); }
/** * Decrement number of safe blocks if current block has * fallen below minimal replication. * @param replication current replication */ private synchronized void decrementSafeBlockCount(short replication) { if (replication == safeReplication-1) { this.blockSafe--; //blockSafe is set to -1 in manual / low resources safemode assert blockSafe >= 0 || isManual() || areResourcesLow(); checkMode(); } }
/** * Increment number of safe blocks if current block has * reached minimal replication. * @param replication current replication */ synchronized void incrementSafeBlockCount(short replication) { if ((int)replication == safeReplication) this.blockSafe++; checkMode(); }