Interface Backend
- All Superinterfaces:
AutoCloseable
Provides "low-level" access to the database-specific backend.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceCallback interface forscanBackend(ReferenceScanCallback, ObjScanCallback).static interfaceCallback interface forscanBackend(ReferenceScanCallback, ObjScanCallback). -
Method Summary
Modifier and TypeMethodDescriptionvoidbatchDeleteObjs(Map<String, Set<PersistId>> realmObjs) Bulk object-part deletion, grouped by realm.voidbatchDeleteRefs(Map<String, Set<String>> realmRefs) Bulk reference deletion, grouped by realm.booleanconditionalDelete(@NonNull String realmId, @NonNull PersistId persistId, @NonNull String expectedToken) booleanconditionalInsert(@NonNull String realmId, String objTypeId, @NonNull PersistId persistId, long createdAtMicros, @NonNull String versionToken, @org.jspecify.annotations.NonNull byte[] serializedValue) booleanconditionalUpdate(@NonNull String realmId, String objTypeId, @NonNull PersistId persistId, long createdAtMicros, @NonNull String updateToken, @NonNull String expectedToken, @org.jspecify.annotations.NonNull byte[] serializedValue) booleancreateReference(@NonNull String realmId, @NonNull Reference newRef) voidcreateReferences(@NonNull String realmId, @NonNull List<Reference> newRefs) voidvoiddeleteRealms(Set<String> realmIds) Delete the given realms.@NonNull Map<PersistId, FetchedObj> @NonNull ReferencefetchReference(@NonNull String realmId, @NonNull String name) @NonNull PersistencenewPersistence(Function<Backend, Backend> backendWrapper, @NonNull PersistenceParams persistenceParams, String realmId, org.apache.polaris.ids.api.MonotonicClock monotonicClock, org.apache.polaris.ids.api.IdGenerator idGenerator) voidscanBackend(@NonNull Backend.ReferenceScanCallback referenceConsumer, @NonNull Backend.ObjScanCallback objConsumer) Scan the whole backend database and return each discovered reference and object-part via the provided callbacks.Called to set up the database schema.booleanWhether the implementation supportsdeleteRealms(Set).@NonNull Stringtype()Name of this backend.booleanupdateReference(@NonNull String realmId, @NonNull Reference updatedRef, @NonNull Optional<ObjRef> expectedPointer) voidMethods inherited from interface java.lang.AutoCloseable
close
-
Method Details
-
type
@NonNull String type()Name of this backend. This value serves as an identifier to select the correct backend. -
setupSchema
Called to set up the database schema.- Returns:
- optional, human-readable information
-
newPersistence
@NonNull Persistence newPersistence(Function<Backend, Backend> backendWrapper, @NonNull PersistenceParams persistenceParams, String realmId, org.apache.polaris.ids.api.MonotonicClock monotonicClock, org.apache.polaris.ids.api.IdGenerator idGenerator) -
supportsRealmDeletion
boolean supportsRealmDeletion()Whether the implementation supportsdeleteRealms(Set). -
deleteRealms
Delete the given realms.This function works, if
supportsRealmDeletion()yieldstrue.Throws an
UnsupportedOperationException, ifsupportsRealmDeletion()yieldsfalse. -
batchDeleteRefs
Bulk reference deletion, grouped by realm. This functionality is primarily needed for the maintenance service. -
batchDeleteObjs
Bulk object-part deletion, grouped by realm. This functionality is primarily needed for the maintenance service. -
scanBackend
void scanBackend(@NonNull Backend.ReferenceScanCallback referenceConsumer, @NonNull Backend.ObjScanCallback objConsumer) Scan the whole backend database and return each discovered reference and object-part via the provided callbacks. This functionality is primarily needed for the maintenance service. -
createReference
-
createReferences
-
updateReference
-
fetchReference
-
fetch
-
write
-
delete
-
conditionalInsert
-
conditionalUpdate
-
conditionalDelete
-