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
Conversation
65c7857
to
8c24873
Compare
...s/page-memory/src/main/java/org/apache/ignite/internal/pagememory/freelist/FreeListImpl.java
Show resolved
Hide resolved
...s/page-memory/src/main/java/org/apache/ignite/internal/pagememory/freelist/FreeListImpl.java
Outdated
Show resolved
Hide resolved
import java.util.Iterator; | ||
|
||
/** {@link Iterator} implementation that allows to access the current element multiple times. */ | ||
public class CachedIterator<T> implements Iterator<T> { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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. */ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/Storable.java
Outdated
Show resolved
Hide resolved
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/freelist/FreeList.java
Show resolved
Hide resolved
...s/page-memory/src/main/java/org/apache/ignite/internal/pagememory/freelist/FreeListImpl.java
Show resolved
Hide resolved
) throws IgniteInternalCheckedException { | ||
super( | ||
name, | ||
"FreeList_" + grpId, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
...s/page-memory/src/main/java/org/apache/ignite/internal/pagememory/freelist/FreeListImpl.java
Outdated
Show resolved
Hide resolved
# Conflicts: # modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/datapage/ReadPageMemoryRowValue.java
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/Storable.java
Show resolved
Hide resolved
} | ||
|
||
/** Returns page eviction tracker. */ | ||
public PageEvictionTracker evictionTracker() { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
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
- 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.
Notes