Search in sources :

Example 1 with ProclaimResponse

use of io.etcd.jetcd.election.ProclaimResponse 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);
}
Also used : ProclaimRequest(io.etcd.jetcd.api.ProclaimRequest) ProclaimResponse(io.etcd.jetcd.election.ProclaimResponse)

Aggregations

ProclaimRequest (io.etcd.jetcd.api.ProclaimRequest)1 ProclaimResponse (io.etcd.jetcd.election.ProclaimResponse)1