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

Add PartitionDocument and ItemizedFileDocument #3147

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

bobbai00
Copy link
Collaborator

This PR adds two document implementations:

  • PartitionDocument: given an ID, and number of partitions n, this document will create n files, each file is a ItemizedFileDocument.
  • ItemizedFileDocument: given a URI, this document will open/create if not exist a file on the filesystem, and provide implementation of read/write in a sequence. It accepts the template type T, and it will use kryo to serde/deserde the type T during read and write.

@bobbai00 bobbai00 self-assigned this Dec 10, 2024

// Register a shutdown hook to delete the file when the JVM exits
sys.addShutdownHook {
withWriteLock {
Copy link
Collaborator

@shengquan-ni shengquan-ni Dec 10, 2024

Choose a reason for hiding this comment

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

why do we need a write lock, do we allow multiple writers to write the file?

override val bufferSize: Int = 1024

// Register a shutdown hook to delete the file when the JVM exits
sys.addShutdownHook {
Copy link
Collaborator

Choose a reason for hiding this comment

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

The lifecycle for this file is also not correct. This file is created by the computing unit JVM, which can be killed right after the execution.

Copy link
Collaborator

@shengquan-ni shengquan-ni Dec 10, 2024

Choose a reason for hiding this comment

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

I suggest we do a global cleanup on OpResultStorage level on top of #3146.

@bobbai00 bobbai00 force-pushed the jiadong-add-file-result-storage branch 2 times, most recently from 6522779 to a83d779 Compare December 14, 2024 00:14
@bobbai00 bobbai00 force-pushed the jiadong-add-file-result-storage branch from a83d779 to 24ada36 Compare December 19, 2024 21:49
@bobbai00 bobbai00 force-pushed the jiadong-add-file-result-storage branch from 1edb551 to cef347b Compare December 21, 2024 02:56
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