ibessonov commented on a change in pull request #566: URL: https://github.com/apache/ignite-3/pull/566#discussion_r789633113
########## File path: modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/util/PageIdUtils.java ########## @@ -0,0 +1,264 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.pagememory.util; + +import org.apache.ignite.internal.pagememory.PageIdAllocator; +import org.apache.ignite.internal.util.IgniteUtils; + +/** + * Utility class for page ID parts manipulation. + * + * @see FullPageId + */ +public final class PageIdUtils { + /** Size of the page index portion. */ + public static final int PAGE_IDX_SIZE = Integer.SIZE; + + /** Size of the partition ID portion. */ + public static final int PART_ID_SIZE = Short.SIZE; + + /** Size of the flags portion. */ + public static final int FLAG_SIZE = Byte.SIZE; + + /** Size of the offset portion. */ + public static final int OFFSET_SIZE = Byte.SIZE; + + /** Size of a tag portion. */ + public static final int TAG_SIZE = 2 * Byte.SIZE; + + /** Page index mask. */ + public static final long PAGE_IDX_MASK = ~(-1L << PAGE_IDX_SIZE); + + /** Offset mask. */ + public static final long OFFSET_MASK = ~(-1L << OFFSET_SIZE); + + /** Tag mask. */ + public static final long TAG_MASK = ~(-1L << TAG_SIZE); + + /** Page Index is a monotonically growing number within each partition. */ + public static final long PART_ID_MASK = ~(-1L << PART_ID_SIZE); + + /** Flags mask. Flags consists from a number of reserved bits, and page type (data/index page). */ + public static final long FLAG_MASK = ~(-1L << FLAG_SIZE); + + /** Effective page ID mask. */ Review comment: It is stated somewhere in FullPageId, should I duplicate that description? -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
