|
72 | 72 | import java.util.function.ToLongFunction; |
73 | 73 |
|
74 | 74 | /** |
75 | | - * Transport Action for get snapshots operation |
| 75 | + * Transport action for get-snapshots API |
76 | 76 | */ |
77 | 77 | public class TransportGetSnapshotsAction extends TransportMasterNodeAction<GetSnapshotsRequest, GetSnapshotsResponse> { |
78 | 78 |
|
@@ -183,6 +183,73 @@ protected void masterOperation( |
183 | 183 | * results. |
184 | 184 | */ |
185 | 185 | private class GetSnapshotsOperation { |
| 186 | + /* |
| 187 | + * Overall (conceptual) dataflow: |
| 188 | + * |
| 189 | + * All snapshots (in requested repositories) |
| 190 | + * | |
| 191 | + * +----------------------------------X ?from_sort_value (when ?sort = repo) |
| 192 | + * | |
| 193 | + * +--> In-progress snapshots |
| 194 | + * | | |
| 195 | + * | +------------------------X snapshotNamePredicate (requested names/wildcards) |
| 196 | + * | | |
| 197 | + * | +--> Synthesize SnapshotInfos for in-progress snapshots --------------------------+ |
| 198 | + * | | |
| 199 | + * +--> Completed snapshots | |
| 200 | + * | | |
| 201 | + * +---------------------X Skipped as also in-progress | |
| 202 | + * +---------------------X snapshotNamePredicate (requested names/wildcards) | |
| 203 | + * +---------------------X ?from_sort_value (when ?sort = name) | |
| 204 | + * | | |
| 205 | + * +--> Look up SnapshotDetails | |
| 206 | + * | | |
| 207 | + * | Preflight filtering (may be incomplete) | |
| 208 | + * +---------------X ?from_sort_value (when ?sort = start/duration/indices) | |
| 209 | + * +---------------X ?state | |
| 210 | + * +---------------X ?slm_policy_filter | |
| 211 | + * | | |
| 212 | + * | | |
| 213 | + * | | |
| 214 | + * | We might be able to tell here if it'll pass real filtering | |
| 215 | + * | but be skipped due to ?after, so we could add it to total | |
| 216 | + * | and then skip loading its SnapshotInfo (TODO). | |
| 217 | + * | | |
| 218 | + * | We might be able to tell here if it'll pass real filtering | |
| 219 | + * | and ?after but there will be ≥offset+size earlier-sorting | |
| 220 | + * | snapshots so we could add it to total & remaining and skip | |
| 221 | + * | loading its SnapshotInfo (TODO). | |
| 222 | + * | | |
| 223 | + * | Harder: we might even be able to tell here if it'll pass | |
| 224 | + * | real filtering and ?after but there will be <offset | |
| 225 | + * | earlier-sorting snapshots so we could add it to total and | |
| 226 | + * | then skip loading its SnapshotInfo (TODO). | |
| 227 | + * | | |
| 228 | + * | | |
| 229 | + * | | |
| 230 | + * +--> Load SnapshotInfos for completed snapshots -------------------------+ |
| 231 | + * | |
| 232 | + * SnapshotInfos (merged) <-------------------------------------------------------------------------+ |
| 233 | + * | |
| 234 | + * | Real filtering (for when SnapshotDetails incomplete/insufficient) |
| 235 | + * +----------------------------------X ?from_sort_value |
| 236 | + * +----------------------------------X ?state |
| 237 | + * +----------------------------------X ?slm_policy_filter |
| 238 | + * | |
| 239 | + * +--> Counted in total |
| 240 | + * | |
| 241 | + * +----------------------------X Skipped due to ?after |
| 242 | + * | |
| 243 | + * +---> Not already returned - added to SnapshotInfoCollector |
| 244 | + * | |
| 245 | + * +----------------------X Skipped due to ?offset |
| 246 | + * +--------------------------------------------------------------------------------+ |
| 247 | + * +----------------------X Omitted due to ?size (counted in remaining) | |
| 248 | + * | |
| 249 | + * | |
| 250 | + * RESULTS <-------------------------------------------+ |
| 251 | + */ |
| 252 | + |
186 | 253 | private final CancellableTask cancellableTask; |
187 | 254 |
|
188 | 255 | private final ProjectId projectId; |
|
0 commit comments