use of io.etcd.jetcd.api.ProclaimRequest in project jetcd by coreos.
the class ElectionImpl method proclaim.
@Override
public CompletableFuture<ProclaimResponse> proclaim(LeaderKey leaderKey, ByteSequence proposal) {
checkNotNull(leaderKey, "leader key should not be null");
checkNotNull(proposal, "proposal should not be null");
ProclaimRequest request = ProclaimRequest.newBuilder().setLeader(io.etcd.jetcd.api.LeaderKey.newBuilder().setKey(ByteString.copyFrom(leaderKey.getKey().getBytes())).setName(ByteString.copyFrom(leaderKey.getName().getBytes())).setLease(leaderKey.getLease()).setRev(leaderKey.getRevision()).build()).setValue(ByteString.copyFrom(proposal.getBytes())).build();
return completable(stub.proclaim(request), ProclaimResponse::new, this::convertException);
}
Aggregations