-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Kernel]Generalize the actions after commit(like checkpoint) by introducing post commit action to kernel #4115
Changes from 3 commits
7790fd1
0fc403d
9278d0b
396e902
e18b792
8f75f46
debd1ae
c1cbc47
f262fe0
4d5ed9c
60942c2
ddf351d
9ab9587
1d96f54
d8cdaff
8a21a64
006eb10
fd21ec1
c9428e2
c926f85
6cf22c0
b787781
b09a550
d8ce4f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,17 @@ | |
import io.delta.kernel.engine.Engine; | ||
import java.io.IOException; | ||
|
||
/** | ||
* A hook for executing operation after a transaction commit. Hooks are added in the Transaction and | ||
* engine need to invoke the hook explicitly for executing the operation. | ||
*/ | ||
public interface PostCommitHook { | ||
|
||
enum PostCommitHookType { | ||
// Write a new checkpoint at the version committed by the txn if required. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is maybe a little ambiguous as to when it is present (i.e. is it always present and only sometime checkpoints?) Maybe something like "Write a new checkpoint at the version committed by the txn. This hook is present when the table is ready for checkpoint according to its configured checkpoint interval" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can do |
||
CHECKPOINT, | ||
} | ||
|
||
/** Invokes the post commit operation whose implementation must be thread safe. */ | ||
void threadSafeInvoke(Engine engine) throws IOException; | ||
|
||
|
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -13,13 +13,15 @@ | |||||
* See the License for the specific language governing permissions and | ||||||
* limitations under the License. | ||||||
*/ | ||||||
package io.delta.kernel.hook; | ||||||
package io.delta.kernel.internal.hook; | ||||||
|
||||||
import io.delta.kernel.Table; | ||||||
import io.delta.kernel.engine.Engine; | ||||||
import io.delta.kernel.hook.PostCommitHook; | ||||||
import io.delta.kernel.internal.fs.Path; | ||||||
import java.io.IOException; | ||||||
|
||||||
/** Write a new checkpoint at the version committed by the txn if required. */ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this hook is created, it is required |
||||||
public class CheckpointHook implements PostCommitHook { | ||||||
|
||||||
private final Path tablePath; | ||||||
|
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.
Should we add more docs here declaring what type of work is considered a PostCommitHook? And how an engine should treat them? i.e. are they required, how do they relate to the commit, etc
Alternatively, maybe more thorough docs for each type?
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.
Added some doc, PTAL. Thanks
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.
Also add what sort of operations and latency wise. So that the connector can choose to run it async.
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.
Updated the documentation to indicate supported operations and latency indication for checkpoint in below section.