|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.fs.FileSystem.Statistics
public static final class FileSystem.Statistics
Tracks statistics about how many reads, writes, and so forth have been done in a FileSystem. Since there is only one of these objects per FileSystem, there will typically be many threads writing to this object. Almost every operation on an open file will involve a write to this object. In contrast, reading statistics is done infrequently by most programs, and not at all by others. Hence, this is optimized for writes. Each thread writes to its own thread-local area of memory. This removes contention and allows us to scale up to many, many threads. To read statistics, the reader thread totals up the contents of all of the thread-local data areas.
Nested Class Summary | |
---|---|
static class |
FileSystem.Statistics.StatisticsData
Statistics data. |
Constructor Summary | |
---|---|
FileSystem.Statistics(FileSystem.Statistics other)
Copy constructor. |
|
FileSystem.Statistics(String scheme)
|
Method Summary | |
---|---|
long |
getBytesRead()
Get the total number of bytes read |
long |
getBytesWritten()
Get the total number of bytes written |
int |
getLargeReadOps()
Get the number of large file system read operations such as list files under a large directory |
int |
getReadOps()
Get the number of file system read operations such as list files |
String |
getScheme()
Get the uri scheme associated with this statistics object. |
FileSystem.Statistics.StatisticsData |
getThreadStatistics()
Get or create the thread-local data associated with the current thread. |
int |
getWriteOps()
Get the number of file system write operations such as create, append rename etc. |
void |
incrementBytesRead(long newBytes)
Increment the bytes read in the statistics |
void |
incrementBytesWritten(long newBytes)
Increment the bytes written in the statistics |
void |
incrementLargeReadOps(int count)
Increment the number of large read operations |
void |
incrementReadOps(int count)
Increment the number of read operations |
void |
incrementWriteOps(int count)
Increment the number of write operations |
void |
reset()
Resets all statistics to 0. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FileSystem.Statistics(String scheme)
public FileSystem.Statistics(FileSystem.Statistics other)
other
- The input Statistics object which is cloned.Method Detail |
---|
public FileSystem.Statistics.StatisticsData getThreadStatistics()
public void incrementBytesRead(long newBytes)
newBytes
- the additional bytes readpublic void incrementBytesWritten(long newBytes)
newBytes
- the additional bytes writtenpublic void incrementReadOps(int count)
count
- number of read operationspublic void incrementLargeReadOps(int count)
count
- number of large read operationspublic void incrementWriteOps(int count)
count
- number of write operationspublic long getBytesRead()
public long getBytesWritten()
public int getReadOps()
public int getLargeReadOps()
public int getWriteOps()
public String toString()
toString
in class Object
public void reset()
public String getScheme()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |