Skip to content

Commit

Permalink
[Java] Have ClusterTool.describeLatestConsensusModuleSnapshot return …
Browse files Browse the repository at this point in the history
…an indication of failure or success.
  • Loading branch information
mikeb01 committed Sep 19, 2024
1 parent c972efd commit 0d595be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions aeron-cluster/src/main/java/io/aeron/cluster/ClusterTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -508,10 +508,11 @@ public static boolean invalidateLatestSnapshot(final PrintStream out, final File
*
* @param out to print the operation result.
* @param clusterDir where the cluster is running.
* @return <code>true</code> if the snapshot was successfully described <code>false</code> otherwise.
*/
public static void describeLatestConsensusModuleSnapshot(final PrintStream out, final File clusterDir)
public static boolean describeLatestConsensusModuleSnapshot(final PrintStream out, final File clusterDir)
{
BACKWARD_COMPATIBLE_OPERATIONS.describeLatestConsensusModuleSnapshot(clusterDir, out, null);
return BACKWARD_COMPATIBLE_OPERATIONS.describeLatestConsensusModuleSnapshot(clusterDir, out, null) == SUCCESS;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ void shouldDescribeLatestConsensusModuleSnapshot()
leader.consensusModule().context().clusterDir(),
capturingPrintStream.resetAndGetPrintStream()));

ClusterTool.describeLatestConsensusModuleSnapshot(
assertTrue(ClusterTool.describeLatestConsensusModuleSnapshot(
capturingPrintStream.resetAndGetPrintStream(),
leader.consensusModule().context().clusterDir());
leader.consensusModule().context().clusterDir()));

assertThat(
capturingPrintStream.flushAndGetContent(),
Expand Down

0 comments on commit 0d595be

Please sign in to comment.