Example usage for org.apache.hadoop.hdfs.protocol UnresolvedPathException UnresolvedPathException

List of usage examples for org.apache.hadoop.hdfs.protocol UnresolvedPathException UnresolvedPathException

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs.protocol UnresolvedPathException UnresolvedPathException.

Prototype

public UnresolvedPathException(String path, String preceding, String remainder, String linkTarget) 

Source Link

Usage

From source file:io.hops.common.INodeResolver.java

License:Apache License

public INode next() throws UnresolvedPathException, StorageException, TransactionContextException {
    boolean lastComp = (count == components.length - 1);
    if (currentInode.isSymlink() && (!lastComp || (lastComp && resolveLink))) {
        final String symPath = INodeUtil.constructPath(components, 0, components.length);
        final String preceding = INodeUtil.constructPath(components, 0, count);
        final String remainder = INodeUtil.constructPath(components, count + 1, components.length);
        final String link = DFSUtil.bytes2String(components[count]);
        final String target = ((INodeSymlink) currentInode).getLinkValue();
        if (NameNode.stateChangeLog.isDebugEnabled()) {
            NameNode.stateChangeLog.debug(
                    "UnresolvedPathException " + " path: " + symPath + " preceding: " + preceding + " count: "
                            + count + " link: " + link + " target: " + target + " remainder: " + remainder);
        }/*from   ww  w .ja  va2  s .  co m*/
        throw new UnresolvedPathException(symPath, preceding, remainder, target);
    }

    if (!hasNext()) {
        throw new NoSuchElementException("Trying to read more components than available");
    }

    currentInode = INodeUtil.getNode(components[++count], currentInode.getId(), transactional);
    return currentInode;
}