Skip to content

Track the Number of Messages #1

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

Merged
merged 30 commits into from
Jun 9, 2021
Merged

Track the Number of Messages #1

merged 30 commits into from
Jun 9, 2021

Conversation

kev1n80
Copy link
Owner

@kev1n80 kev1n80 commented May 27, 2021

Implementation

  • Create new constructor for DiskQueue that uses the new Disk Size Limit feature.
  • Implement the handling of Depth for the Disk Size Limit feature.
  • If using the Disk Size Limit feature:
    • Track the number of messages in the write file and write it to the end of the file
    • Track the number of messages in the read file that have been read
    • Write the writeMessages and readMessages to the MetaData

Testing

  • test that write and read messages increment normally after putting and/or getting data
  • test that write position and messages reset when a new file is created
  • test that read position and messages reset when a file is completely read

Next Steps

  • Calculate the total disk space used by tracking writeBytes (the number of bytes written that have not been deleted) and readBytes (the number of bytes to be deleted)

Note

This pr will only handle the tracking of writeMessages and readMessages. The implementation of making space when we surpass the diskSizeLimit will come later.

@kev1n80 kev1n80 requested a review from leonzz May 27, 2021 21:15
Copy link
Collaborator

@leonzz leonzz left a comment

Choose a reason for hiding this comment

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

I guess the other parts (e.g. the one documented in Next Steps) will come in later PRs? if so it might worth updating this PR title to reflect the change. looks like it's mainly about counting the number of messages per file.

@kev1n80 kev1n80 changed the title Depth impl Track the Number of Messages Jun 8, 2021
Copy link
Collaborator

@CatherineF-dev CatherineF-dev left a comment

Choose a reason for hiding this comment

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

Do we need to update writeMessages and readMessages in handleReadError now?

@kev1n80
Copy link
Owner Author

kev1n80 commented Jun 9, 2021

Do we need to update writeMessages and readMessages in handleReadError now?

Yes!!!! Nice catch!

@kev1n80 kev1n80 merged commit 5d83e9b into master Jun 9, 2021
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.

4 participants