Skip to content

Commit 994068e

Browse files
committed
[Cluster] Add overload to backupQuery to allow for additional parameter for the query.
1 parent 5ffc90a commit 994068e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

aeron-cluster/src/main/java/io/aeron/cluster/ConsensusPublisher.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package io.aeron.cluster;
1717

18+
import io.aeron.Aeron;
1819
import io.aeron.CommonContext;
1920
import io.aeron.ExclusivePublication;
2021
import io.aeron.Publication;
@@ -455,17 +456,40 @@ boolean backupQuery(
455456
final int version,
456457
final String responseChannel,
457458
final byte[] encodedCredentials)
459+
{
460+
return backupQuery(
461+
publication,
462+
correlationId,
463+
responseStreamId,
464+
version,
465+
Aeron.NULL_VALUE,
466+
responseChannel,
467+
encodedCredentials);
468+
}
469+
470+
boolean backupQuery(
471+
final ExclusivePublication publication,
472+
final long correlationId,
473+
final int responseStreamId,
474+
final int version,
475+
final long logPosition,
476+
final String responseChannel,
477+
final byte[] encodedCredentials)
458478
{
459479
if (null == publication)
460480
{
461481
return false;
462482
}
463483

484+
final long logPositionValue = Aeron.NULL_VALUE != logPosition ? logPosition :
485+
BackupQueryEncoder.logPositionNullValue();
486+
464487
backupQueryEncoder
465488
.wrapAndApplyHeader(buffer, 0, messageHeaderEncoder)
466489
.correlationId(correlationId)
467490
.responseStreamId(responseStreamId)
468491
.version(version)
492+
.logPosition(logPositionValue)
469493
.responseChannel(responseChannel)
470494
.putEncodedCredentials(encodedCredentials, 0, encodedCredentials.length);
471495

0 commit comments

Comments
 (0)