ibessonov commented on code in PR #6442:
URL: https://github.com/apache/ignite-3/pull/6442#discussion_r2282346791
##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PageHeader.java:
##########
@@ -96,13 +104,13 @@ public static boolean dirty(long absPtr, boolean dirty) {
* @param absPtr Absolute pointer.
* @param flag Flag mask.
*/
- private static boolean flag(long absPtr, long flag) {
- assert (flag & 0xFFFFFFFFFFFFFFL) == 0;
+ private static boolean flag(long absPtr, int flag) {
+ assert (flag & 0xFFFFFF) == 0;
Review Comment:
Why does this check still exist?
##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PageHeader.java:
##########
@@ -33,12 +33,13 @@
/**
* Page header.
*/
+// TODO: IGNITE-16350 Improve documentation and refactoring
public class PageHeader {
/** Page marker. */
public static final long PAGE_MARKER = 0x0000000000000001L;
/** Dirty flag. */
- private static final long DIRTY_FLAG = 0x0100000000000000L;
+ private static final int DIRTY_FLAG = 0x01000000;
/** Page relative pointer. Does not change once a page is allocated. */
private static final int RELATIVE_PTR_OFFSET = 8;
Review Comment:
Please delete unused functionality. It doesn't work after your changes.
"Relative ptr", whatever that is, used to be stored in the same place as flags.
That's why flags are in upper bits and that's why `RELATIVE_PTR_MASK` is the
way it is.
This will not be a refactoring, this will be the right thing to do in this
context. You can't just break functionality even if no one uses it, you should
remove it instead.
##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PageHeader.java:
##########
@@ -55,14 +56,21 @@ public class PageHeader {
/** Page temp copy buffer relative pointer offset. */
private static final int PAGE_TMP_BUF_OFFSET = 40;
+ private static final int PARTITION_GENERATION_OFFSET = 8;
+
+ private static final int FLAGS_OFFSET = 12;
+
+ /** Unknown partition generation. */
+ static final int UNKNOWN_PARTITION_GENERATION = -1;
+
/**
* Initializes the header of the page.
*
* @param absPtr Absolute pointer to initialize.
* @param relative Relative pointer to write.
*/
public static void initNew(long absPtr, long relative) {
Review Comment:
Can we pass a partition generation as a parameter? What would that look
like? (maybe it's a bad idea, that's why it's a question and not a
recommendation)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org