Skip to content

Commit

Permalink
[MIST-1174] Fix NullPointerException on DefaultConfigDagGeneratorImpl (
Browse files Browse the repository at this point in the history
…#1175)

This PR fixes #1174 via

* Check whether `vertexStateWithTimestamp` is null or not in `DefaultConfigDagGeneratorImpl`.

Closes #1174.
  • Loading branch information
DifferentSC authored and taegeonum committed Jul 9, 2018
1 parent c9134c3 commit 10a2e52
Showing 1 changed file with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,24 @@ public DAG<ConfigVertex, MISTEdge> generateWithCheckpointedStates(final AvroDag
for (final AvroVertex avroVertex : avroVertices) {
final StateWithTimestamp vertexStateWithTimestamp = queryState.get(avroVertex.getVertexId());
final ExecutionVertex.Type type = getVertexType(avroVertex);
// Create a config vertex with checkpointed states.
final ConfigVertex configVertex = new ConfigVertex(
Long.toString(configVertexId.getAndIncrement()),
type,
avroVertex.getConfiguration(),
vertexStateWithTimestamp.getVertexState(),
vertexStateWithTimestamp.getCheckpointTimestamp());
final ConfigVertex configVertex;
if (vertexStateWithTimestamp == null) {
// This operator is stateless.
// Create a config vertex without checkpointed states.
configVertex = new ConfigVertex(
Long.toString(configVertexId.getAndIncrement()),
type,
avroVertex.getConfiguration());
} else {
// This operator is stateful.
// Create a config vertex with checkpointed states.
configVertex = new ConfigVertex(
Long.toString(configVertexId.getAndIncrement()),
type,
avroVertex.getConfiguration(),
vertexStateWithTimestamp.getVertexState(),
vertexStateWithTimestamp.getCheckpointTimestamp());
}
deserializedVertices.add(configVertex);
configDag.addVertex(configVertex);
}
Expand Down

0 comments on commit 10a2e52

Please sign in to comment.