Caideyipi commented on code in PR #12355:
URL: https://github.com/apache/iotdb/pull/12355#discussion_r1615526255
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/agent/task/PipeDataNodeTaskAgent.java:
##########
@@ -582,4 +586,47 @@ public Set<Integer> getPipeTaskRegionIdSet(final String
pipeName, final long cre
? Collections.emptySet()
: pipeMeta.getRuntimeMeta().getConsensusGroupId2TaskMetaMap().keySet();
}
+
+ ///////////////////////// Pipe Consensus /////////////////////////
+
+ public ProgressIndex getPipeTaskProgressIndex(String pipeName, int
consensusGroupId) {
+ if (!tryReadLockWithTimeOut(10)) {
+ throw new PipeException(
+ String.format(
+ "Failed to get pipe task progress index with pipe name: %s,
consensus group id %s.",
+ pipeName, consensusGroupId));
+ }
+
+ try {
+ if (!pipeMetaKeeper.containsPipeMeta(pipeName)) {
+ throw new PipeException("Pipe meta not found: " + pipeName);
+ }
+
+ return pipeMetaKeeper
+ .getPipeMeta(pipeName)
+ .getRuntimeMeta()
+ .getConsensusGroupId2TaskMetaMap()
+ .get(consensusGroupId)
+ .getProgressIndex();
+ } finally {
+ releaseReadLock();
+ }
+ }
+
+ public Map<ConsensusPipeName, PipeStatus> getAllConsensusPipe() {
+ if (!tryReadLockWithTimeOut(10)) {
+ throw new PipeException("Failed to get all consensus pipe.");
Review Comment:
What will happen if you throw an exception in "buildConsensusConfig"?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]