org.apache.hadoop.hdfs.protocol
Class HdfsFileStatus

java.lang.Object
  extended by org.apache.hadoop.hdfs.protocol.HdfsFileStatus
All Implemented Interfaces:
org.apache.hadoop.io.Writable

@InterfaceAudience.Private
@InterfaceStability.Evolving
public class HdfsFileStatus
extends Object
implements org.apache.hadoop.io.Writable

Interface that represents the over the wire information for a file.


Field Summary
static byte[] EMPTY_NAME
           
 
Constructor Summary
HdfsFileStatus()
          default constructor
HdfsFileStatus(long length, boolean isdir, int block_replication, long blocksize, long modification_time, long access_time, org.apache.hadoop.fs.permission.FsPermission permission, String owner, String group, byte[] symlink, byte[] path)
          Constructor
 
Method Summary
 long getAccessTime()
          Get the access time of the file.
 long getBlockSize()
          Get the block size of the file.
 String getFullName(String parent)
          Get the string representation of the full path name
 org.apache.hadoop.fs.Path getFullPath(org.apache.hadoop.fs.Path parent)
          Get the full path
 String getGroup()
          Get the group associated with the file.
 long getLen()
          Get the length of this file, in bytes.
 String getLocalName()
          Get the string representation of the local name
 byte[] getLocalNameInBytes()
          Get the Java UTF8 representation of the local name
 long getModificationTime()
          Get the modification time of the file.
 String getOwner()
          Get the owner of the file.
 org.apache.hadoop.fs.permission.FsPermission getPermission()
          Get FsPermission associated with the file.
 short getReplication()
          Get the replication factor of a file.
 String getSymlink()
          Get the string representation of the symlink.
 boolean isDir()
          Is this a directory?
 boolean isEmptyLocalName()
          Check if the local name is empty
 boolean isSymlink()
          Is this a symbolic link?
 void readFields(DataInput in)
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_NAME

public static final byte[] EMPTY_NAME
Constructor Detail

HdfsFileStatus

public HdfsFileStatus()
default constructor


HdfsFileStatus

public HdfsFileStatus(long length,
                      boolean isdir,
                      int block_replication,
                      long blocksize,
                      long modification_time,
                      long access_time,
                      org.apache.hadoop.fs.permission.FsPermission permission,
                      String owner,
                      String group,
                      byte[] symlink,
                      byte[] path)
Constructor

Parameters:
length - the number of bytes the file has
isdir - if the path is a directory
block_replication - the replication factor
blocksize - the block size
modification_time - modification time
access_time - access time
permission - permission
owner - the owner of the path
group - the group of the path
path - the local name in java UTF8 encoding the same as that in-memory
Method Detail

getLen

public final long getLen()
Get the length of this file, in bytes.

Returns:
the length of this file, in bytes.

isDir

public final boolean isDir()
Is this a directory?

Returns:
true if this is a directory

isSymlink

public boolean isSymlink()
Is this a symbolic link?

Returns:
true if this is a symbolic link

getBlockSize

public final long getBlockSize()
Get the block size of the file.

Returns:
the number of bytes

getReplication

public final short getReplication()
Get the replication factor of a file.

Returns:
the replication factor of a file.

getModificationTime

public final long getModificationTime()
Get the modification time of the file.

Returns:
the modification time of file in milliseconds since January 1, 1970 UTC.

getAccessTime

public final long getAccessTime()
Get the access time of the file.

Returns:
the access time of file in milliseconds since January 1, 1970 UTC.

getPermission

public final org.apache.hadoop.fs.permission.FsPermission getPermission()
Get FsPermission associated with the file.

Returns:
permssion

getOwner

public final String getOwner()
Get the owner of the file.

Returns:
owner of the file

getGroup

public final String getGroup()
Get the group associated with the file.

Returns:
group for the file.

isEmptyLocalName

public final boolean isEmptyLocalName()
Check if the local name is empty

Returns:
true if the name is empty

getLocalName

public final String getLocalName()
Get the string representation of the local name

Returns:
the local name in string

getLocalNameInBytes

public final byte[] getLocalNameInBytes()
Get the Java UTF8 representation of the local name

Returns:
the local name in java UTF8

getFullName

public final String getFullName(String parent)
Get the string representation of the full path name

Parameters:
parent - the parent path
Returns:
the full path in string

getFullPath

public final org.apache.hadoop.fs.Path getFullPath(org.apache.hadoop.fs.Path parent)
Get the full path

Parameters:
parent - the parent path
Returns:
the full path

getSymlink

public final String getSymlink()
Get the string representation of the symlink.

Returns:
the symlink as a string.

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException


Copyright © 2009 The Apache Software Foundation