Invalidates the given block on the given datanode.
439511
private void invalidateBlock(Block blk, DatanodeInfo dn, boolean ackRequired)
    throws IOException {
    NameNode.stateChangeLog.info("DIR* NameSystem.invalidateBlock: "
      + blk + " on "
      + dn.getName());
    DatanodeDescriptor node = getDatanode(dn);
    if (node == null) {
      throw new IOException("Cannot invalidate block " + blk +
        " because datanode " + dn.getName() +
        " does not exist.");
    }

    // Check how many copies we have of the block.  If we have at least one
    // copy on a live node, then we can delete it.
    int count = countNodes(blk).liveReplicas();
    if (count > 1) {
      // delete with ACK
      addToInvalidates(blk, dn, ackRequired);
      removeStoredBlock(blk, node);
      if (NameNode.stateChangeLog.isDebugEnabled()) {
        NameNode.stateChangeLog.debug("BLOCK* NameSystem.invalidateBlocks: "
          + blk + " on "
          + dn.getName() + " listed for deletion.");
      }
    } else {
      NameNode.stateChangeLog.info("BLOCK* NameSystem.invalidateBlocks: "
        + blk + " on "
        + dn.getName() + " is the only copy and was not deleted.");
    }
  }
758535
private void removeStoredBlock(Block block, DatanodeDescriptor node) {
    if (NameNode.stateChangeLog.isDebugEnabled()) {
      NameNode.stateChangeLog.debug("BLOCK* NameSystem.removeStoredBlock: "
        + block + " from " + node.getName());
    }
    if (!blocksMap.removeNode(block, node)) {
      if (NameNode.stateChangeLog.isDebugEnabled()) {
        NameNode.stateChangeLog.debug("BLOCK* NameSystem.removeStoredBlock: "
          + block + " has already been removed from node " + node);
      }
      return;
    }

    //
    // if file is being actively written to and it is the last block, 
    // then do not check replication-factor here.
    //
    BlockInfo storedBlock = blocksMap.getStoredBlock(block);
    INodeFile fileINode = (storedBlock == null) ? null : storedBlock.getINode();
    if (fileINode != null && 
        fileINode.isUnderConstruction() && fileINode.isLastBlock(storedBlock)) {
      decrementSafeBlockCount(block);
      return;
    }      

    //
    // It's possible that the block was removed because of a datanode
    // failure.  If the block is still valid, check if replication is
    // necessary.  In that case, put block on a possibly-will-
    // be-replicated list.
    //
    if (fileINode != null) {
      decrementSafeBlockCount(block);
      // handle under replication
      // Use storedBlock here because block maybe a deleted block with size DELETED
      if (isPopulatingReplQueuesInternal()) {
        NumberReplicas num = countNodes(storedBlock);
        int numCurrentReplicas = num.liveReplicas()
            +
        pendingReplications.getNumReplicas(storedBlock);
        updateNeededReplicationQueue(storedBlock, -1, numCurrentReplicas,
            num.decommissionedReplicas, node, 
            fileINode.getBlockReplication(storedBlock));
      }
    }

    //
    // We've removed a block from a node, so it's definitely no longer
    // in "excess" there.
    //
    removeFromExcessReplicateMap(block, node);

    // Remove the replica from corruptReplicas
    corruptReplicas.removeFromCorruptReplicasMap(block, node);
  }
40847
public final void invalidateNearCache(Data key) {
        if (!mapContainer.hasInvalidationListener() || key == null) {
            return;
        }

        Invalidator invalidator = getNearCacheInvalidator();
        invalidator.invalidateKey(key, name, getCallerUuid());
    }
189659
function processMaybeBlock(node, baseToken) {
            const firstToken = getFirstAndLastTokens(node).firstToken
            setOffsetToToken(
                firstToken,
                isLeftBrace(firstToken) ? 0 : 1,
                baseToken
            )
        }
422976
public void resizeTempBlockMeta(TempBlockMeta tempBlockMeta, long newSize)
      throws InvalidWorkerStateException {
    long oldSize = tempBlockMeta.getBlockSize();
    if (newSize > oldSize) {
      reserveSpace(newSize - oldSize, false);
      tempBlockMeta.setBlockSize(newSize);
    } else if (newSize < oldSize) {
      throw new InvalidWorkerStateException("Shrinking block, not supported!");
    }
  }
957454
public function validate(ErrorElement $errorElement, BlockInterface $block)
    {
        if (!$block->getId() && !$block->getType()) {
            return;
        }

        if ($this->inValidate) {
            return;
        }

        // As block can be nested, we only need to validate the main block, no the children
        try {
            $this->inValidate = true;
            $this->get($block)->validateBlock($errorElement, $block);
            $this->inValidate = false;
        } catch (\Exception $e) {
            $this->inValidate = false;
        }
    }
439087
void invalidate() {

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, "invalidate");
        }

        _sessionInvalidated = true;

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, "invalidate");
        }

    }
48958
public function invalidate() {

		if ( ! \wp_using_ext_object_cache() ) {
			// Clean up old transients.
			foreach ( $this->get_keys_from_database() as $old_transient ) {
				$this->delete( $old_transient, true );
			}
		}

		// Update incrementor.
		$this->incrementor = time();
		$this->set( $this->incrementor_key, $this->incrementor, 0, true );
	}
315913
def invalidate(self):
        """"""
        with self._mesh_generator_lock:
            self._mesh_generator_pending = None
            self._mesh_generator = None
        self._dispatch_changed_callbacks()
253743
public void unfinalizeBlock(int namespaceId, Block b) throws IOException {
    lock.writeLock().lock();
    try {
      // remove the block from in-memory data structure
      ActiveFile activefile = volumeMap.removeOngoingCreates(namespaceId, b);
      if (activefile == null) {
        return;
      }
      volumeMap.remove(namespaceId, b);
      
      // delete the on-disk temp file
      File metaFile = null;
      if (!activefile.isInlineChecksum()) {
        metaFile = BlockWithChecksumFileWriter.getMetaFile(
            activefile.getDataFileToRead(), b);
      }
      if (delBlockFromDisk(activefile.getDataFileToRead(), metaFile, b)) {
        DataNode.LOG.warn("Block " + b + " unfinalized and removed. " );
      }
    } finally {
      lock.writeLock().unlock();
    }
  }
808773
public void blocksBeingWrittenReport(DatanodeRegistration nodeReg,
      BlockReport blocks) throws IOException {
    verifyRequest(nodeReg);
    long[] blocksAsLong = blocks.getBlockReportInLongs();
    BlockListAsLongs blist = new BlockListAsLongs(blocksAsLong);
    boolean processed = namesystem.processBlocksBeingWrittenReport(nodeReg, blist);

    String message = "*BLOCK* NameNode.blocksBeingWrittenReport: "
        +"from "+nodeReg.getName()+" "+blist.getNumberOfBlocks() +" blocks";
    if (!processed) {
      message += " was discarded.";
    }
    stateChangeLog.info(message);
  }
594909
void validateBlock(Row row)
  {
    if (! row.getDatabase().isValidate()) {
      return;
    }
    
    int rowHead = _rowHead;
    int blobTail = _blobTail;
        
    if (rowHead < blobTail) {
      throw new IllegalStateException(this 
                                      + " rowHead:" + rowHead
                                      + " blobTail:" + blobTail); 
    }
    
    int rowOffset = _rowHead;
    
    byte []buffer = _buffer;

    while (rowOffset < BLOCK_SIZE) {
      int code = buffer[rowOffset] & CODE_MASK;
      
      switch (code) {
      case INSERT:
        row.validate(buffer, rowOffset, rowHead, blobTail);
        break;
        
      case INSERT_DEAD:
      case REMOVE:
        break;
        
      default:
        throw new IllegalStateException(this + " " + rowOffset + " " + code + " unknown code");
      }
      
      int len = getLength(code, row);
      
      if (len < 0 || len + rowOffset > BLOCK_SIZE) {
        throw new IllegalStateException(this + " " + rowOffset + " code:" + code + " len:" + len + " invalid len");
      }
      
      rowOffset += len;
    }  
  }
1191159
void addBlocksToBeInvalidated(List<Block> blocklist) {
    assert(blocklist != null && blocklist.size() > 0);
    synchronized (invalidateBlocks) {
      for(Block blk : blocklist) {
        invalidateBlocks.add(blk);
      }
    }
  }
875784
public void invalidate(P principal, String role) {
        cache.invalidate(ImmutablePair.of(principal, role));
    }
139437
private void removeDatanode(DatanodeDescriptor nodeInfo) {
    synchronized (heartbeats) {
      if (nodeInfo.isAlive) {
        updateStats(nodeInfo, false);
        heartbeats.remove(nodeInfo);
        nodeInfo.isAlive = false;
      }
    }

    for (Iterator<BlockInfo> it = nodeInfo.getBlockIterator(); it.hasNext();) {
      removeStoredBlock(it.next(), nodeInfo);
    }
    unprotectedRemoveDatanode(nodeInfo);
    clusterMap.remove(nodeInfo);

    // remove this datanode from any INodeFileUnderConstruction so
    // concurrent readers don't get down datanodes
    // (we need a copy of the Set since removeTargets may modify it)
    Set<INodeFileUnderConstruction> iNodeFileSet =
      new HashSet<INodeFileUnderConstruction>(nodeInfo.getOpenINodes());
    for (INodeFileUnderConstruction iNodeFile : iNodeFileSet) {
      iNodeFile.removeTarget(nodeInfo);
    }
  }
574133
public final void invalidateAllKeys(String dataStructureName, String sourceUuid) {
        checkNotNull(sourceUuid, "sourceUuid cannot be null");

        int orderKey = getPartitionId(dataStructureName);
        Invalidation invalidation = newClearInvalidation(dataStructureName, sourceUuid);
        sendImmediately(invalidation, orderKey);
    }
654449
public function removeBlock(Block $block)
	{
		if (! $this->equals($block->getPlaceHolder())
				|| ! $this->blocks->contains($block)) {
			throw new \InvalidArgumentException('Block does not belongs to this placeholder.');
		}

		$position = $block->getPosition();
	
		$this->blocks->removeElement($block);

		foreach ($this->blocks as $existingBlock) {
			if ($existingBlock->getPosition() > $position) {
				$existingBlock->setPosition($existingBlock->getPosition() - 1);
			}
		}
	}