You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Find the correct SPP snapshot file from S3 manifest metadata, based on date, version,
3
+
and filename pattern.
4
+
5
+
1. Get all manifest files from S3 with a given prefix (filepath).
6
+
- Use S3 client to list all files ending with ".mani" under the prefix.
7
+
- Store as {filename: last_modified_date}, sorted by date descending.
8
+
9
+
2. Filter manifest files by substring
10
+
- Use substring search to obtain files relating to the correct survey and survey year
11
+
12
+
3. If required, get the most recent modified date and check files modified this date.
13
+
- Read metadata for all files modified this date
14
+
- Check whether the spp created date is the same for each file
15
+
- Check whether other metadata is valid for each file
16
+
- Create a list of candidate files with their metadata
17
+
18
+
4. If a specified date was given, check all files modified this date.
19
+
- Read metadata for all files modified this date
20
+
- Check whether the spp created date is the same date for each file
21
+
- Check whether other metadata is valid for each file
22
+
- Create a list of candidate files with their metadata
23
+
24
+
5. If the created date for a file is earlier than it's modified date (it can't be later)
25
+
- Save the created date in a "most recent created" variable
26
+
- Continue the loop through files to the next most recent modified file and onwards
27
+
- If a created date is found that is more recent than that in the "most recent created" varible, and the modified date is the same, that is the candidate.
28
+
- When the next most recent modified file is modified after the "most recent
29
+
created" date, the "most recent created" date is the candidate.
30
+
- All files created on a "most recent created" date are candidates.
31
+
32
+
6. From candidate files:
33
+
- If multiple, select the most recent by last_modified_date.
34
+
- If multiple with same filename, select the one with the highest version.
35
+
36
+
7. Return the chosen snapshot filename, version, and created date.
37
+
- Conditionally return file info for the most recent date
38
+
- Conditionally return file info for specified date
0 commit comments