-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Enhance task schedule api for single type/table support #6352
Enhance task schedule api for single type/table support #6352
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6352 +/- ##
===========================================
- Coverage 66.44% 45.55% -20.90%
===========================================
Files 1075 1291 +216
Lines 54773 62186 +7413
Branches 8168 9027 +859
===========================================
- Hits 36396 28331 -8065
- Misses 15700 31523 +15823
+ Partials 2677 2332 -345
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
overall lgtm
import static org.testng.Assert.assertFalse; | ||
import static org.testng.Assert.assertNotNull; | ||
import static org.testng.Assert.assertTrue; | ||
import static org.testng.Assert.*; |
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.
expand the imports
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.
Per the code style, if there are >= 5 imports, they will be combined into *
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.
ah, good to know :)
setUpTask(); | ||
|
||
return tasksScheduled; | ||
return scheduleTasks(_pinotHelixResourceManager.getAllTables(), false); |
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 this is always false?
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.
This method is connected to the rest endpoint, so the caller might not be the leader controller
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.
ic, so we actually always assume this call is from a non-leader.
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.
Yes, if it is not always the leader, we need to assume it is not the leader
if (taskTypes.contains(enabledTaskType)) { | ||
enabledTableConfigMap.computeIfAbsent(enabledTaskType, k -> new ArrayList<>()).add(tableConfig); | ||
} else { | ||
LOGGER.warn("Task type: {} is not registered, cannot enable it for table: {}", enabledTaskType, |
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.
Is it possible that we return this info to the client-side? I feel this information is useful for users to test and debug.
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.
Good point. We cannot directly return the message without backward-incompatible change on the rest endpoint (currently returns the map from task type to task scheduled). I made the change so that the returned map contains all the task types within the table configs, and if the task type is not registered, there will be no task scheduled (value is null
for the task type), and then user can look into the log and find the reason.
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.
true, maybe we add a new array field like "errors" later to hold these information.
1a3f264
to
6189870
Compare
6189870
to
8fc87a5
Compare
Description
Added 2 optional query parameters to the task schedule API to schedule tasks for the given task type/table.
Examples: