ch.systemsx.cisd.openbis.dss.generic.shared.utils
Class PostgresPlusFileSystemFreeSpaceProvider
java.lang.Object
ch.systemsx.cisd.openbis.dss.generic.shared.utils.PostgresPlusFileSystemFreeSpaceProvider
- All Implemented Interfaces:
- ch.systemsx.cisd.common.filesystem.IFreeSpaceProvider
public class PostgresPlusFileSystemFreeSpaceProvider
- extends java.lang.Object
- implements ch.systemsx.cisd.common.filesystem.IFreeSpaceProvider
PostgreSQL database files are designed to grow until they take up the entire available disk
space. It is therefore impossible to estimate what part of a hard disk is "free" by just asking
the file system.
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;"
Method Summary |
long |
freeSpaceKb(ch.systemsx.cisd.common.filesystem.HostAwareFile path)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PostgresPlusFileSystemFreeSpaceProvider
public PostgresPlusFileSystemFreeSpaceProvider(java.util.Properties properties)
freeSpaceKb
public long freeSpaceKb(ch.systemsx.cisd.common.filesystem.HostAwareFile path)
throws java.io.IOException
- Specified by:
freeSpaceKb
in interface ch.systemsx.cisd.common.filesystem.IFreeSpaceProvider
- Throws:
java.io.IOException