org.apache.hadoop.hdfs.protocol
Class DirectoryListing

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

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

This class defines a partial listing of a directory to support iterative directory listing.


Constructor Summary
DirectoryListing()
          default constructor
DirectoryListing(HdfsFileStatus[] partialListing, int remainingEntries)
          constructor
 
Method Summary
 byte[] getLastName()
          Get the last name in this list
 HdfsFileStatus[] getPartialListing()
          Get the partial listing of file status
 int getRemainingEntries()
          Get the number of remaining entries that are left to be listed
 boolean hasMore()
          Check if there are more entries that are left to be listed
 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
 

Constructor Detail

DirectoryListing

public DirectoryListing()
default constructor


DirectoryListing

public DirectoryListing(HdfsFileStatus[] partialListing,
                        int remainingEntries)
constructor

Parameters:
partialListing - a partial listing of a directory
remainingEntries - number of entries that are left to be listed
Method Detail

getPartialListing

public HdfsFileStatus[] getPartialListing()
Get the partial listing of file status

Returns:
the partial listing of file status

getRemainingEntries

public int getRemainingEntries()
Get the number of remaining entries that are left to be listed

Returns:
the number of remaining entries that are left to be listed

hasMore

public boolean hasMore()
Check if there are more entries that are left to be listed

Returns:
true if there are more entries that are left to be listed; return false otherwise.

getLastName

public byte[] getLastName()
Get the last name in this list

Returns:
the last name in the list if it is not empty; otherwise return null

readFields

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

write

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


Copyright © 2009 The Apache Software Foundation