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

WIP: split-table: split Table interface by behavior #13

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lavrukov
Copy link
Contributor

The Table interface is too huge and contains several entities that are well separated by behavior. To simplify navigation and plan a little for the future, I propose to distribute methods from Table to new interfaces

public interface BaseTable<T extends Entity<T>> {
Class<T> getType();

FirstLevelCache getFirstLevelCache();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function had default realization, which returned null; I think it isn't needed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function should not be in Table, ever.
Strange that we have it there now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it using in default Table methods. Do you think that its better to leave it in Table?

}

default <ID extends Entity.Id<T>> void delete(Range<ID> range) {
findIds(range).forEach(this::delete);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was marked with unsafe, but it don't look like it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default implementation is safe but YDB implementation isnlikely a blind delete (without reading rows in the range first)

@nvamelichev nvamelichev changed the title split-table: split Table interface by behavior WIP: split-table: split Table interface by behavior Feb 7, 2024
@nvamelichev nvamelichev marked this pull request as draft February 12, 2024 12:14
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.

3 participants