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

feat: define new extendible hash table pages specification #611

Merged
merged 1 commit into from
Sep 17, 2023

Conversation

yliang412
Copy link
Member

@yliang412 yliang412 commented Sep 17, 2023

DO NOT PUSH PROJECT SOLUTIONS PUBLICLY.

And especially do NOT open pull requests with project solutions!

Please be considerate of this free educational resource.

Page Layout

/**
 * Header page format:
 *  ---------------------------------------------------
 * | DirectoryPageIds(2048) | MaxSize (4) | Free(2044)
 *  ---------------------------------------------------
 * 
 * Directory page format:
 *  --------------------------------------------------------------------------------------
 * | MaxSize (4) | GlobalDepth (4) | LocalDepths (512) | BucketPageIds(2048) | Free(1528)
 *  --------------------------------------------------------------------------------------
 *
 *
 * Bucket page format:
 *  ----------------------------------------------------------------------------
 * | METADATA | KEY(1) + VALUE(1) | KEY(2) + VALUE(2) | ... | KEY(n) + VALUE(n)
 *  ----------------------------------------------------------------------------
 *
 * Metadata format (size in byte, 8 bytes in total):
 *  --------------------------------
 * | CurrentSize (4) | MaxSize (4)
 *  --------------------------------
 */

void PrintHeader();

private:
page_id_t directory_page_ids_[HTABLE_HEADER_ARRAY_SIZE];
Copy link

Choose a reason for hiding this comment

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

nit: indentation and maybe ordering? we can put max_size_ before the array like the other page layouts

otherwise LGTM!

@yliang412 yliang412 merged commit 0f31396 into master Sep 17, 2023
3 checks passed
@yliang412 yliang412 deleted the yliang/htable-page-defs branch September 17, 2023 19:41
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.

2 participants