Class FsStatus

java.lang.Object
org.apache.hadoop.fs.FsStatus
All Implemented Interfaces:
Writable

@Public @Stable public class FsStatus extends Object implements Writable
This class is used to represent the capacity, free and used space on a FileSystem.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FsStatus(long capacity, long used, long remaining)
    Construct a FsStatus object, using the specified statistics.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Return the capacity in bytes of the file system.
    long
    Return the number of remaining bytes on the file system.
    long
    Return the number of bytes used on the file system.
    void
    Deserialize the fields of this object from in.
    void
    Serialize the fields of this object to out.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FsStatus

      public FsStatus(long capacity, long used, long remaining)
      Construct a FsStatus object, using the specified statistics.
      Parameters:
      capacity - capacity.
      used - used.
      remaining - remaining.
  • Method Details

    • getCapacity

      public long getCapacity()
      Return the capacity in bytes of the file system.
      Returns:
      capacity.
    • getUsed

      public long getUsed()
      Return the number of bytes used on the file system.
      Returns:
      used.
    • getRemaining

      public long getRemaining()
      Return the number of remaining bytes on the file system.
      Returns:
      remaining.
    • write

      public void write(DataOutput out) throws IOException
      Description copied from interface: Writable
      Serialize the fields of this object to out.
      Specified by:
      write in interface Writable
      Parameters:
      out - DataOuput to serialize this object into.
      Throws:
      IOException - any other problem for write.
    • readFields

      public void readFields(DataInput in) throws IOException
      Description copied from interface: Writable
      Deserialize the fields of this object from in.

      For efficiency, implementations should attempt to re-use storage in the existing object where possible.

      Specified by:
      readFields in interface Writable
      Parameters:
      in - DataInput to deseriablize this object from.
      Throws:
      IOException - any other problem for readFields.