/** * Add the given child to the namespace. * @param existing the INodesInPath containing all the ancestral INodes * @param child the new INode to add * @param modes create modes * @return a new INodesInPath instance containing the new child INode. Null * if the adding fails. * @throws QuotaExceededException is thrown if it violates quota limit */ INodesInPath addINode(INodesInPath existing, INode child, FsPermission modes) throws QuotaExceededException, UnresolvedLinkException { cacheName(child); writeLock(); try { return addLastINode(existing, child, modes, true); } finally { writeUnlock(); } }
private void addToParent(INodeDirectory parent, INode child) { if (parent == dir.rootDir && FSDirectory.isReservedName(child)) { throw new HadoopIllegalArgumentException("File name \"" + child.getLocalName() + "\" is reserved. Please " + " change the name of the existing file or directory to another " + "name before upgrading to this release."); } // NOTE: This does not update space counts for parents if (!parent.addChild(child)) { return; } dir.cacheName(child); if (child.isFile()) { updateBlocksMap(child.asFile(), fsn.getBlockManager()); } }
/** * Add the child node to parent and, if child is a file, update block map. * This method is only used for image loading so that synchronization, * modification time update and space count update are not needed. */ private void addToParent(INodeDirectory parent, INode child) throws IllegalReservedPathException { FSDirectory fsDir = namesystem.dir; if (parent == fsDir.rootDir) { child.setLocalName(renameReservedRootComponentOnUpgrade( child.getLocalNameBytes(), getLayoutVersion())); } // NOTE: This does not update space counts for parents if (!parent.addChild(child)) { return; } namesystem.dir.cacheName(child); if (child.isFile()) { updateBlocksMap(child.asFile()); } }
/** * Add the given child to the namespace. * @param existing the INodesInPath containing all the ancestral INodes * @param child the new INode to add * @return a new INodesInPath instance containing the new child INode. Null * if the adding fails. * @throws QuotaExceededException is thrown if it violates quota limit */ INodesInPath addINode(INodesInPath existing, INode child) throws QuotaExceededException, UnresolvedLinkException { cacheName(child); writeLock(); try { return addLastINode(existing, child, true); } finally { writeUnlock(); } }
/** * Add the given child to the namespace. * @param existing the INodesInPath containing all the ancestral INodes * @param child the new INode to add * @return a new INodesInPath instance containing the new child INode. Null * if the adding fails. * @throws QuotaExceededException is thrown if it violates quota limit */ INodesInPath addINode(INodesInPath existing, INode child) throws QuotaExceededException, UnresolvedLinkException { cacheName(child); writeLock(); try { return addLastINode(existing, child, true); } finally { writeUnlock(); } }
/** Add a node child to the namespace. The full path name of the node is src. * childDiskspace should be -1, if unknown. * QuotaExceededException is thrown if it violates quota limit */ private <T extends INode> T addNode(String src, T child, long childDiskspace, boolean inheritPermission) throws QuotaExceededException { byte[][] components = INode.getPathComponents(src); byte[] path = components[components.length - 1]; child.setLocalName(path); cacheName(child); INode[] inodes = new INode[components.length]; writeLock(); try { rootDir.getExistingPathINodes(components, inodes); return addChild(inodes, inodes.length-1, child, childDiskspace, inheritPermission); } finally { writeUnlock(); } }
/** * Add the child node to parent and, if child is a file, update block map. * This method is only used for image loading so that synchronization, * modification time update and space count update are not needed. */ private void addToParent(INodeDirectory parent, INode child) throws IllegalReservedPathException { FSDirectory fsDir = namesystem.dir; if (parent == fsDir.rootDir) { child.setLocalName(renameReservedRootComponentOnUpgrade( child.getLocalNameBytes(), getLayoutVersion())); } // NOTE: This does not update space counts for parents if (!parent.addChild(child)) { return; } namesystem.dir.cacheName(child); if (child.isFile()) { updateBlocksMap(child.asFile()); } }
/** * Add the child node to parent and, if child is a file, update block map. * This method is only used for image loading so that synchronization, * modification time update and space count update are not needed. */ private void addToParent(INodeDirectory parent, INode child) throws IllegalReservedPathException { FSDirectory fsDir = namesystem.dir; if (parent == fsDir.rootDir) { child.setLocalName(renameReservedRootComponentOnUpgrade( child.getLocalNameBytes(), getLayoutVersion())); } // NOTE: This does not update space counts for parents if (!parent.addChild(child)) { return; } namesystem.dir.cacheName(child); if (child.isFile()) { updateBlocksMap(child.asFile()); } }
private void addToParent(INodeDirectory parent, INode child) { if (parent == dir.rootDir && FSDirectory.isReservedName(child)) { throw new HadoopIllegalArgumentException("File name \"" + child.getLocalName() + "\" is reserved. Please " + " change the name of the existing file or directory to another " + "name before upgrading to this release."); } // NOTE: This does not update space counts for parents if (!parent.addChild(child)) { return; } dir.cacheName(child); if (child.isFile()) { updateBlocksMap(child.asFile(), fsn.getBlockManager()); } }
private void addToParent(INodeDirectory parent, INode child) { if (parent == dir.rootDir && FSDirectory.isReservedName(child)) { throw new HadoopIllegalArgumentException("File name \"" + child.getLocalName() + "\" is reserved. Please " + " change the name of the existing file or directory to another " + "name before upgrading to this release."); } // NOTE: This does not update space counts for parents if (!parent.addChild(child)) { return; } dir.cacheName(child); if (child.isFile()) { updateBlocksMap(child.asFile(), fsn.getBlockManager()); } }
newParent = rootDir.addToParent(src, newNode, parentINode, false, propagateModTime, childIndex); cacheName(newNode); } catch (FileNotFoundException e) { return null;