-
Notifications
You must be signed in to change notification settings - Fork 75
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
base: master
Are you sure you want to change the base?
Conversation
|
||
// Register a shutdown hook to delete the file when the JVM exits | ||
sys.addShutdownHook { | ||
withWriteLock { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
6522779
to
a83d779
Compare
a83d779
to
24ada36
Compare
1edb551
to
cef347b
Compare
This PR adds two document implementations:
PartitionDocument
: given an ID, and number of partitionsn
, this document will createn
files, each file is aItemizedFileDocument
.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 typeT
, and it will use kryo to serde/deserde the type T during read and write.