Class InMemoryPersistenceSpi
- java.lang.Object
-
- org.projectnessie.gc.contents.inmem.InMemoryPersistenceSpi
-
- All Implemented Interfaces:
PersistenceSpi
public class InMemoryPersistenceSpi extends java.lang.Object implements PersistenceSpi
A non-productionPersistenceSpiimplementation that keeps all information in memory.
-
-
Constructor Summary
Constructors Constructor Description InMemoryPersistenceSpi()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longaddFileDeletions(java.util.UUID liveSetId, java.util.stream.Stream<FileReference> files)Records the given files to be later returned byPersistenceSpi.fetchFileDeletions(UUID), ignores duplicates.longaddIdentifiedLiveContent(@NotNull @NotNull java.util.UUID liveSetId, @NotNull @NotNull java.util.stream.Stream<ContentReference> contentReference)voidassociateBaseLocations(java.util.UUID liveSetId, java.lang.String contentId, java.util.Collection<java.net.URI> baseLocations)voiddeleteLiveContentSet(java.util.UUID liveSetId)java.util.stream.Stream<java.net.URI>fetchAllBaseLocations(java.util.UUID liveSetId)java.util.stream.Stream<java.net.URI>fetchBaseLocations(java.util.UUID liveSetId, java.lang.String contentId)java.util.stream.Stream<java.lang.String>fetchContentIds(@NotNull @NotNull java.util.UUID liveSetId)java.util.stream.Stream<ContentReference>fetchContentReferences(@NotNull @NotNull java.util.UUID liveSetId, @NotNull @NotNull java.lang.String contentId)longfetchDistinctContentIdCount(@NotNull @NotNull java.util.UUID liveSetId)java.util.stream.Stream<FileReference>fetchFileDeletions(java.util.UUID liveSetId)Returns thePersistenceSpi.addFileDeletions(UUID, Stream)recorded file deletions (aka deferred deletes) grouped by base path.LiveContentSetfinishedExpireContents(@NotNull @NotNull java.util.UUID liveSetId, @NotNull @NotNull java.time.Instant finished, java.lang.Throwable failure)voidfinishedIdentifyLiveContents(@NotNull @NotNull java.util.UUID liveSetId, @NotNull @NotNull java.time.Instant finished, java.lang.Throwable failure)java.util.stream.Stream<LiveContentSet>getAllLiveContents()LiveContentSetgetLiveContentSet(@NotNull @NotNull java.util.UUID liveSetId)LiveContentSetstartExpireContents(@NotNull @NotNull java.util.UUID liveSetId, @NotNull @NotNull java.time.Instant started)voidstartIdentifyLiveContents(@NotNull @NotNull java.util.UUID liveSetId, @NotNull @NotNull java.time.Instant created)
-
-
-
Method Detail
-
addIdentifiedLiveContent
public long addIdentifiedLiveContent(@NotNull @NotNull @NotNull @NotNull java.util.UUID liveSetId, @NotNull @NotNull @NotNull @NotNull java.util.stream.Stream<ContentReference> contentReference)- Specified by:
addIdentifiedLiveContentin interfacePersistenceSpi
-
startIdentifyLiveContents
public void startIdentifyLiveContents(@NotNull @NotNull @NotNull @NotNull java.util.UUID liveSetId, @NotNull @NotNull @NotNull @NotNull java.time.Instant created)- Specified by:
startIdentifyLiveContentsin interfacePersistenceSpi
-
finishedIdentifyLiveContents
public void finishedIdentifyLiveContents(@NotNull @NotNull @NotNull @NotNull java.util.UUID liveSetId, @NotNull @NotNull @NotNull @NotNull java.time.Instant finished, @Nullable @Nullable java.lang.Throwable failure)- Specified by:
finishedIdentifyLiveContentsin interfacePersistenceSpi
-
startExpireContents
public LiveContentSet startExpireContents(@NotNull @NotNull @NotNull @NotNull java.util.UUID liveSetId, @NotNull @NotNull @NotNull @NotNull java.time.Instant started)
- Specified by:
startExpireContentsin interfacePersistenceSpi
-
finishedExpireContents
public LiveContentSet finishedExpireContents(@NotNull @NotNull @NotNull @NotNull java.util.UUID liveSetId, @NotNull @NotNull @NotNull @NotNull java.time.Instant finished, @Nullable @Nullable java.lang.Throwable failure)
- Specified by:
finishedExpireContentsin interfacePersistenceSpi
-
getLiveContentSet
public LiveContentSet getLiveContentSet(@NotNull @NotNull @NotNull @NotNull java.util.UUID liveSetId) throws LiveContentSetNotFoundException
- Specified by:
getLiveContentSetin interfacePersistenceSpi- Throws:
LiveContentSetNotFoundException
-
fetchDistinctContentIdCount
public long fetchDistinctContentIdCount(@NotNull @NotNull @NotNull @NotNull java.util.UUID liveSetId)- Specified by:
fetchDistinctContentIdCountin interfacePersistenceSpi
-
fetchContentIds
public java.util.stream.Stream<java.lang.String> fetchContentIds(@NotNull @NotNull @NotNull @NotNull java.util.UUID liveSetId)- Specified by:
fetchContentIdsin interfacePersistenceSpi
-
fetchContentReferences
public java.util.stream.Stream<ContentReference> fetchContentReferences(@NotNull @NotNull @NotNull @NotNull java.util.UUID liveSetId, @NotNull @NotNull @NotNull @NotNull java.lang.String contentId)
- Specified by:
fetchContentReferencesin interfacePersistenceSpi
-
associateBaseLocations
public void associateBaseLocations(java.util.UUID liveSetId, java.lang.String contentId, java.util.Collection<java.net.URI> baseLocations)- Specified by:
associateBaseLocationsin interfacePersistenceSpi
-
fetchBaseLocations
public java.util.stream.Stream<java.net.URI> fetchBaseLocations(java.util.UUID liveSetId, java.lang.String contentId)- Specified by:
fetchBaseLocationsin interfacePersistenceSpi
-
fetchAllBaseLocations
public java.util.stream.Stream<java.net.URI> fetchAllBaseLocations(java.util.UUID liveSetId)
- Specified by:
fetchAllBaseLocationsin interfacePersistenceSpi
-
deleteLiveContentSet
public void deleteLiveContentSet(java.util.UUID liveSetId)
- Specified by:
deleteLiveContentSetin interfacePersistenceSpi
-
getAllLiveContents
public java.util.stream.Stream<LiveContentSet> getAllLiveContents()
- Specified by:
getAllLiveContentsin interfacePersistenceSpi
-
addFileDeletions
public long addFileDeletions(java.util.UUID liveSetId, java.util.stream.Stream<FileReference> files)Description copied from interface:PersistenceSpiRecords the given files to be later returned byPersistenceSpi.fetchFileDeletions(UUID), ignores duplicates.- Specified by:
addFileDeletionsin interfacePersistenceSpi- Returns:
- the number of actually added files
-
fetchFileDeletions
public java.util.stream.Stream<FileReference> fetchFileDeletions(java.util.UUID liveSetId)
Description copied from interface:PersistenceSpiReturns thePersistenceSpi.addFileDeletions(UUID, Stream)recorded file deletions (aka deferred deletes) grouped by base path.- Specified by:
fetchFileDeletionsin interfacePersistenceSpi
-
-