use of io.etcd.jetcd.api.CampaignRequest in project jetcd by coreos.
the class ElectionImpl method campaign.
@Override
public CompletableFuture<CampaignResponse> campaign(ByteSequence electionName, long leaseId, ByteSequence proposal) {
checkNotNull(electionName, "election name should not be null");
checkNotNull(proposal, "proposal should not be null");
CampaignRequest request = CampaignRequest.newBuilder().setName(Util.prefixNamespace(electionName, namespace)).setValue(ByteString.copyFrom(proposal.getBytes())).setLease(leaseId).build();
return completable(stub.campaign(request), CampaignResponse::new, this::convertException);
}
Aggregations