fsd.getEditLog().logOpenFile(src, newNode, overwrite, logRetryEntry); if (NameNode.stateChangeLog.isDebugEnabled()) { NameNode.stateChangeLog.debug("DIR* NameSystem.startFile: added " +
/** * Persist the block list for the inode. */ void persistBlocks(String path, INodeFileUnderConstruction file) throws IOException { waitForReady(); synchronized (rootDir) { fsImage.getEditLog().logOpenFile(path, file); NameNode.stateChangeLog.debug("DIR* FSDirectory.persistBlocks: " +path+" with "+ file.getBlocks().length +" blocks is persisted to the file system"); } }
fsn.getEditLog().logAppendFile(path, file, newBlock, logRetryCache); } else { fsn.getEditLog().logOpenFile(path, file, false, logRetryCache);
/** * Persist the block list for the inode. */ void persistBlocks(String path, INodeFileUnderConstruction file) throws IOException { waitForReady(); writeLock(); try { fsImage.getEditLog().logOpenFile(path, file); if (NameNode.stateChangeLog.isDebugEnabled()) { NameNode.stateChangeLog.debug("DIR* FSDirectory.persistBlocks: " +path+" with "+ file.getBlocks().length +" blocks is persisted to the file system"); } } finally { writeUnlock(); } }
public void run() { PermissionStatus p = namesystem.createFsOwnerPermissions( new FsPermission((short)0777)); FSEditLog editLog = namesystem.getEditLog(); for (int i = 0; i < numTransactions; i++) { INodeFileUnderConstruction inode = new INodeFileUnderConstruction( p, replication, blockSize, 0, "", "", null); editLog.logOpenFile("/filename" + i, inode); editLog.logCloseFile("/filename" + i, inode); editLog.logSync(); } } }
fsImage.getEditLog().logOpenFile(path, newNode);
/** * Remove a block to the file. */ boolean removeBlock(String path, INodeFileUnderConstruction fileNode, Block block) throws IOException { waitForReady(); synchronized (rootDir) { // modify file-> block and blocksMap fileNode.removeBlock(block); namesystem.blocksMap.removeINode(block); // If block is removed from blocksMap remove it from corruptReplicasMap namesystem.corruptReplicas.removeFromCorruptReplicasMap(block); // write modified block locations to log fsImage.getEditLog().logOpenFile(path, fileNode); NameNode.stateChangeLog.debug("DIR* FSDirectory.addFile: " +path+" with "+block +" block is added to the file system"); } return true; }
/** * Remove the block from a file. */ boolean removeBlock(String path, INodeFileUnderConstruction fileNode, Block block) throws IOException { waitForReady(); writeLock(); try { // modify file-> block and blocksMap fileNode.removeBlock(block); getFSNamesystem().blocksMap.removeBlock(block); // Remove the block from corruptReplicasMap getFSNamesystem().corruptReplicas.removeFromCorruptReplicasMap(block); // write modified block locations to log fsImage.getEditLog().logOpenFile(path, fileNode); if (NameNode.stateChangeLog.isDebugEnabled()) { NameNode.stateChangeLog.debug("DIR* FSDirectory.removeBlock: " +path+" with "+block +" block is removed from the file system"); } } finally { writeUnlock(); } return true; }
fsImage.getEditLog().logOpenFile(path, newNode);
editLog.logMkDir(currentDir, dirInode); editLog.logOpenFile(filePath, inode); editLog.logCloseFile(filePath, inode);
lease, src, HdfsConstants.NN_RECOVERY_LEASEHOLDER, pendingFile ); getEditLog().logOpenFile(src, pendingFile); leaseManager.renewLease(reassignedLease);
@Override public void run() { PermissionStatus p = namesystem.createFsOwnerPermissions( new FsPermission((short)0777)); FSEditLog editLog = namesystem.getEditLog(); for (int i = 0; i < numTransactions; i++) { INodeFile inode = new INodeFile(namesystem.dir.allocateNewInodeId(), null, p, 0L, 0L, BlockInfoContiguous.EMPTY_ARRAY, replication, blockSize); inode.toUnderConstruction("", ""); editLog.logOpenFile("/filename" + (startIndex + i), inode, false, false); editLog.logCloseFile("/filename" + (startIndex + i), inode); editLog.logSync(); } } }
getEditLog().logOpenFile(src, newNode, overwrite, logRetryEntry); NameNode.stateChangeLog.debug("DIR* NameSystem.startFile: added {}" + " inode {} holder {}", src, newNode.getId(), holder);
getEditLog().logOpenFile(src, newNode, overwrite, logRetryEntry); NameNode.stateChangeLog.debug("DIR* NameSystem.startFile: added {}" + " inode {} holder {}", src, newNode.getId(), holder);
p, 0L, 0L, BlockInfoContiguous.EMPTY_ARRAY, replication, blockSize); fileUc.toUnderConstruction("", ""); editLog.logOpenFile(filePath, fileUc, false, false); editLog.logCloseFile(filePath, inode);