Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

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

…inyon#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
…inyon#3968

- Displays both topic metadata and its partitions in a single command
- Includes a --system flag to optionally show system partitions
…inyon#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
Contributor

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
Contributor

sehz commented Apr 15, 2025

Sounds good

@sehz
Copy link
Contributor

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

infinyon/fluvio-docs#397

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants