TrueZIP Kernel 7.0-rc1

de.schlichtherle.truezip.fs
Class FsStatistics

java.lang.Object
  extended by de.schlichtherle.truezip.fs.FsStatistics

@ThreadSafe
public final class FsStatistics
extends Object

Provides statistics for the federated file systems managed by a single file system manager.

Author:
Christian Schlichtherle

Nested Class Summary
private  class FsStatistics.CountingInputStream
           
private  class FsStatistics.CountingOutputStream
           
private  class FsStatistics.CountingReadOnlyFile
           
 
Field Summary
private  FsStatisticsManager manager
           
private  long read
           
private  long written
           
 
Constructor Summary
FsStatistics(FsStatisticsManager manager)
           
 
Method Summary
(package private)  InputStream countBytes(InputStream in)
           
(package private)  OutputStream countBytes(OutputStream out)
           
(package private)  ReadOnlyFile countBytes(ReadOnlyFile rof)
           
 int getFileSystemsTotal()
          Returns the total number of managed federated file systems.
 int getFileSystemsTouched()
          Returns the number of managed federated file systems which have been touched and need synchronization by calling FsStatisticsManager.sync(de.schlichtherle.truezip.util.BitField, de.schlichtherle.truezip.util.ExceptionHandler).
 int getTopLevelFileSystemsTotal()
          Returns the total number of managed top level federated file systems.
 int getTopLevelFileSystemsTouched()
          Returns the number of managed top level federated file systems which have been touched and need synchronization by calling FsStatisticsManager.sync(de.schlichtherle.truezip.util.BitField, de.schlichtherle.truezip.util.ExceptionHandler).
 long getTopLevelRead()
          Returns the total number of bytes read from all managed top level federated file systems, i.e. all managed federated file systems which have a parent file system which is not a member of another parent file system.
 long getTopLevelWritten()
          Returns the total number of bytes written to all managed top level federated file systems, i.e. all managed federated file systems which have a parent file system which is not a member of another parent file system.
 boolean isClosed()
          Returns true iff this statistics instance has been closed and should not receive any more updates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

manager

private final FsStatisticsManager manager

read

private volatile long read

written

private volatile long written
Constructor Detail

FsStatistics

FsStatistics(FsStatisticsManager manager)
Method Detail

getFileSystemsTotal

public int getFileSystemsTotal()
Returns the total number of managed federated file systems.


getFileSystemsTouched

public int getFileSystemsTouched()
Returns the number of managed federated file systems which have been touched and need synchronization by calling FsStatisticsManager.sync(de.schlichtherle.truezip.util.BitField, de.schlichtherle.truezip.util.ExceptionHandler).

Note that you should not use the returned value to synchronize conditionally - this is unreliable!


getTopLevelFileSystemsTotal

public int getTopLevelFileSystemsTotal()
Returns the total number of managed top level federated file systems.


getTopLevelFileSystemsTouched

public int getTopLevelFileSystemsTouched()
Returns the number of managed top level federated file systems which have been touched and need synchronization by calling FsStatisticsManager.sync(de.schlichtherle.truezip.util.BitField, de.schlichtherle.truezip.util.ExceptionHandler).


countBytes

ReadOnlyFile countBytes(ReadOnlyFile rof)

countBytes

InputStream countBytes(InputStream in)

getTopLevelRead

public long getTopLevelRead()
Returns the total number of bytes read from all managed top level federated file systems, i.e. all managed federated file systems which have a parent file system which is not a member of another parent file system.

This method is intended to be used to monitor the progress of the method FsStatisticsManager.sync(de.schlichtherle.truezip.util.BitField, de.schlichtherle.truezip.util.ExceptionHandler).


countBytes

OutputStream countBytes(OutputStream out)

getTopLevelWritten

public long getTopLevelWritten()
Returns the total number of bytes written to all managed top level federated file systems, i.e. all managed federated file systems which have a parent file system which is not a member of another parent file system.

This method is intended to be used to monitor the progress of the method FsStatisticsManager.sync(de.schlichtherle.truezip.util.BitField, de.schlichtherle.truezip.util.ExceptionHandler).


isClosed

public boolean isClosed()
Returns true iff this statistics instance has been closed and should not receive any more updates.

Returns:
true iff this statistics instance has been closed and should not receive any more updates.

TrueZIP Kernel 7.0-rc1

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.