presto-main/src/main/java/io/prestosql/spiller/FileSingleStreamSpillerFactory.java/FileSingleStreamSpillerFactory/hasEnoughDiskSpace
class FileSingleStreamSpillerFactory:    private boolean hasEnoughDiskSpace(Path path)
    {
        try {
            FileStore fileStore = getFileStore(path);
            return fileStore.getUsableSpace() > fileStore.getTotalSpace() * (1.0 - maxUsedSpaceThreshold);
        }
        catch (IOException e) {
            throw new PrestoException(OUT_OF_SPILL_SPACE, "Cannot determine free space for spill", e);
        }
    }