org.apache.hadoop.fs
Class LocatedFileStatus

java.lang.Object
  extended by org.apache.hadoop.fs.FileStatus
      extended by org.apache.hadoop.fs.LocatedFileStatus
All Implemented Interfaces:
Comparable, Writable

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class LocatedFileStatus
extends FileStatus

This class defines a FileStatus that includes a file's block locations.


Constructor Summary
LocatedFileStatus(FileStatus stat, BlockLocation[] locations)
          Constructor
LocatedFileStatus(long length, boolean isdir, int block_replication, long blocksize, long modification_time, long access_time, FsPermission permission, String owner, String group, Path symlink, Path path, BlockLocation[] locations)
          Constructor
 
Method Summary
 int compareTo(Object o)
          Compare this object to another object
 boolean equals(Object o)
          Compare if this object is equal to another object
 BlockLocation[] getBlockLocations()
          Get the file's block locations
 int hashCode()
          Returns a hash code value for the object, which is defined as the hash code of the path name.
 
Methods inherited from class org.apache.hadoop.fs.FileStatus
getAccessTime, getBlockSize, getGroup, getLen, getModificationTime, getOwner, getPath, getPermission, getReplication, getSymlink, isDir, isDirectory, isFile, isSymlink, readFields, setGroup, setOwner, setPath, setPermission, setSymlink, toString, write
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocatedFileStatus

public LocatedFileStatus(FileStatus stat,
                         BlockLocation[] locations)
                  throws IOException
Constructor

Parameters:
stat - a file status
locations - a file's block locations
Throws:
IOException

LocatedFileStatus

public LocatedFileStatus(long length,
                         boolean isdir,
                         int block_replication,
                         long blocksize,
                         long modification_time,
                         long access_time,
                         FsPermission permission,
                         String owner,
                         String group,
                         Path symlink,
                         Path path,
                         BlockLocation[] locations)
Constructor

Parameters:
length - a file's length
isdir - if the path is a directory
block_replication - the file's replication factor
blocksize - a file's block size
modification_time - a file's modification time
access_time - a file's access time
permission - a file's permission
owner - a file's owner
group - a file's group
symlink - symlink if the path is a symbolic link
path - the path's qualified name
locations - a file's block locations
Method Detail

getBlockLocations

public BlockLocation[] getBlockLocations()
Get the file's block locations

Returns:
the file's block locations

compareTo

public int compareTo(Object o)
Compare this object to another object

Specified by:
compareTo in interface Comparable
Overrides:
compareTo in class FileStatus
Parameters:
o - the object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
ClassCastException - if the specified object's is not of type FileStatus

equals

public boolean equals(Object o)
Compare if this object is equal to another object

Overrides:
equals in class FileStatus
Parameters:
o - the object to be compared.
Returns:
true if two file status has the same path name; false if not.

hashCode

public int hashCode()
Returns a hash code value for the object, which is defined as the hash code of the path name.

Overrides:
hashCode in class FileStatus
Returns:
a hash code value for the path name.


Copyright © 2013 Apache Software Foundation. All Rights Reserved.