Skip to content
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

Combine GatherNoCompactionMarkFilter and GatherNoDownsampleMark to prevent code duplication #5962

Open
RohitKochhar opened this issue Dec 13, 2022 · 8 comments
Assignees

Comments

@RohitKochhar
Copy link
Contributor

Is your proposal related to a problem?

With the addition of the no-downsample-mark.json block marker, some logic was retooled from the process to mark a block for no compaction. From this, some duplication has been introduced that should be fixed for clarity and better conformity.

Describe the solution you'd like

I would like to open a PR to change the implemented logic for marking a block no-downsample to minimize code duplication.

Describe alternatives you've considered

N/A

Additional context

To keep the scopes of the PRs focused, I think it is best that the first PR implementing the no-downsample logic (#5945) is accepted and merged into master before I open a new PR for this.

cc: @fpetkovski

@nikzayn
Copy link

nikzayn commented Dec 14, 2022

Can you please assign me this, I'd like to work on it. Thanks!!

@nikzayn
Copy link

nikzayn commented Dec 16, 2022

hey @RohitKochhar can you please brief me about the syntax and what needs to be done here?

@RohitKochhar
Copy link
Contributor Author

Hey @nikzayn, sorry that it took so long for me to see your comment here.

Basically, you'll see that the implementation for the two filters (one for NoCompact and one for NoDownsample) are quite similar. It would be ideal if the logic for the two were combined so that there was minimal code duplication.

@jatinagwal
Copy link
Contributor

Hey @RohitKochhar, we have to reuse the filter function ?

@RohitKochhar
Copy link
Contributor Author

Which specific filter function are you referring to?

@jatinagwal
Copy link
Contributor

function named Filter in this which has the filtering logic.

@yeya24
Copy link
Contributor

yeya24 commented Feb 15, 2023

@jatinagwal I don't think there is a strict requirement to use the same function here. The goal is to keep the core filter logic in one place and you can extend it or get it working for different markers.

@jatinagwal
Copy link
Contributor

jatinagwal commented Feb 16, 2023

Sorry, for late response. I was stuck in the execution.
My first approach was to make seperate Filter method and then call that wherever needed, but, it have so many attributes and is calling other functions like gathernodownsample struct, nodownsamplemarkedblock func etc. So, we have to create these attributes and function for standard Filter method that we are writing.
So, I tried with creating a new function for this part .
Can you please guide like with which approach should I go? Or what other solution do you think we can implement?

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

No branches or pull requests

4 participants