YDBCloudCorePipelineAlgorithm
NS_ENUM(NSInteger, YDBCloudCorePipelineAlgorithm) {
/**
* This is the default algorithm if you don't explicitly pick one.
* It is HIGHLY recommended you start with this algorithm, until you become more advanced.
*
* The "Commit Graph" algorithm works as follows:
*
* - all operations added within a specific commit are added to their own "graph"
* - the pipeline will execute each graph 1-at-a-time
* - this ensures that graphs are completed in commit order
*
* That is, if a pipeline contains 2 graphs:
* - graph "A" - representing operations from commit #32
* - graph "B" - represending operations from commit #33
*
* Then the pipeline will ensure that ALL operations from graphA are either completed or skipped
* before ANY operations from graphB start.
*
* This is the safest option because it means:
* - you only have to think about operation dependencies within the context of a single commit
* - the pipeline ensures the cloud moves from commit to commit (just as occurred locally)
*/
YDBCloudCorePipelineAlgorithm_CommitGraph = 0,
/**
* This is and ADVANCED algorithm that is only recommended after your cloud solution has matured.
*
* The "Flat Graph" algorithm works as follows:
*
* - all operations added within a specific commit are added to their own "graph"
* - HOWEVER, the pipeline is free to start operations from ANY graph
* - and it will do so, while respecting dependencies, priorities & maxConcurrentOperationCount
*
* In particular, what this means for you is:
*
* - you MUST create a FORMAL DEPENDENCY GRAPH (think: state diagram for dependencies)
*
* That is:
* - given any possible operation (opA) in commitA
* - and given any possible operation (opB) in commitB
* - your formal dependency graph must determine if opB should depend on opA
*
* The recommended way of implementing your formal dependency graph is by
* subclassing YapDatabaseCloudCoreTransaction & overriding the various subclass hooks, such as:
* - willAddOperation:inPipeline:withGraphIdx:
* - willInsertOperation:inPipeline:withGraphIdx:
* - willModifyOperation:inPipeline:withGraphIdx:
*/
YDBCloudCorePipelineAlgorithm_FlatGraph = 1
}
Undocumented
-
This is the default algorithm if you don’t explicitly pick one. It is HIGHLY recommended you start with this algorithm, until you become more advanced.
The
Commit Graph
algorithm works as follows:- all operations added within a specific commit are added to their own
graph
- the pipeline will execute each graph 1-at-a-time
- this ensures that graphs are completed in commit order
That is, if a pipeline contains 2 graphs:
- graph
A
- representing operations from commit #32 - graph
B
- represending operations from commit #33
Then the pipeline will ensure that ALL operations from graphA are either completed or skipped before ANY operations from graphB start.
This is the safest option because it means:
- you only have to think about operation dependencies within the context of a single commit
- the pipeline ensures the cloud moves from commit to commit (just as occurred locally)
Declaration
Objective-C
YDBCloudCorePipelineAlgorithm_CommitGraph = 0
Swift
case commitGraph = 0
- all operations added within a specific commit are added to their own
-
This is and ADVANCED algorithm that is only recommended after your cloud solution has matured.
The
Flat Graph
algorithm works as follows:- all operations added within a specific commit are added to their own
graph
- HOWEVER, the pipeline is free to start operations from ANY graph
- and it will do so, while respecting dependencies, priorities & maxConcurrentOperationCount
In particular, what this means for you is:
- you MUST create a FORMAL DEPENDENCY GRAPH (think: state diagram for dependencies)
That is:
- given any possible operation (opA) in commitA
- and given any possible operation (opB) in commitB
- your formal dependency graph must determine if opB should depend on opA
The recommended way of implementing your formal dependency graph is by subclassing YapDatabaseCloudCoreTransaction & overriding the various subclass hooks, such as:
- willAddOperation:inPipeline:withGraphIdx:
- willInsertOperation:inPipeline:withGraphIdx:
- willModifyOperation:inPipeline:withGraphIdx:
Declaration
Objective-C
YDBCloudCorePipelineAlgorithm_FlatGraph = 1
Swift
case flatGraph = 1
- all operations added within a specific commit are added to their own