org.apache.hadoop.hdfs.server.namenode
Class INode

java.lang.Object
  extended by org.apache.hadoop.hdfs.server.namenode.INode
All Implemented Interfaces:
Comparable<byte[]>, org.apache.hadoop.hdfs.server.namenode.FSInodeInfo
Direct Known Subclasses:
INodeFile

public abstract class INode
extends Object
implements Comparable<byte[]>, org.apache.hadoop.hdfs.server.namenode.FSInodeInfo

We keep an in-memory representation of the file/block hierarchy. This is a base INode class containing common fields for file and directory inodes.


Field Summary
protected  long accessTime
           
protected  long modificationTime
           
protected  byte[] name
           
protected  org.apache.hadoop.hdfs.server.namenode.INodeDirectory parent
           
 
Constructor Summary
protected INode()
           
protected INode(String name, org.apache.hadoop.fs.permission.PermissionStatus permissions)
           
 
Method Summary
 int compareTo(byte[] o)
           
 org.apache.hadoop.fs.ContentSummary computeContentSummary()
          Compute ContentSummary.
 boolean equals(Object o)
           
 long getAccessTime()
          Get access time of inode.
 org.apache.hadoop.fs.permission.FsPermission getFsPermission()
          Get the FsPermission
protected  short getFsPermissionShort()
           
 String getFullPathName()
          a string representation of an inode
 String getGroupName()
          Get group name
 long getModificationTime()
          Get last modification time of inode.
protected  org.apache.hadoop.fs.permission.PermissionStatus getPermissionStatus()
          Get the PermissionStatus
 String getUserName()
          Get user name
 int hashCode()
           
abstract  boolean isDirectory()
          Check whether it's a directory
 boolean isLink()
          Check whether it's a symlink
 boolean isUnderConstruction()
          Is this inode being constructed?
protected  void setGroup(String group)
          Set group
protected  void setPermission(org.apache.hadoop.fs.permission.FsPermission permission)
          Set the FsPermission of this INode
protected  void setPermissionStatus(org.apache.hadoop.fs.permission.PermissionStatus ps)
          Set the PermissionStatus
protected  void setUser(String user)
          Set user
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected byte[] name

parent

protected org.apache.hadoop.hdfs.server.namenode.INodeDirectory parent

modificationTime

protected long modificationTime

accessTime

protected long accessTime
Constructor Detail

INode

protected INode()

INode

protected INode(String name,
                org.apache.hadoop.fs.permission.PermissionStatus permissions)
Method Detail

setPermissionStatus

protected void setPermissionStatus(org.apache.hadoop.fs.permission.PermissionStatus ps)
Set the PermissionStatus


getPermissionStatus

protected org.apache.hadoop.fs.permission.PermissionStatus getPermissionStatus()
Get the PermissionStatus


getUserName

public String getUserName()
Get user name


setUser

protected void setUser(String user)
Set user


getGroupName

public String getGroupName()
Get group name


setGroup

protected void setGroup(String group)
Set group


getFsPermission

public org.apache.hadoop.fs.permission.FsPermission getFsPermission()
Get the FsPermission


getFsPermissionShort

protected short getFsPermissionShort()

setPermission

protected void setPermission(org.apache.hadoop.fs.permission.FsPermission permission)
Set the FsPermission of this INode


isDirectory

public abstract boolean isDirectory()
Check whether it's a directory


computeContentSummary

public final org.apache.hadoop.fs.ContentSummary computeContentSummary()
Compute ContentSummary.


getFullPathName

public String getFullPathName()
a string representation of an inode

Specified by:
getFullPathName in interface org.apache.hadoop.hdfs.server.namenode.FSInodeInfo
Returns:
the full pathname (from root) that this inode represents

toString

public String toString()

Overrides:
toString in class Object

getModificationTime

public long getModificationTime()
Get last modification time of inode.

Returns:
access time

getAccessTime

public long getAccessTime()
Get access time of inode.

Returns:
access time

isUnderConstruction

public boolean isUnderConstruction()
Is this inode being constructed?


isLink

public boolean isLink()
Check whether it's a symlink


compareTo

public int compareTo(byte[] o)
Specified by:
compareTo in interface Comparable<byte[]>

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2013 Apache Software Foundation. All Rights Reserved.