Package org.apache.hadoop.fs
Class FsStatus
java.lang.Object
org.apache.hadoop.fs.FsStatus
- All Implemented Interfaces:
Writable
This class is used to represent the capacity, free and used space on a
FileSystem.-
Constructor Summary
ConstructorsConstructorDescriptionFsStatus(long capacity, long used, long remaining) Construct a FsStatus object, using the specified statistics. -
Method Summary
Modifier and TypeMethodDescriptionlongReturn the capacity in bytes of the file system.longReturn the number of remaining bytes on the file system.longgetUsed()Return the number of bytes used on the file system.voidreadFields(DataInput in) Deserialize the fields of this object fromin.voidwrite(DataOutput out) Serialize the fields of this object toout.
-
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
Description copied from interface:WritableSerialize the fields of this object toout.- Specified by:
writein interfaceWritable- Parameters:
out-DataOuputto serialize this object into.- Throws:
IOException- any other problem for write.
-
readFields
Description copied from interface:WritableDeserialize the fields of this object fromin.For efficiency, implementations should attempt to re-use storage in the existing object where possible.
- Specified by:
readFieldsin interfaceWritable- Parameters:
in-DataInputto deseriablize this object from.- Throws:
IOException- any other problem for readFields.
-