public class PostgresPlusFileSystemFreeSpaceProvider
extends java.lang.Object
implements ch.systemsx.cisd.common.filesystem.IFreeSpaceProvider
The PostgresPlusFileSystemFreeSpaceProvider estimates the free space on a drive as the
sum of the free disk space and the free space of a PostgreSQL database as returned by its
"pgstattuple" extension.
IMPORTANT: The class requires that the extension 'pgstattuple' is installed on the target
PostgreSQL database. For PostgreSQL 9.1 this can be done by executing :
psql -d DB_NAME -c "CREATE EXTENSION pgstattuple;"| Constructor and Description |
|---|
PostgresPlusFileSystemFreeSpaceProvider(java.util.Properties properties) |
| Modifier and Type | Method and Description |
|---|---|
long |
freeSpaceKb(ch.systemsx.cisd.common.filesystem.HostAwareFile path)
Returns the free space on a drive or volume in kilobytes by invoking the command line.
|
public PostgresPlusFileSystemFreeSpaceProvider(java.util.Properties properties)
public long freeSpaceKb(ch.systemsx.cisd.common.filesystem.HostAwareFile path)
throws java.io.IOException
ch.systemsx.cisd.common.filesystem.IFreeSpaceProviderfreeSpaceKb in interface ch.systemsx.cisd.common.filesystem.IFreeSpaceProviderjava.io.IOException