/** * Looks up the nearest ancestor EncryptionZoneInt that contains the given * path (excluding itself). * Returns null if path is not within an EZ, or the path is the root dir '/' * <p/> * Called while holding the FSDirectory lock. */ private EncryptionZoneInt getParentEncryptionZoneForPath(INodesInPath iip) throws IOException { assert dir.hasReadLock(); Preconditions.checkNotNull(iip); INodesInPath parentIIP = iip.getParentINodesInPath(); return parentIIP == null ? null : getEncryptionZoneForPath(parentIIP); }
static void mkdirForEditLog(FSDirectory fsd, long inodeId, String src, PermissionStatus permissions, List<AclEntry> aclEntries, long timestamp) throws QuotaExceededException, UnresolvedLinkException, AclException, FileAlreadyExistsException, ParentNotDirectoryException, AccessControlException { assert fsd.hasWriteLock(); INodesInPath iip = fsd.getINodesInPath(src, DirOp.WRITE_LINK); final byte[] localName = iip.getLastLocalName(); final INodesInPath existing = iip.getParentINodesInPath(); Preconditions.checkState(existing.getLastINode() != null); unprotectedMkdir(fsd, inodeId, existing, localName, permissions, aclEntries, timestamp); }
parent = iip.getParentINodesInPath();
iip.getPath(), HdfsConstants.SEPARATOR_DOT_SNAPSHOT_DIR); iip = iip.getParentINodesInPath(); final String dirPath = iip.getPath(); final INode node = iip.getLastINode();
int missing = iip.length() - existing.length(); if (missing == 0) { // full path exists, return parents. existing = iip.getParentINodesInPath(); } else if (missing > 1) { // need to create at least one ancestor dir.
this.srcIIP = srcIIP; this.dstIIP = dstIIP; this.srcParentIIP = srcIIP.getParentINodesInPath(); this.dstParentIIP = dstIIP.getParentINodesInPath();
static void mkdirForEditLog(FSDirectory fsd, long inodeId, String src, PermissionStatus permissions, List<AclEntry> aclEntries, long timestamp) throws QuotaExceededException, UnresolvedLinkException, AclException, FileAlreadyExistsException { assert fsd.hasWriteLock(); INodesInPath iip = fsd.getINodesInPath(src, false); final byte[] localName = iip.getLastLocalName(); final INodesInPath existing = iip.getParentINodesInPath(); Preconditions.checkState(existing.getLastINode() != null); unprotectedMkdir(fsd, inodeId, existing, localName, permissions, aclEntries, timestamp); }
static void mkdirForEditLog(FSDirectory fsd, long inodeId, String src, PermissionStatus permissions, List<AclEntry> aclEntries, long timestamp) throws QuotaExceededException, UnresolvedLinkException, AclException, FileAlreadyExistsException { assert fsd.hasWriteLock(); INodesInPath iip = fsd.getINodesInPath(src, false); final byte[] localName = iip.getLastLocalName(); final INodesInPath existing = iip.getParentINodesInPath(); Preconditions.checkState(existing.getLastINode() != null); unprotectedMkdir(fsd, inodeId, existing, localName, permissions, aclEntries, timestamp); }
this.srcIIP = srcIIP; this.dstIIP = dstIIP; this.srcParentIIP = srcIIP.getParentINodesInPath(); this.dstParentIIP = dstIIP.getParentINodesInPath();
this.srcIIP = srcIIP; this.dstIIP = dstIIP; this.srcParentIIP = srcIIP.getParentINodesInPath(); this.dstParentIIP = dstIIP.getParentINodesInPath();