Search in sources :

Example 1 with LocalFileSystemSizeVisitor

use of org.apache.ignite.internal.processors.igfs.secondary.local.LocalFileSystemSizeVisitor in project ignite by apache.

the class LocalIgfsSecondaryFileSystem method usedSpaceSize.

/** {@inheritDoc} */
@Override
public long usedSpaceSize() {
    Path p = fileForPath(IgfsPath.ROOT).toPath();
    try {
        LocalFileSystemSizeVisitor visitor = new LocalFileSystemSizeVisitor();
        Files.walkFileTree(p, visitor);
        return visitor.size();
    } catch (IOException e) {
        throw new IgfsException("Failed to calculate used space size.", e);
    }
}
Also used : IgfsPath(org.apache.ignite.igfs.IgfsPath) Path(java.nio.file.Path) LocalFileSystemSizeVisitor(org.apache.ignite.internal.processors.igfs.secondary.local.LocalFileSystemSizeVisitor) IgfsException(org.apache.ignite.igfs.IgfsException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 Path (java.nio.file.Path)1 IgfsException (org.apache.ignite.igfs.IgfsException)1 IgfsPath (org.apache.ignite.igfs.IgfsPath)1 LocalFileSystemSizeVisitor (org.apache.ignite.internal.processors.igfs.secondary.local.LocalFileSystemSizeVisitor)1