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

[IGNITE-21999] Merge partition free-lists into one #3615

Merged
merged 25 commits into from May 6, 2024

Conversation

Phillippko
Copy link
Contributor

https://issues.apache.org/jira/browse/IGNITE-21999

Thank you for submitting the pull request.

To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:

The Review Checklist

  • Formal criteria: TC status, codestyle, mandatory documentation. Also make sure to complete the following:
    - There is a single JIRA ticket related to the pull request.
    - The web-link to the pull request is attached to the JIRA ticket.
    - The JIRA ticket has the Patch Available state.
    - The description of the JIRA ticket explains WHAT was made, WHY and HOW.
    - The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • Design: new code conforms with the design principles of the components it is added to.
  • Patch quality: patch cannot be split into smaller pieces, its size must be reasonable.
  • Code quality: code is clean and readable, necessary developer documentation is added if needed.
  • Tests code quality: test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.

Notes

@Phillippko Phillippko changed the title IGNITE-21999 Merge partition free-lists into one [IGNITE-21999] Merge partition free-lists into one Apr 16, 2024
@Phillippko Phillippko marked this pull request as ready for review April 16, 2024 14:16
import java.util.Iterator;

/** {@link Iterator} implementation that allows to access the current element multiple times. */
public class CachedIterator<T> implements Iterator<T> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we shouldn't put it in core, this class is very specific. get contract is weird and hard to explain, so I'd rather hide it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

returned it back to FreeList file

IoVersions<? extends AbstractDataPageIo<?>> ioVersions();
IoVersions<DataPageIo> ioVersions();

/** Returns a byte buffer that contains binary tuple data. */
Copy link
Contributor

Choose a reason for hiding this comment

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

Excuse me, what binary tuple? It's an abstraction, it should not depend on the implementation. There's clearly something wrong here.
What was wrong with writeRowData and writeFragmentData that you could have moved here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed, moved writeRowData and writeFragmentData to storable implementations

) throws IgniteInternalCheckedException {
super(
name,
"FreeList_" + grpId,
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure that it's a good idea to hard-code the name?
FreeLists for different partitions will have the same name, is this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually it had the same name for partitions before my changes. Made name a parameter, names will have format VolatileFreeList_grpId_partId and PersistentFreeList_grpId_partId

}

/** Returns page eviction tracker. */
public PageEvictionTracker evictionTracker() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it still required to be public?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed this method -> get eviction tracker for handlers through constructors

}

/**
* Returns version chain free list.
*
* @throws StorageException If the data region did not start.
*/
public RowVersionFreeList rowVersionFreeList() {
public FreeListImpl freeList() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder why it returns impl and not the interface.
Same applies for places where we declare fields. Your reply would be enough

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sometimes we use this freelist() as ReuseList, not FreeList. It can be changed, but decided to leave it for now

public IndexColumnsFreeList indexColumnsFreeList() {
return indexColumnsFreeList;
/** Returns pages eviction tracker. */
public PageEvictionTracker evictionTracker() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this necessary?

@@ -30,9 +30,6 @@ public interface MvPageTypes {
/** Version chain tree leaf page IO type. */
short T_VERSION_CHAIN_LEAF_IO = 11;

/** Row version data page IO type. */
short T_ROW_VERSION_DATA_IO = 12;
Copy link
Contributor

Choose a reason for hiding this comment

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

What if we re-assign these numbers, to make them more meaningful? This gap makes no sense now

import org.jetbrains.annotations.Nullable;

/**
* Index columns to store in free list.
*/
public class IndexColumns implements Storable {
public static final byte DATA_TYPE = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer it the other way, data being 0 and index being 1

@rpuch rpuch merged commit 7f93d63 into apache:main May 6, 2024
1 check passed
@rpuch rpuch deleted the ignite-21999 branch May 6, 2024 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants