Search in sources :

Example 1 with IDeallocatable

use of org.apache.hyracks.api.resources.IDeallocatable in project asterixdb by apache.

the class WorkspaceFileFactory method createManagedWorkspaceFile.

@Override
public FileReference createManagedWorkspaceFile(String prefix) throws HyracksDataException {
    final FileReference fRef = ioManager.createWorkspaceFile(prefix);
    registry.registerDeallocatable(new IDeallocatable() {

        @Override
        public void deallocate() {
            // Delete the created managed file.
            FileUtils.deleteQuietly(fRef.getFile());
        }
    });
    return fRef;
}
Also used : FileReference(org.apache.hyracks.api.io.FileReference) IDeallocatable(org.apache.hyracks.api.resources.IDeallocatable)

Aggregations

FileReference (org.apache.hyracks.api.io.FileReference)1 IDeallocatable (org.apache.hyracks.api.resources.IDeallocatable)1