Interface FsVolumeReference
- All Superinterfaces:
AutoCloseable,Closeable
This holds volume reference count as AutoClosable resource.
It increases the reference count by one in the constructor, and decreases
the reference count by one in
close().
try (FsVolumeReference ref = volume.obtainReference()) {
// Do IOs on the volume
volume.createRwb(...);
...
}
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Decrease the reference count of the volume.Returns the underlying volume object.
-
Method Details
-
close
Decrease the reference count of the volume.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- it never throws IOException.
-
getVolume
FsVolumeSpi getVolume()Returns the underlying volume object. Return null if the reference was released.
-