use of org.apache.flink.types.BooleanValue in project flink by apache.
the class CheckpointCoordinatorRestoringTest method testJobGraphModificationsAreCheckedForInitialCheckpoint.
@Test
public void testJobGraphModificationsAreCheckedForInitialCheckpoint() throws Exception {
final JobVertexID jobVertexID = new JobVertexID();
ExecutionGraph graph = new CheckpointCoordinatorTestingUtils.CheckpointExecutionGraphBuilder().addJobVertex(jobVertexID, 1, 1).build();
CompletedCheckpointStore completedCheckpointStore = new EmbeddedCompletedCheckpointStore();
CompletedCheckpoint completedCheckpoint = new CompletedCheckpoint(graph.getJobID(), 2, System.currentTimeMillis(), System.currentTimeMillis() + 3000, Collections.emptyMap(), Collections.emptyList(), CheckpointProperties.forCheckpoint(CheckpointRetentionPolicy.NEVER_RETAIN_AFTER_TERMINATION), new TestCompletedCheckpointStorageLocation());
completedCheckpointStore.addCheckpointAndSubsumeOldestOne(completedCheckpoint, new CheckpointsCleaner(), () -> {
});
BooleanValue checked = new BooleanValue(false);
CheckpointCoordinator restoreCoordinator = new CheckpointCoordinatorBuilder().setExecutionGraph(graph).setCompletedCheckpointStore(completedCheckpointStore).setVertexFinishedStateCheckerFactory((vertices, states) -> new VertexFinishedStateChecker(vertices, states) {
@Override
public void validateOperatorsFinishedState() {
checked.set(true);
}
}).build();
restoreCoordinator.restoreInitialCheckpointIfPresent(new HashSet<>(graph.getAllVertices().values()));
assertTrue("The finished states should be checked when job is restored on startup", checked.get());
}
use of org.apache.flink.types.BooleanValue in project flink by apache.
the class BooleanValueComparator method compareToReference.
@Override
public int compareToReference(TypeComparator<BooleanValue> referencedComparator) {
BooleanValue otherRef = ((BooleanValueComparator) referencedComparator).reference;
int comp = otherRef.compareTo(reference);
return ascendingComparison ? comp : -comp;
}
use of org.apache.flink.types.BooleanValue in project flink by apache.
the class BooleanValueSerializer method copy.
@Override
public BooleanValue copy(BooleanValue from) {
BooleanValue result = new BooleanValue();
result.setValue(from.getValue());
return result;
}
use of org.apache.flink.types.BooleanValue in project flink by apache.
the class BoxedWrapperRowData method setBoolean.
@Override
public void setBoolean(int pos, boolean value) {
BooleanValue wrap;
if ((wrap = (BooleanValue) fields[pos]) == null) {
wrap = new BooleanValue();
fields[pos] = wrap;
}
wrap.setValue(value);
}
use of org.apache.flink.types.BooleanValue in project flink by apache.
the class CheckpointCoordinatorRestoringTest method testJobGraphModificationsAreCheckedForSavepoint.
@Test
public void testJobGraphModificationsAreCheckedForSavepoint() throws Exception {
final JobVertexID jobVertexID = new JobVertexID();
ExecutionGraph graph = new CheckpointCoordinatorTestingUtils.CheckpointExecutionGraphBuilder().addJobVertex(jobVertexID, 1, 1).build();
CheckpointCoordinator coordinator = new CheckpointCoordinatorBuilder().setExecutionGraph(graph).setTimer(manuallyTriggeredScheduledExecutor).build();
File savepointPath = tmpFolder.newFolder();
CompletableFuture<CompletedCheckpoint> savepointFuture = coordinator.triggerSavepoint("file://" + savepointPath.getAbsolutePath(), SavepointFormatType.CANONICAL);
manuallyTriggeredScheduledExecutor.triggerAll();
long pendingSavepointId = coordinator.getPendingCheckpoints().keySet().stream().findFirst().get();
coordinator.receiveAcknowledgeMessage(new AcknowledgeCheckpoint(graph.getJobID(), graph.getJobVertex(jobVertexID).getTaskVertices()[0].getCurrentExecutionAttempt().getAttemptId(), pendingSavepointId), "localhost");
assertTrue(savepointFuture.isDone());
BooleanValue checked = new BooleanValue(false);
CheckpointCoordinator restoreCoordinator = new CheckpointCoordinatorBuilder().setExecutionGraph(graph).setVertexFinishedStateCheckerFactory((vertices, states) -> new VertexFinishedStateChecker(vertices, states) {
@Override
public void validateOperatorsFinishedState() {
checked.set(true);
}
}).build();
restoreCoordinator.restoreSavepoint(SavepointRestoreSettings.forPath(savepointFuture.get().getExternalPointer()), graph.getAllVertices(), getClass().getClassLoader());
assertTrue("The finished states should be checked when job is restored on startup", checked.get());
}
Aggregations