yifan-c commented on PR #212:
URL: 
https://github.com/apache/cassandra-sidecar/pull/212#issuecomment-2921198936

   > Making this change as part of 
[CEP-40](https://issues.apache.org/jira/browse/CASSSIDECAR-138).
   > 
   > Adding API for listing files of Cassnadra instance which is required 
during live migration.
   > 
   > [CASSSIDECAR-222](https://issues.apache.org/jira/browse/CASSSIDECAR-222)
   > 
   > Sample URL for listing files: 
`https://<host:port>/api/v1/live-migration/files-list`
   > 
   > Sample response:
   > 
   > ```
   > {
   >     "files": [
   >         {
   >             "fileUrl": 
"/api/v1/live-migration/files/data/0/system_schema/tables-afddfb9dbc1e30688056eed6c302ba09/nb-25-big-Filter.db",
   >             "size": 24,
   >             "fileType": "FILE",
   >             "lastModifiedTime": 1744296699193
   >         },
   >         {
   >             "fileUrl": 
"/api/v1/live-migration/files/data/0/system_schema/views-9786ac1cdd583201a7cdad556410c985",
   >             "size": -1,
   >             "fileType": "DIRECTORY",
   >             "lastModifiedTime": 1744012964644
   >         },
   >         {
   >             "fileUrl": 
"/api/v1/live-migration/files/data/0/system_schema/types-5a8b1ca866023f77a0459273d308917a",
   >             "size": -1,
   >             "fileType": "DIRECTORY",
   >             "lastModifiedTime": 1744012964611
   >         }
   >     ],
   >     "totalSize": 24
   > }
   > ```
   > 
   > fileUrl in above payload is in the format:
   > 
   > ```
   > /api/v1/live-migration/files/<directory_type>/<directory_index>/<relative 
path from the directory>
   > ```
   > 
   > fileUrl paths for different type of directories starts as follows:
   > 
   > ```
   > data file dir: /api/v1/live-migration/files/data/0 
   > # index will increase if C* instance has more data directories
   > # For example: path prefix for second data file directory will look like 
this
   > #   /api/v1/live-migration/files/data/1
   > 
   > commitlog dir: /api/v1/live-migration/files/commitlog/0
   > hints dir: /api/v1/live-migration/files/hints/0
   > saved caches dir: /api/v1/live-migration/files/saved_caches/0
   > cdc raw dir: /api/v1/live-migration/files/cdc_raw/0
   > local system data file dir: 
/api/v1/live-migration/files/local_system_data/0
   > ```
   > 
   > Will raise a separate PR for supporting endpoint: 
`/api/v1/live-migration/files/`
   > 
   > Admin can exclude files or directories from Live Migration. Excluded files 
will not be listed by this files list API. Exclusions can be specified in the 
sidecar yaml configuration using glob or regex patterns. Admin can also use 
placeholders for different type of directories to avoid specifying full 
directory paths.
   > 
   > Here are the different placeholders supported:
   > 
   > ```
   > COMMITLOG_DIR - commit log directory
   > HINTS_DIR - hints directory
   > SAVED_CACHES_DIR - saved caches directory
   > CDC_RAW_DIR - cdc raw directory
   > LOCAL_SYSTEM_DATA_FILE_DIR - local system data file data directory
   > DATA_FILE_DIR - all data directories
   > DATA_FILE_DIR_0 - first data directory
   > DATA_FILE_DIR_1 - second data directory
   > ```
   > 
   > Sample placeholder:
   > 
   > ```
   > # Pattern to exclude snapshots directories in data folder: 
   >     glob:${DATA_FILE_DIR}/*/*/snapshots/
   > ```
   
   Can you copy this API doc to the corresponding JIRA ticket for visibility 
purpose? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to