Example usage for org.apache.hadoop.hdfs.server.namenode INodeDirectory ROOT_NAME

List of usage examples for org.apache.hadoop.hdfs.server.namenode INodeDirectory ROOT_NAME

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs.server.namenode INodeDirectory ROOT_NAME.

Prototype

null ROOT_NAME

To view the source code for org.apache.hadoop.hdfs.server.namenode INodeDirectory ROOT_NAME.

Click Source Link

Usage

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

License:Apache License

private static INode getRoot() throws StorageException, TransactionContextException {
    return getNode(INodeDirectory.ROOT_NAME.getBytes(), INodeDirectory.ROOT_PARENT_ID, false);
}

From source file:io.hops.metadata.adaptor.INodeDALAdaptor.java

License:Apache License

@Override
public org.apache.hadoop.hdfs.server.namenode.INode convertDALtoHDFS(INode hopINode) throws StorageException {
    org.apache.hadoop.hdfs.server.namenode.INode inode = null;
    if (hopINode != null) {
        DataInputBuffer buffer = new DataInputBuffer();
        buffer.reset(hopINode.getPermission(), hopINode.getPermission().length);
        PermissionStatus ps = null;/*from   ww w. j a va  2s.com*/
        try {
            ps = PermissionStatus.read(buffer);
        } catch (IOException e) {
            throw new StorageException(e);
        }

        if (hopINode.isDir()) {
            if (hopINode.isDirWithQuota()) {
                inode = new INodeDirectoryWithQuota(hopINode.getName(), ps);
            } else {
                String iname = (hopINode.getName().length() == 0) ? INodeDirectory.ROOT_NAME
                        : hopINode.getName();
                inode = new INodeDirectory(iname, ps);
            }

            inode.setAccessTimeNoPersistance(hopINode.getAccessTime());
            inode.setModificationTimeNoPersistance(hopINode.getModificationTime());
        } else if (hopINode.getSymlink() != null) {
            inode = new INodeSymlink(hopINode.getSymlink(), hopINode.getModificationTime(),
                    hopINode.getAccessTime(), ps);
        } else {
            if (hopINode.isUnderConstruction()) {
                DatanodeID dnID = (hopINode.getClientNode() == null || hopINode.getClientNode().isEmpty())
                        ? null
                        : new DatanodeID(hopINode.getClientNode());

                inode = new INodeFileUnderConstruction(ps, INodeFile.getBlockReplication(hopINode.getHeader()),
                        INodeFile.getPreferredBlockSize(hopINode.getHeader()), hopINode.getModificationTime(),
                        hopINode.getClientName(), hopINode.getClientMachine(), dnID);

                inode.setAccessTimeNoPersistance(hopINode.getAccessTime());
            } else {
                inode = new INodeFile(ps, hopINode.getHeader(), hopINode.getModificationTime(),
                        hopINode.getAccessTime());
            }
            ((INodeFile) inode).setGenerationStampNoPersistence(hopINode.getGenerationStamp());
        }
        inode.setIdNoPersistance(hopINode.getId());
        inode.setLocalNameNoPersistance(hopINode.getName());
        inode.setParentIdNoPersistance(hopINode.getParentId());
        inode.setSubtreeLocked(hopINode.isSubtreeLocked());
        inode.setSubtreeLockOwner(hopINode.getSubtreeLockOwner());
    }
    return inode;
}

From source file:io.hops.transaction.lock.INodeLock.java

License:Apache License

private INode acquireLockOnRoot(TransactionLockTypes.INodeLockType lock)
        throws StorageException, TransactionContextException {
    LOG.debug("Acquiring " + lock + " on the root node");
    return find(lock, INodeDirectory.ROOT_NAME, INodeDirectory.ROOT_PARENT_ID);
}