Remote
Reusable synchronization state for one remote.
A remote is the shared database copy described in Concepts. You own the PLKRemote and can share it among databases and snapshots. Closing a database or snapshot never closes its remote. The remote refuses to close while any open database or snapshot uses it.
At a glance
Section titled “At a glance”Construct
remote– Open a directory remote rooted atFrom Directory: options: error: path.remote– Wrap a caller-supplied storage adapter as a remote.From Storage: options: error:
Inspect
status– Return a typedWith Error: PLKRemoteStatussnapshot of remote-owned state only.
Maintain storage
collect:Advanced – Collect retired revisions under an explicit retention policy and return aerror: PLKCollectionReport.recoverAdvanced – Reopen a remote that an interrupted collection left cleaning.Abandoned Collection With Error:
Close
close– Close the remote.With Error:
Construct
Section titled “Construct”remoteFromDirectory:options:error:
Section titled “remoteFromDirectory:options:error:”Open a directory remote rooted at path.
The directory is created on first use. Default options use readConcurrency 32 and bounded retention.
remoteFromStorage:options:error:
Section titled “remoteFromStorage:options:error:”Wrap a caller-supplied storage adapter as a remote.
storage implements the bucket storage protocol beneath the storage entry points. This is an integrator API. The S3 adapter is one implementation. Closing the remote never closes the adapter’s underlying transport for you.
Integrator API. This member exists for code that supplies its own storage transport. Application code reaches a bucket through [PLKStorage remoteFromS3Bucket:, [PLKStorage remoteFromGCSBucket: and [PLKStorage remoteFromAzureAccount:.
Inspect
Section titled “Inspect”statusWithError:
Section titled “statusWithError:”Return a typed PLKRemoteStatus snapshot of remote-owned state only.
Maintain storage
Section titled “Maintain storage”collect:error:
Section titled “collect:error:”Advanced
Collect retired revisions under an explicit retention policy and return a PLKCollectionReport.
Collection starts only above the retained target. It never touches the current head. Concepts explains retention and collection.
recoverAbandonedCollectionWithError:
Section titled “recoverAbandonedCollectionWithError:”Advanced
Reopen a remote that an interrupted collection left cleaning.
Collection is interrupted if any of these occurs:
- Its process stops.
- It cannot learn whether its opening head swap took effect.
- Storage fails both a sweep step and its closing head swap.
Until the head reopens, every synchronization and new device initialization fails with temporarily_.
The next collection completes the sweep. If the head is open, this changes nothing and reports aborted. If there is no head, this changes nothing. It never retires a revision.
This operation is separate from collect:error:. An accidental flag therefore cannot request recovery.
closeWithError:
Section titled “closeWithError:”Close the remote. Repeated calls have the same effect.
closeWithError: fails with invalid_state while an open database or snapshot uses this remote. Refusal changes no state.