adoroszlai opened a new pull request, #8413:
URL: https://github.com/apache/ozone/pull/8413

   ## What changes were proposed in this pull request?
   
   Improve `ListOptions` for better reuse.
   
   `ListOptions` currently provides the following options:
   
   ```
     -a, --all                 List all results
     -l, --length=<limit>      Maximum number of items to list
                                 Default: 100
     -p, --prefix=<prefix>     Prefix to filter the items
     -s, --start=<startItem>   The item to start the listing from.
                               This will be excluded from the result.
   ```
   
   This change:
   - extract `--prefix` (to `PrefixFilterOption`) to allow using `ListOptions` 
in commands with different / more complex filters (e.g. datanode list can 
filter by hostname, IP or ID)
   - rename `ListOptions` to `ListPaginationOptions`
   - create separate class `ListLimitOptions` for grouping `--length` and 
`--all`, since `--start` is not supported by `ozone admin nssummary` and `ozone 
debug log container list`
   - reuse `ListLimitOptions` in `ListPaginationOptions`
   
   https://issues.apache.org/jira/browse/HDDS-12995
   
   ## How was this patch tested?
   
   `ozone debug log container list` no longer shows `--start` or `--prefix`, 
but shows limit options (`--length` and `--all`):
   
   ```
   $ ozone debug log container list --help
   Usage: ozone debug log container list [-hV] [--verbose] [--db=<dbPath>]
                                         --state=<state> [[-l=<limit>] | [-a]]
   Finds containers from the database based on the option provided.
     -a, --all              List all results
         --db=<dbPath>      Path to the SQLite database file where the parsed
                              information from logs is stored.
     -h, --help             Show this help message and exit.
     -l, --length=<limit>   Maximum number of items to list
                              Default: 100
         --state=<state>    Life cycle state of the container.
     -V, --version          Print version information and exit.
         --verbose          More verbose output. Show the stack trace of the
                              errors.
   ```
   
   `ozone sh snapshot listDiff` no longer mentions `--prefix`, but shows 
pagination options:
   
   ```
   $ ozone sh snapshot listDiff --help
   Usage: ozone sh snapshot listDiff [-hV] [--all-status] [--verbose]
                                     [--job-status=<jobStatus>] [-s=<startItem>]
                                     [[-l=<limit>] | [-a]] <value>
   List snapshotDiff jobs for a bucket.
         <value>               URI of the bucket (format: volume/bucket).
                               Ozone URI could either be a full URI or short 
URI.
                               Full URI should start with o3://, in case of 
non-HA
                               clusters it should be followed by the host name 
and
                               optionally the port number. In case of HA 
clusters
                               the service id should be used. Service id 
provides a
                               logical name for multiple hosts and it is defined
                               in the property ozone.om.service.ids.
                               Example of a full URI with host name and port 
number
                               for a key:
                               o3://omhostname:9862/vol1/bucket1/key1
                               With a service id for a volume:
                               o3://omserviceid/vol1/
                               Short URI should start from the volume.
                               Example of a short URI for a bucket:
                               vol1/bucket1
                               Any unspecified information will be identified 
from
                               the config files.
   
     -a, --all                 List all results
         --all-status          List all jobs regardless of status.
     -h, --help                Show this help message and exit.
         --job-status=<jobStatus>
                               List jobs based on status.
                               Accepted values are: queued, in_progress, done,
                                 failed, rejected
     -l, --length=<limit>      Maximum number of items to list
                                 Default: 100
     -s, --start=<startItem>   The item to start the listing from.
                               This will be excluded from the result.
     -V, --version             Print version information and exit.
         --verbose             More verbose output. Show the stack trace of the
                                 errors.
   ```
   
   CI:
   https://github.com/adoroszlai/ozone/actions/runs/14901599818
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to