Skip to content

# feat: Improve fluvio topic describe with additional information #3968#4508

Closed
gmkumar2005 wants to merge 9 commits intofluvio-community:masterfrom
gmkumar2005:cli_addtional_info_3968
Closed

# feat: Improve fluvio topic describe with additional information #3968#4508
gmkumar2005 wants to merge 9 commits intofluvio-community:masterfrom
gmkumar2005:cli_addtional_info_3968

Conversation

@gmkumar2005
Copy link
Contributor

  • Displays both topic metadata and its partitions in a single command
  • Includes a --system flag to optionally show system partitions

…vio-community#3968

- Displays both topic metadata and its partitions in a single command
- Includes a --system flag to optionally show system partitions
@gmkumar2005
Copy link
Contributor Author

How to filter topics in admin api ? The following call get list of topics how ever it is not able to get filtered list

let topics = admin
           .list_with_config::<TopicSpec, String>(ListRequest::default().system(self.system))
           .await?;

Code with name filter

let list_filters = ListFilters::from(topic.as_str());
     let partitions = admin
         .list_with_config::<PartitionSpec, String>(ListRequest::new(list_filters, self.system).system(self.system))
         .await?;

The value list_filters does not have any effect, the admin returns all the topics.
I had to do additional filtering as below


 let filtered_partitions = partitions.clone()
            .into_iter()
            .filter(|partition| {
                if let Some(index) = partition.name.rfind('-') {
                    let base_name = &partition.name[..index];
                    base_name == topic
                } else {
                    partition.name == topic
                }
            })
            .collect::<Vec<_>>();


Please advice if there is a better approach ?

Kiran Kumar Mallru added 2 commits April 14, 2025 13:26
…vio-community#3968

- Displays both topic metadata and its partitions in a single command
- Includes a --system flag to optionally show system partitions
…vio-community#3968

- Displays both topic metadata and its partitions in a single command
- Includes a --system flag to optionally show system partitions
@gmkumar2005
Copy link
Contributor Author

Sample output

fluvio topic describe hello-rust
   Name:hello-rust              
   Type:computed                
   Partition Count:1            
   Replication Factor:1         
   Ignore Rack Assignment:false 
   Status:provisioned           
   Reason:                      
   -----------------            
  TOPIC       PARTITION  LEADER  MIRROR  REPLICAS  RESOLUTION  SIZE   BASE  HW  LEO  LRS  FOLLOWER OFFSETS     
  hello-rust  0          5001            []        Online      201 B  0     2   2    2    0                 [] 

Sample output of system topic

fluvio topic describe consumer-offset -s
   Name:consumer-offset         
   Type:computed                
   Partition Count:1            
   Replication Factor:1         
   Ignore Rack Assignment:false 
   Status:provisioned           
   Reason:                      
   -----------------            
  TOPIC            PARTITION  LEADER  MIRROR  REPLICAS  RESOLUTION  SIZE  BASE  HW  LEO  LRS  FOLLOWER OFFSETS     
  consumer-offset  0          5001            []        Online      0 B   0     0   0    0    0                 [] 

@sehz
Copy link

sehz commented Apr 14, 2025

@gmkumar2005
Copy link
Contributor Author

@sehz Fixing the code in public_api for partitions requires some more analysis, I ran into type related issues.
Can we consider public_api changes in a seperate issue and proceed to close this issue with CLI?

@sehz
Copy link

sehz commented Apr 15, 2025

Sounds good

@sehz
Copy link

sehz commented Apr 15, 2025

For CLI, need to add CLI E2E test, You can find them here: https://github.com/infinyon/fluvio/tree/master/tests/cli/fluvio_smoke_tests

@gmkumar2005
Copy link
Contributor Author

For CLI, need to add CLI E2E test, You can find them here: https://github.com/infinyon/fluvio/tree/master/tests/cli/fluvio_smoke_tests

Added smoke test Describe a topic

@gmkumar2005
Copy link
Contributor Author

Followup PR for updating the docs

fluvio-community/fluvio-docs#397

@github-actions
Copy link

Stale pull request message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants