@Override public final INodeSymlink asSymlink() { return referred.asSymlink(); }
private static void validateDestination( String src, String dst, INode srcInode) throws IOException { String error; if (srcInode.isSymlink() && dst.equals(srcInode.asSymlink().getSymlinkString())) { throw new FileAlreadyExistsException("Cannot rename symlink " + src + " to its target " + dst); } // dst cannot be a directory or a file under src if (dst.startsWith(src) && dst.charAt(src.length()) == Path.SEPARATOR_CHAR) { error = "Rename destination " + dst + " is a directory or file under source " + src; NameNode.stateChangeLog.warn("DIR* FSDirectory.unprotectedRenameTo: " + error); throw new IOException(error); } if (FSDirectory.isExactReservedName(src) || FSDirectory.isExactReservedName(dst)) { error = "Cannot rename to or from /.reserved"; throw new InvalidPathException(error); } }
private static void checkNotSymlink(INode inode, byte[][] components, int i) throws UnresolvedPathException { if (inode != null && inode.isSymlink()) { final int last = components.length - 1; final String path = getPath(components, 0, last); final String preceding = getPath(components, 0, i - 1); final String remainder = getPath(components, i + 1, last); final String target = inode.asSymlink().getSymlinkString(); if (LOG.isDebugEnabled()) { final String link = inode.getLocalName(); LOG.debug("UnresolvedPathException " + " path: " + path + " preceding: " + preceding + " count: " + i + " link: " + link + " target: " + target + " remainder: " + remainder); } throw new UnresolvedPathException(path, preceding, remainder, target); } }
private void save(OutputStream out, INode n) throws IOException { if (n.isDirectory()) { save(out, n.asDirectory()); } else if (n.isFile()) { save(out, n.asFile()); } else if (n.isSymlink()) { save(out, n.asSymlink()); } }
@Override public final INodeSymlink asSymlink() { return referred.asSymlink(); }
@Override public final INodeSymlink asSymlink() { return referred.asSymlink(); }
/** * Save one inode's attributes to the image. */ public static void saveINode2Image(INode node, DataOutput out, boolean writeUnderConstruction, ReferenceMap referenceMap) throws IOException { if (node.isReference()) { writeINodeReference(node.asReference(), out, writeUnderConstruction, referenceMap); } else if (node.isDirectory()) { writeINodeDirectory(node.asDirectory(), out); } else if (node.isSymlink()) { writeINodeSymlink(node.asSymlink(), out); } else if (node.isFile()) { writeINodeFile(node.asFile(), out, writeUnderConstruction); } }
} else if (inode.isSymlink()) { symlink = new Path( DFSUtilClient.bytes2String(inode.asSymlink().getSymlink()));
nodeAttrs.getUserName(), nodeAttrs.getGroupName(), node.isSymlink() ? node.asSymlink().getSymlink() : null, name, node.getId(),
private static void validateDestination( String src, String dst, INode srcInode) throws IOException { String error; if (srcInode.isSymlink() && dst.equals(srcInode.asSymlink().getSymlinkString())) { throw new FileAlreadyExistsException("Cannot rename symlink " + src + " to its target " + dst); } // dst cannot be a directory or a file under src if (dst.startsWith(src) && dst.charAt(src.length()) == Path.SEPARATOR_CHAR) { error = "Rename destination " + dst + " is a directory or file under source " + src; NameNode.stateChangeLog.warn("DIR* FSDirectory.unprotectedRenameTo: " + error); throw new IOException(error); } }
private static void validateDestination( String src, String dst, INode srcInode) throws IOException { String error; if (srcInode.isSymlink() && dst.equals(srcInode.asSymlink().getSymlinkString())) { throw new FileAlreadyExistsException("Cannot rename symlink " + src + " to its target " + dst); } // dst cannot be a directory or a file under src if (dst.startsWith(src) && dst.charAt(src.length()) == Path.SEPARATOR_CHAR) { error = "Rename destination " + dst + " is a directory or file under source " + src; NameNode.stateChangeLog.warn("DIR* FSDirectory.unprotectedRenameTo: " + error); throw new IOException(error); } }
private void save(OutputStream out, INode n) throws IOException { if (n.isDirectory()) { save(out, n.asDirectory()); } else if (n.isFile()) { save(out, n.asFile()); } else if (n.isSymlink()) { save(out, n.asSymlink()); } }
private void save(OutputStream out, INode n) throws IOException { if (n.isDirectory()) { save(out, n.asDirectory()); } else if (n.isFile()) { save(out, n.asFile()); } else if (n.isSymlink()) { save(out, n.asSymlink()); } }
/** * Save one inode's attributes to the image. */ public static void saveINode2Image(INode node, DataOutput out, boolean writeUnderConstruction, ReferenceMap referenceMap) throws IOException { if (node.isReference()) { writeINodeReference(node.asReference(), out, writeUnderConstruction, referenceMap); } else if (node.isDirectory()) { writeINodeDirectory(node.asDirectory(), out); } else if (node.isSymlink()) { writeINodeSymlink(node.asSymlink(), out); } else if (node.isFile()) { writeINodeFile(node.asFile(), out, writeUnderConstruction); } }
/** * Save one inode's attributes to the image. */ public static void saveINode2Image(INode node, DataOutput out, boolean writeUnderConstruction, ReferenceMap referenceMap) throws IOException { if (node.isReference()) { writeINodeReference(node.asReference(), out, writeUnderConstruction, referenceMap); } else if (node.isDirectory()) { writeINodeDirectory(node.asDirectory(), out); } else if (node.isSymlink()) { writeINodeSymlink(node.asSymlink(), out); } else if (node.isFile()) { writeINodeFile(node.asFile(), out, writeUnderConstruction); } }
nodeAttrs.getUserName(), nodeAttrs.getGroupName(), node.isSymlink() ? node.asSymlink().getSymlink() : null, path, node.getId(),
nodeAttrs.getUserName(), nodeAttrs.getGroupName(), node.isSymlink() ? node.asSymlink().getSymlink() : null, path, node.getId(),
constructPath(components, count + 1, components.length); final String link = DFSUtil.bytes2String(components[count]); final String target = curNode.asSymlink().getSymlinkString(); if (LOG.isDebugEnabled()) { LOG.debug("UnresolvedPathException " +
getPermissionForFileStatus(nodeAttrs, isEncrypted), nodeAttrs.getUserName(), nodeAttrs.getGroupName(), node.isSymlink() ? node.asSymlink().getSymlink() : null, path, node.getId(), loc, childrenNum, feInfo, storagePolicy);
getPermissionForFileStatus(nodeAttrs, isEncrypted), nodeAttrs.getUserName(), nodeAttrs.getGroupName(), node.isSymlink() ? node.asSymlink().getSymlink() : null, path, node.getId(), loc, childrenNum, feInfo, storagePolicy);