Interface SnapshotPath
- All Known Implementing Classes:
EncryptedSnapshotPath,LocalSnapshotPath
public interface SnapshotPath
Represents a snapshot's partition file.
Locks are not used as concurrent reading and writing of the same file shouldn't happen by design. Only concurrent reads during restoration of the single-copy snapshot are possible.
-
Method Summary
Modifier and TypeMethodDescriptionOpens a channel to read the object identified by this path.uri()Returns URI of the object identified by this path.Opens a channel to write the object identified by this path.
-
Method Details
-
readChannel
CompletableFuture<ReadableByteChannel> readChannel()Opens a channel to read the object identified by this path.The channel should be closed in futures chain.
- Returns:
- Completable future with readable channel.
-
writeChannel
CompletableFuture<WritableByteChannel> writeChannel()Opens a channel to write the object identified by this path.Creates the object if it does not exist.
The channel should be closed in futures chain.
Closing the channel ensures that the data has been saved durably on the underlying storage.
- Returns:
- Completable future with writable channel.
-
uri
URI uri()Returns URI of the object identified by this path.
-