Skip to content

[AMORO-3747] Introducing a more general TableRuntime storage structure#3748

Merged
baiyangtx merged 2 commits intoapache:masterfrom
baiyangtx:new_table_runtime2
Aug 29, 2025
Merged

[AMORO-3747] Introducing a more general TableRuntime storage structure#3748
baiyangtx merged 2 commits intoapache:masterfrom
baiyangtx:new_table_runtime2

Conversation

@baiyangtx
Copy link
Contributor

@baiyangtx baiyangtx commented Aug 23, 2025

Why are the changes needed?

Close #3747.

Brief change log

  • Split table_runtime into 2 tables.
  • Keep the common fields in table_runtime, and add a new table table_runtime_state to store extensiable information
  • Refactor DefaultTableRuntime with new system table.
  • Add interface TableRuntimeStore to access persistent information of table runtime.

How was this patch tested?

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate

  • Run test locally before making a pull request

Documentation

  • Does this pull request introduce a new feature? (no)

private class TableRuntimeOperationImpl implements TableRuntimeOperation {

private final TableRuntimeMeta oldMeta;
private final List<Runnable> opeartions = Lists.newArrayList();
Copy link
Contributor

Choose a reason for hiding this comment

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

nit

Suggested change
private final List<Runnable> opeartions = Lists.newArrayList();
private final List<Runnable> operations = Lists.newArrayList();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tks, I have fix it.

@@ -685,11 +686,6 @@ public void cancelOptimizingProcess(Context ctx) {
ServerTableIdentifier serverTableIdentifier =
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be also removed if don't check the processId

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have add check logic.

}

@Override
public TableFormat getFormat() {
Copy link
Contributor

Choose a reason for hiding this comment

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

getFormat already has default impelementation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have remove the implement.


@Override
public AmoroProcess<? extends TableProcessState> trigger(Action action) {
return null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Better to throw an UnsupportException or make it abstract

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have make it abstract

`pending_input` mediumtext,
`table_summary` mediumtext,
`group_name` varchar(64) NOT NULL,
`status_code` int DEFAULT 0 NOT NULL COMMENT 'Table runtime status code.',
Copy link
Contributor

Choose a reason for hiding this comment

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

0 status_code makes no sense, do you mean 700(IDLE)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK.

Copy link
Contributor

@zhoujinsong zhoujinsong left a comment

Choose a reason for hiding this comment

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

This change looks good to me.
But this PR makes a lot change to some core codes.
I would give more time to other developers to review.

import java.util.function.BiFunction;
import java.util.function.Function;

public class StateKey<T> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add some comments for these new classes/interfaces?

Copy link
Contributor

@Aireed Aireed left a comment

Choose a reason for hiding this comment

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

LGTM.
Wait for others to take a look.

@baiyangtx baiyangtx merged commit d442c87 into apache:master Aug 29, 2025
8 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Subtask]: Introducing a more general TableRuntime storage structure

4 participants