Data Sync File System¶
Handlers for file system operations.
Handlers¶
GetDataPathStatsHandler- Retrieves statistics about data pathsListDataPathsHandler- Lists data pathsOutdatedDataPathScannerHandler- Scans for outdated data pathsRemoveDataPathsHandler- Removes data paths
File system operation handlers.
Provides Lambda handlers for file system operations including listing paths, getting statistics, scanning for outdated files, and removing paths.
GetDataPathStatsHandler
dataclass
¶
GetDataPathStatsHandler()
Bases: LambdaHandler[GetDataPathStatsRequest, GetDataPathStatsResponse]
Handler for retrieving statistics about a data path.
Returns size, modification time, and child path information.
handle ¶
handle(request)
Get statistics for the specified path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
GetDataPathStatsRequest
|
Request containing the path to analyze. |
required |
Returns:
| Type | Description |
|---|---|
GetDataPathStatsResponse
|
Response containing path statistics and child information. |
Source code in src/aibs_informatics_aws_lambda/handlers/data_sync/file_system.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
ListDataPathsHandler
dataclass
¶
ListDataPathsHandler()
Bases: LambdaHandler[ListDataPathsRequest, ListDataPathsResponse]
Handler for listing paths under a root directory.
Supports include and exclude patterns for filtering results.
handle ¶
handle(request)
List all paths under the specified root.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
ListDataPathsRequest
|
Request containing the root path and optional patterns. |
required |
Returns:
| Type | Description |
|---|---|
ListDataPathsResponse
|
Response containing the list of matching paths. |
Source code in src/aibs_informatics_aws_lambda/handlers/data_sync/file_system.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
OutdatedDataPathScannerHandler
dataclass
¶
OutdatedDataPathScannerHandler()
Bases: LambdaHandler[OutdatedDataPathScannerRequest, OutdatedDataPathScannerResponse]
Handler for scanning and identifying outdated data paths.
Identifies stale files based on last access time while respecting minimum size thresholds to maintain EFS throughput performance.
handle ¶
handle(request)
Scan for outdated paths to delete.
Uses a two-step process: 1. Identify stale nodes whose days_since_last_accessed exceeds the threshold. 2. Sort stale nodes oldest-first and select for deletion while maintaining the minimum size requirement.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
OutdatedDataPathScannerRequest
|
Request containing scan parameters. |
required |
Returns:
| Type | Description |
|---|---|
OutdatedDataPathScannerResponse
|
Response containing paths eligible for deletion. |
Source code in src/aibs_informatics_aws_lambda/handlers/data_sync/file_system.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | |
RemoveDataPathsHandler
dataclass
¶
RemoveDataPathsHandler()
Bases: LambdaHandler[RemoveDataPathsRequest, RemoveDataPathsResponse]
Handler for removing data paths.
Supports removing local paths and EFS paths. S3 path removal is not currently supported.
handle ¶
handle(request)
Remove the specified paths.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
RemoveDataPathsRequest
|
Request containing the list of paths to remove. |
required |
Returns:
| Type | Description |
|---|---|
RemoveDataPathsResponse
|
Response containing the total bytes removed and paths processed. |
Source code in src/aibs_informatics_aws_lambda/handlers/data_sync/file_system.py
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | |