Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spelling #234

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ The four common database operations are outlined below:
15. The `Dirty` file is removed for the snapshot.

The above is performed for a single transaction, so multiple updates can take
advantage of this and be written at the same time. Updated made without
advantage of this and be written at the same time. Updates made without
a transaction are performed within one automatically, though these edits may
be coalesced if they happen between writes to disk from multiple sources.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ are themselves copied from backups, making sure that they don't inadvertedly
change.

Backups utilize file-system block sharing when available, such as on APFS, and
as such should be a relatively cheap operating to complete.
as such should be a relatively cheap operation to complete.

### Snapshots

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ extension DiskPersistence {
// MARK: - Common URL Accessors

extension DiskPersistence.Datastore {
/// The URL that points to the Snapshot directory.
/// The URL that points to the Datastore directory.
nonisolated var datastoreURL: URL {
snapshot
.datastoresURL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public actor DiskPersistence<AccessMode: _AccessMode>: Persistence {
}

// MARK: - Default Store

extension DiskPersistence where AccessMode == ReadWrite {
/// The default persistence for the read-write store of an app.
public static func defaultStore() throws -> DiskPersistence<AccessMode> {
Expand All @@ -116,6 +117,7 @@ extension DiskPersistence where AccessMode == ReadOnly {
}

// MARK: - Common URL Accessors

extension DiskPersistence {
/// The URL that points to the Snapshots directory.
nonisolated var snapshotsURL: URL {
Expand All @@ -134,6 +136,7 @@ extension DiskPersistence {
}

// MARK: - Store Info

extension DiskPersistence {
/// Load the store info from disk, or create a suitable starting value if such a file does not exist.
private func loadStoreInfo() throws -> StoreInfo {
Expand Down Expand Up @@ -278,6 +281,7 @@ extension DiskPersistence {
}

// MARK: - Snapshot Management

extension DiskPersistence {
/// Load the default snapshot from disk, or create an empty one if such a file does not exist.
private func loadSnapshot(from storeInfo: StoreInfo) -> Snapshot<AccessMode> {
Expand Down Expand Up @@ -376,7 +380,8 @@ extension DiskPersistence {
}
}

// MARK: - Persisitence Creation
// MARK: - Persistence Creation

extension DiskPersistence where AccessMode == ReadWrite {
/// Create directories for our persistence.
private func createPersistenceDirectories() throws {
Expand Down Expand Up @@ -427,7 +432,7 @@ extension DiskPersistence {
}

if Access.self == ReadWrite.self, weakDatastore.canWrite {
assertionFailure("An existing datastore that can write to the persistence has already been registered for this key. Only one writer is suppored per key. This will throw an error on release builds.")
assertionFailure("An existing datastore that can write to the persistence has already been registered for this key. Only one writer is supported per key. This will throw an error on release builds.")
throw DatastoreInterfaceError.duplicateWriters
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ actor Snapshot<AccessMode: _AccessMode> {

/// A flag indicating if this is a backup snapshot.
///
/// This is used to determine where on disk the snapshot is stored.
/// This is used to determine which parent directory on disk the snapshot is stored.
let isBackup: Bool

/// A cached instance of the manifest as last loaded from disk.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ extension SnapshotIteration {
}

extension SnapshotIteration {
/// Internal method to check if an instance should be persisted based on iff it changed significantly from a previous iteration
/// - Parameter existingInstance: The previous iteration to check
/// - Returns: `true` if the iteration should be persisted, `false` if it represents the same data from `existingInstance`.
func isMeaningfullyChanged(from existingInstance: Self?) -> Bool {
guard
dataStores == existingInstance?.dataStores
Expand Down
Loading