You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "shounakmk219 (via GitHub)" <gi...@apache.org> on 2025/02/12 13:51:50 UTC
[PR] Decouple tracking and storage in MinionEventObserver using MinionTaskProgressManager [pinot]
shounakmk219 opened a new pull request, #15044:
URL: https://github.com/apache/pinot/pull/15044
Splitting #14521 into separate PRs
# Description
This PR tries to decouple the way how minion task progress is being tracked and stored so that we can reuse the implementations of `MinionEventObserver` and decide the underlying storage to be used based on the requirements.
## Introduce new `MinionTaskProgressManager` interface
The responsibility of storing the task progress data that's being monitored by `MinionEventObserver` will be delegated to this new interface `MinionTaskProgressManager`. It will expose the below methods to manage the `MinionTaskProgressStats` for each task run.
- `init(PinotConfiguration configuration)`
- `getTaskProgress(String taskId)`
- `setTaskProgress(String taskId, MinionTaskProgressStats progress)`
- `deleteTaskProgress(String taskId)`
### Configuration
In order to plug the desired implementation of `MinionTaskProgressManager` there is a new config introduced
```
pinot.minion.taskProgressManager.class
```
If the config is not provided or minion is unable to load the instance of that class, the default implementation `DefaultMinionTaskProgressManager` will be used.
This is the same logic of how the existing progress is being maintained in minion memory.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Decouple tracking and storage in MinionEventObserver using MinionTaskObserverStorageManager [pinot]
Posted by "swaminathanmanish (via GitHub)" <gi...@apache.org>.
swaminathanmanish commented on code in PR #15044:
URL: https://github.com/apache/pinot/pull/15044#discussion_r1959080783
##########
pinot-spi/src/main/java/org/apache/pinot/spi/tasks/MinionTaskBaseObserverStats.java:
##########
@@ -0,0 +1,168 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.spi.tasks;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import java.util.Deque;
+import java.util.LinkedList;
+import java.util.Objects;
+import org.apache.pinot.spi.utils.JsonUtils;
+
+
+public class MinionTaskBaseObserverStats {
+ protected String _taskId;
+ protected String _currentState;
+ protected long _startTimestamp;
+ protected Deque<StatusEntry> _progressLogs = new LinkedList<>();
+
+ public MinionTaskBaseObserverStats() {
+ }
+
+ public MinionTaskBaseObserverStats(MinionTaskBaseObserverStats from) {
+ _taskId = from.getTaskId();
+ _currentState = from.getCurrentState();
+ _startTimestamp = from.getStartTimestamp();
+ _progressLogs = new LinkedList<>(from.getProgressLogs());
+ }
+
+ public String getTaskId() {
+ return _taskId;
+ }
+
+ public MinionTaskBaseObserverStats setTaskId(String taskId) {
+ _taskId = taskId;
+ return this;
+ }
+
+ public long getStartTimestamp() {
+ return _startTimestamp;
+ }
+
+ public MinionTaskBaseObserverStats setStartTimestamp(long startTimestamp) {
+ _startTimestamp = startTimestamp;
+ return this;
+ }
+
+ public String getCurrentState() {
+ return _currentState;
+ }
+
+ public MinionTaskBaseObserverStats setCurrentState(String currentState) {
+ _currentState = currentState;
+ return this;
+ }
+
+ public Deque<StatusEntry> getProgressLogs() {
+ return _progressLogs;
+ }
+
+ public MinionTaskBaseObserverStats setProgressLogs(Deque<StatusEntry> progressLogs) {
+ _progressLogs = progressLogs;
+ return this;
+ }
+
+ public static MinionTaskBaseObserverStats fromJsonString(String statsJson)
Review Comment:
Shouldn't derived class be able to override this ?
Please add a test for a dummy derived class, so to show how this can be extended and used.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Decouple tracking and storage in MinionEventObserver using MinionTaskObserverStorageManager [pinot]
Posted by "swaminathanmanish (via GitHub)" <gi...@apache.org>.
swaminathanmanish commented on code in PR #15044:
URL: https://github.com/apache/pinot/pull/15044#discussion_r1959067336
##########
pinot-minion/src/main/java/org/apache/pinot/minion/event/DefaultMinionEventObserver.java:
##########
@@ -20,13 +20,21 @@
import javax.annotation.Nullable;
import org.apache.pinot.core.minion.PinotTaskConfig;
+import org.apache.pinot.spi.tasks.MinionTaskObserverStorageManager;
/**
* Default no-op minion event observer which can be extended.
*/
public class DefaultMinionEventObserver implements MinionEventObserver {
+ protected MinionTaskObserverStorageManager _progressManager;
Review Comment:
_observerStorageManager? And everywhere as well.
##########
pinot-spi/src/main/java/org/apache/pinot/spi/tasks/MinionTaskBaseObserverStats.java:
##########
@@ -0,0 +1,168 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.spi.tasks;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import java.util.Deque;
+import java.util.LinkedList;
+import java.util.Objects;
+import org.apache.pinot.spi.utils.JsonUtils;
+
+
+public class MinionTaskBaseObserverStats {
Review Comment:
Could you add java docs for the purpose of this class and the individual fields
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Decouple tracking and storage in MinionEventObserver using MinionTaskObserverStorageManager [pinot]
Posted by "rajagopr (via GitHub)" <gi...@apache.org>.
rajagopr commented on code in PR #15044:
URL: https://github.com/apache/pinot/pull/15044#discussion_r1960790378
##########
pinot-minion/src/main/java/org/apache/pinot/minion/BaseMinionStarter.java:
##########
@@ -168,6 +172,26 @@ public void registerEventObserverFactory(MinionEventObserverFactory eventObserve
_eventObserverFactoryRegistry.registerEventObserverFactory(eventObserverFactory);
}
+ public MinionTaskObserverStorageManager getMinionTaskProgressManager() {
+ String progressManagerClassName = _config.getProperty(MinionConf.MINION_TASK_PROGRESS_MANAGER_CLASS);
+ MinionTaskObserverStorageManager progressManager = null;
+ if (progressManagerClassName != null) {
Review Comment:
Let's replace with `StringUtils.isNotEmpty(progressManagerClassName)` to cover for both null and empty scenarios.
##########
pinot-minion/src/main/java/org/apache/pinot/minion/event/MinionEventObserver.java:
##########
@@ -86,4 +95,6 @@ default MinionTaskState getTaskState() {
default long getStartTs() {
return -1;
}
+
+ void cleanup();
Review Comment:
Add docs. when should cleanup be performed?
##########
pinot-minion/src/main/java/org/apache/pinot/minion/event/DefaultMinionTaskObserverStorageManager.java:
##########
@@ -0,0 +1,89 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.minion.event;
+
+import java.util.Deque;
+import java.util.HashMap;
+import java.util.Map;
+import javax.annotation.Nullable;
+import org.apache.pinot.minion.MinionConf;
+import org.apache.pinot.spi.env.PinotConfiguration;
+import org.apache.pinot.spi.tasks.MinionTaskBaseObserverStats;
+import org.apache.pinot.spi.tasks.MinionTaskObserverStorageManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class DefaultMinionTaskObserverStorageManager implements MinionTaskObserverStorageManager {
+ private static final Logger LOGGER = LoggerFactory.getLogger(DefaultMinionTaskObserverStorageManager.class);
+
+ public static final String MAX_NUM_STATUS_TO_TRACK = "pinot.minion.task.maxNumStatusToTrack";
+ public static final int DEFAULT_MAX_NUM_STATUS_TO_TRACK = 128;
+
+ private final Map<String, MinionTaskBaseObserverStats> _minionTaskProgressStatsMap = new HashMap<>();
+ private int _maxNumStatusToTrack;
+
+ private static final DefaultMinionTaskObserverStorageManager DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new DefaultMinionTaskObserverStorageManager();
+ DEFAULT_INSTANCE.init(new MinionConf());
+ }
+
+ public static DefaultMinionTaskObserverStorageManager getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @Override
+ public void init(PinotConfiguration configuration) {
+ try {
+ _maxNumStatusToTrack =
+ Integer.parseInt(configuration.getProperty(DefaultMinionTaskObserverStorageManager.MAX_NUM_STATUS_TO_TRACK));
+ } catch (NumberFormatException e) {
+ LOGGER.warn("Unable to parse the value of '{}' using default value: {}",
Review Comment:
nit: sentence is bit confusing to read. Let's re-write as `Unable to parse the configured value: {}, using the default value: {} instead.`
##########
pinot-minion/src/main/java/org/apache/pinot/minion/event/MinionEventObserverFactory.java:
##########
@@ -31,6 +32,11 @@ public interface MinionEventObserverFactory {
*/
void init(MinionTaskZkMetadataManager zkMetadataManager);
+ /**
+ * Initializes the task executor factory.
Review Comment:
Docs for this and the previous method are exactly the same. Let's reason about the new param `MinionTaskObserverStorageManager` as part of this methods docs.
##########
pinot-minion/src/main/java/org/apache/pinot/minion/event/DefaultMinionTaskObserverStorageManager.java:
##########
@@ -0,0 +1,89 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.minion.event;
+
+import java.util.Deque;
+import java.util.HashMap;
+import java.util.Map;
+import javax.annotation.Nullable;
+import org.apache.pinot.minion.MinionConf;
+import org.apache.pinot.spi.env.PinotConfiguration;
+import org.apache.pinot.spi.tasks.MinionTaskBaseObserverStats;
+import org.apache.pinot.spi.tasks.MinionTaskObserverStorageManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class DefaultMinionTaskObserverStorageManager implements MinionTaskObserverStorageManager {
+ private static final Logger LOGGER = LoggerFactory.getLogger(DefaultMinionTaskObserverStorageManager.class);
+
+ public static final String MAX_NUM_STATUS_TO_TRACK = "pinot.minion.task.maxNumStatusToTrack";
+ public static final int DEFAULT_MAX_NUM_STATUS_TO_TRACK = 128;
+
+ private final Map<String, MinionTaskBaseObserverStats> _minionTaskProgressStatsMap = new HashMap<>();
+ private int _maxNumStatusToTrack;
+
+ private static final DefaultMinionTaskObserverStorageManager DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new DefaultMinionTaskObserverStorageManager();
+ DEFAULT_INSTANCE.init(new MinionConf());
+ }
+
+ public static DefaultMinionTaskObserverStorageManager getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @Override
+ public void init(PinotConfiguration configuration) {
+ try {
+ _maxNumStatusToTrack =
+ Integer.parseInt(configuration.getProperty(DefaultMinionTaskObserverStorageManager.MAX_NUM_STATUS_TO_TRACK));
+ } catch (NumberFormatException e) {
+ LOGGER.warn("Unable to parse the value of '{}' using default value: {}",
+ DefaultMinionTaskObserverStorageManager.MAX_NUM_STATUS_TO_TRACK,
+ DefaultMinionTaskObserverStorageManager.DEFAULT_MAX_NUM_STATUS_TO_TRACK);
+ _maxNumStatusToTrack = DefaultMinionTaskObserverStorageManager.DEFAULT_MAX_NUM_STATUS_TO_TRACK;
+ }
+ }
+
+ @Nullable
+ @Override
+ public MinionTaskBaseObserverStats getTaskProgress(String taskId) {
+ if (_minionTaskProgressStatsMap.containsKey(taskId)) {
+ return new MinionTaskBaseObserverStats(_minionTaskProgressStatsMap.get(taskId));
+ }
+ return null;
+ }
+
+ @Override
+ public synchronized void setTaskProgress(String taskId, MinionTaskBaseObserverStats progress) {
+ _minionTaskProgressStatsMap.put(taskId, progress);
+ Deque<MinionTaskBaseObserverStats.StatusEntry> progressLogs = progress.getProgressLogs();
Review Comment:
Given this is a public method, a non-null check can be added to the `progress` object.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Decouple tracking and storage in MinionEventObserver using MinionTaskProgressManager [pinot]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #15044:
URL: https://github.com/apache/pinot/pull/15044#issuecomment-2653935825
## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/15044?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
Attention: Patch coverage is `0%` with `51 lines` in your changes missing coverage. Please review.
> Project coverage is 56.01%. Comparing base [(`59551e4`)](https://app.codecov.io/gh/apache/pinot/commit/59551e45224f1535c4863fd577622b37366ccc97?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`dd51d37`)](https://app.codecov.io/gh/apache/pinot/commit/dd51d37a493ae61c97f2d844f0ac62161e3a5633?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> Report is 1701 commits behind head on master.
| [Files with missing lines](https://app.codecov.io/gh/apache/pinot/pull/15044?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...pache/pinot/spi/tasks/MinionTaskProgressStats.java](https://app.codecov.io/gh/apache/pinot/pull/15044?src=pr&el=tree&filepath=pinot-spi%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fspi%2Ftasks%2FMinionTaskProgressStats.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvdGFza3MvTWluaW9uVGFza1Byb2dyZXNzU3RhdHMuamF2YQ==) | 0.00% | [28 Missing :warning: ](https://app.codecov.io/gh/apache/pinot/pull/15044?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...n/java/org/apache/pinot/spi/tasks/StatusEntry.java](https://app.codecov.io/gh/apache/pinot/pull/15044?src=pr&el=tree&filepath=pinot-spi%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fspi%2Ftasks%2FStatusEntry.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvdGFza3MvU3RhdHVzRW50cnkuamF2YQ==) | 0.00% | [22 Missing :warning: ](https://app.codecov.io/gh/apache/pinot/pull/15044?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...che/pinot/spi/tasks/MinionTaskProgressManager.java](https://app.codecov.io/gh/apache/pinot/pull/15044?src=pr&el=tree&filepath=pinot-spi%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fspi%2Ftasks%2FMinionTaskProgressManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvdGFza3MvTWluaW9uVGFza1Byb2dyZXNzTWFuYWdlci5qYXZh) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/pinot/pull/15044?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
> :exclamation: There is a different number of reports uploaded between BASE (59551e4) and HEAD (dd51d37). Click for more details.
>
> <details><summary>HEAD has 48 uploads less than BASE</summary>
>
>| Flag | BASE (59551e4) | HEAD (dd51d37) |
>|------|------|------|
>|integration|7|0|
>|integration2|3|0|
>|temurin|12|2|
>|java-21|7|2|
>|skip-bytebuffers-true|3|1|
>|skip-bytebuffers-false|7|1|
>|unittests|5|2|
>|java-11|5|0|
>|unittests2|3|0|
>|integration1|2|0|
>|custom-integration1|2|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #15044 +/- ##
============================================
- Coverage 61.75% 56.01% -5.74%
- Complexity 207 710 +503
============================================
Files 2436 2139 -297
Lines 133233 115104 -18129
Branches 20636 18545 -2091
============================================
- Hits 82274 64476 -17798
- Misses 44911 45320 +409
+ Partials 6048 5308 -740
```
| [Flag](https://app.codecov.io/gh/apache/pinot/pull/15044/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [custom-integration1](https://app.codecov.io/gh/apache/pinot/pull/15044/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [integration](https://app.codecov.io/gh/apache/pinot/pull/15044/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [integration1](https://app.codecov.io/gh/apache/pinot/pull/15044/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [integration2](https://app.codecov.io/gh/apache/pinot/pull/15044/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [java-11](https://app.codecov.io/gh/apache/pinot/pull/15044/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [java-21](https://app.codecov.io/gh/apache/pinot/pull/15044/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.01% <0.00%> (-5.61%)` | :arrow_down: |
| [skip-bytebuffers-false](https://app.codecov.io/gh/apache/pinot/pull/15044/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.99% <0.00%> (-5.76%)` | :arrow_down: |
| [skip-bytebuffers-true](https://app.codecov.io/gh/apache/pinot/pull/15044/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.98% <0.00%> (+28.25%)` | :arrow_up: |
| [temurin](https://app.codecov.io/gh/apache/pinot/pull/15044/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.01% <0.00%> (-5.74%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/pinot/pull/15044/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.01% <0.00%> (-5.74%)` | :arrow_down: |
| [unittests1](https://app.codecov.io/gh/apache/pinot/pull/15044/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.01% <0.00%> (+9.12%)` | :arrow_up: |
| [unittests2](https://app.codecov.io/gh/apache/pinot/pull/15044/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/pinot/pull/15044?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Decouple tracking and storage in MinionEventObserver using MinionTaskProgressManager [pinot]
Posted by "swaminathanmanish (via GitHub)" <gi...@apache.org>.
swaminathanmanish commented on code in PR #15044:
URL: https://github.com/apache/pinot/pull/15044#discussion_r1957613132
##########
pinot-spi/src/main/java/org/apache/pinot/spi/tasks/MinionTaskProgressManager.java:
##########
@@ -0,0 +1,45 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.spi.tasks;
+
+import javax.annotation.Nullable;
+import org.apache.pinot.spi.env.PinotConfiguration;
+
+
+/**
+ * Interface to decouple minion task progress storage from task progress tracking
+ */
+public interface MinionTaskProgressManager {
Review Comment:
Can we name this MinionTaskObserverStorageAccessManager or something to reflect the purpose of the interface?
(to manage storage of Observer stats)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Decouple tracking and storage in MinionEventObserver using MinionTaskObserverStorageManager [pinot]
Posted by "swaminathanmanish (via GitHub)" <gi...@apache.org>.
swaminathanmanish merged PR #15044:
URL: https://github.com/apache/pinot/pull/15044
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Decouple tracking and storage in MinionEventObserver using MinionTaskObserverStorageManager [pinot]
Posted by "shounakmk219 (via GitHub)" <gi...@apache.org>.
shounakmk219 commented on code in PR #15044:
URL: https://github.com/apache/pinot/pull/15044#discussion_r1959950775
##########
pinot-spi/src/main/java/org/apache/pinot/spi/tasks/MinionTaskBaseObserverStats.java:
##########
@@ -0,0 +1,168 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.spi.tasks;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import java.util.Deque;
+import java.util.LinkedList;
+import java.util.Objects;
+import org.apache.pinot.spi.utils.JsonUtils;
+
+
+public class MinionTaskBaseObserverStats {
+ protected String _taskId;
+ protected String _currentState;
+ protected long _startTimestamp;
+ protected Deque<StatusEntry> _progressLogs = new LinkedList<>();
+
+ public MinionTaskBaseObserverStats() {
+ }
+
+ public MinionTaskBaseObserverStats(MinionTaskBaseObserverStats from) {
+ _taskId = from.getTaskId();
+ _currentState = from.getCurrentState();
+ _startTimestamp = from.getStartTimestamp();
+ _progressLogs = new LinkedList<>(from.getProgressLogs());
+ }
+
+ public String getTaskId() {
+ return _taskId;
+ }
+
+ public MinionTaskBaseObserverStats setTaskId(String taskId) {
+ _taskId = taskId;
+ return this;
+ }
+
+ public long getStartTimestamp() {
+ return _startTimestamp;
+ }
+
+ public MinionTaskBaseObserverStats setStartTimestamp(long startTimestamp) {
+ _startTimestamp = startTimestamp;
+ return this;
+ }
+
+ public String getCurrentState() {
+ return _currentState;
+ }
+
+ public MinionTaskBaseObserverStats setCurrentState(String currentState) {
+ _currentState = currentState;
+ return this;
+ }
+
+ public Deque<StatusEntry> getProgressLogs() {
+ return _progressLogs;
+ }
+
+ public MinionTaskBaseObserverStats setProgressLogs(Deque<StatusEntry> progressLogs) {
+ _progressLogs = progressLogs;
+ return this;
+ }
+
+ public static MinionTaskBaseObserverStats fromJsonString(String statsJson)
Review Comment:
Ah right, fixed it and added a test for it as well. Thanks for catching it!
##########
pinot-spi/src/main/java/org/apache/pinot/spi/tasks/MinionTaskBaseObserverStats.java:
##########
@@ -0,0 +1,168 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.spi.tasks;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import java.util.Deque;
+import java.util.LinkedList;
+import java.util.Objects;
+import org.apache.pinot.spi.utils.JsonUtils;
+
+
+public class MinionTaskBaseObserverStats {
+ protected String _taskId;
+ protected String _currentState;
+ protected long _startTimestamp;
+ protected Deque<StatusEntry> _progressLogs = new LinkedList<>();
+
+ public MinionTaskBaseObserverStats() {
+ }
+
+ public MinionTaskBaseObserverStats(MinionTaskBaseObserverStats from) {
+ _taskId = from.getTaskId();
+ _currentState = from.getCurrentState();
+ _startTimestamp = from.getStartTimestamp();
+ _progressLogs = new LinkedList<>(from.getProgressLogs());
+ }
+
+ public String getTaskId() {
+ return _taskId;
+ }
+
+ public MinionTaskBaseObserverStats setTaskId(String taskId) {
+ _taskId = taskId;
+ return this;
+ }
+
+ public long getStartTimestamp() {
+ return _startTimestamp;
+ }
+
+ public MinionTaskBaseObserverStats setStartTimestamp(long startTimestamp) {
+ _startTimestamp = startTimestamp;
+ return this;
+ }
+
+ public String getCurrentState() {
+ return _currentState;
+ }
+
+ public MinionTaskBaseObserverStats setCurrentState(String currentState) {
+ _currentState = currentState;
+ return this;
+ }
+
+ public Deque<StatusEntry> getProgressLogs() {
+ return _progressLogs;
+ }
+
+ public MinionTaskBaseObserverStats setProgressLogs(Deque<StatusEntry> progressLogs) {
+ _progressLogs = progressLogs;
+ return this;
+ }
+
+ public static MinionTaskBaseObserverStats fromJsonString(String statsJson)
Review Comment:
Ah right, fixed it and added a test as well. Thanks for catching it!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Decouple tracking and storage in MinionEventObserver using MinionTaskProgressManager [pinot]
Posted by "swaminathanmanish (via GitHub)" <gi...@apache.org>.
swaminathanmanish commented on code in PR #15044:
URL: https://github.com/apache/pinot/pull/15044#discussion_r1957612255
##########
pinot-spi/src/main/java/org/apache/pinot/spi/tasks/MinionTaskProgressStats.java:
##########
@@ -0,0 +1,95 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.spi.tasks;
+
+import java.util.Deque;
+import java.util.LinkedList;
+import java.util.Objects;
+
+
+public class MinionTaskProgressStats {
Review Comment:
Can we call this MinionTaskObserverStats ?
##########
pinot-spi/src/main/java/org/apache/pinot/spi/tasks/StatusEntry.java:
##########
@@ -0,0 +1,80 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.spi.tasks;
+
+public class StatusEntry {
Review Comment:
Can we move this as well to MinionTaskObserverStats/MinionTaskProgressStats itself ? Its anyway part of MinionTaskObserverStats
##########
pinot-spi/src/main/java/org/apache/pinot/spi/tasks/MinionTaskProgressManager.java:
##########
@@ -0,0 +1,45 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.spi.tasks;
+
+import javax.annotation.Nullable;
+import org.apache.pinot.spi.env.PinotConfiguration;
+
+
+/**
+ * Interface to decouple minion task progress storage from task progress tracking
+ */
+public interface MinionTaskProgressManager {
Review Comment:
Can we name this MinionTaskObserverStorageAccessManager or something to reflect the purpose of the interface?
(to manager storage of Observer stats)
##########
pinot-spi/src/main/java/org/apache/pinot/spi/tasks/MinionTaskProgressStats.java:
##########
@@ -0,0 +1,95 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.spi.tasks;
+
+import java.util.Deque;
+import java.util.LinkedList;
+import java.util.Objects;
+
+
+public class MinionTaskProgressStats {
Review Comment:
I assume we intend to have this class extended for other usecases based on task types?
Will we have serializer and deserializer interfaces as well to do ser/deser of stats based on implementation
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Decouple tracking and storage in MinionEventObserver using MinionTaskProgressManager [pinot]
Posted by "shounakmk219 (via GitHub)" <gi...@apache.org>.
shounakmk219 commented on code in PR #15044:
URL: https://github.com/apache/pinot/pull/15044#discussion_r1957627822
##########
pinot-spi/src/main/java/org/apache/pinot/spi/tasks/MinionTaskProgressStats.java:
##########
@@ -0,0 +1,95 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.spi.tasks;
+
+import java.util.Deque;
+import java.util.LinkedList;
+import java.util.Objects;
+
+
+public class MinionTaskProgressStats {
Review Comment:
yes that's correct
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org