Skip to content

Commit

Permalink
Pipe: Fixed the NPE for pipe heartbeat when there are nodes shutting …
Browse files Browse the repository at this point in the history
…down (apache#14584)
  • Loading branch information
Caideyipi authored Dec 30, 2024
1 parent fc36adb commit 81d32f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
import org.apache.iotdb.confignode.manager.pipe.coordinator.runtime.heartbeat.PipeHeartbeat;
import org.apache.iotdb.confignode.manager.pipe.coordinator.runtime.heartbeat.PipeHeartbeatScheduler;

import javax.validation.constraints.NotNull;

import java.nio.ByteBuffer;
import java.util.List;
import java.util.concurrent.ExecutorService;
Expand Down Expand Up @@ -106,7 +104,7 @@ public void stopPipeHeartbeat() {

public void parseHeartbeat(
final int dataNodeId,
@NotNull final List<ByteBuffer> pipeMetaByteBufferListFromDataNode,
/* @Nullable */ final List<ByteBuffer> pipeMetaByteBufferListFromDataNode,
/* @Nullable */ final List<Boolean> pipeCompletedListFromAgent,
/* @Nullable */ final List<Long> pipeRemainingEventCountListFromAgent,
/* @Nullable */ final List<Double> pipeRemainingTimeListFromAgent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import org.apache.iotdb.commons.pipe.agent.task.meta.PipeMeta;
import org.apache.iotdb.commons.pipe.agent.task.meta.PipeStaticMeta;

import javax.validation.constraints.NotNull;

import java.nio.ByteBuffer;
import java.util.HashMap;
import java.util.List;
Expand All @@ -37,10 +35,14 @@ public class PipeHeartbeat {
private final Map<PipeStaticMeta, Double> remainingTimeMap = new HashMap<>();

public PipeHeartbeat(
@NotNull final List<ByteBuffer> pipeMetaByteBufferListFromAgent,
/* @Nullable */ final List<ByteBuffer> pipeMetaByteBufferListFromAgent,
/* @Nullable */ final List<Boolean> pipeCompletedListFromAgent,
/* @Nullable */ final List<Long> pipeRemainingEventCountListFromAgent,
/* @Nullable */ final List<Double> pipeRemainingTimeListFromAgent) {
// Pipe meta may be null for nodes shutting down, return empty heartbeat
if (Objects.isNull(pipeMetaByteBufferListFromAgent)) {
return;
}
for (int i = 0; i < pipeMetaByteBufferListFromAgent.size(); ++i) {
final PipeMeta pipeMeta =
PipeMeta.deserialize4TaskAgent(pipeMetaByteBufferListFromAgent.get(i));
Expand Down

0 comments on commit 81d32f6

Please sign in to comment.