}
}
// If the cluster has a leader then locate the leader and forward the operation.
if (context.currentLeader() != null) {
@SuppressWarnings("rawtypes")
RemoteNode leader = context.clusterManager().remoteNode(context.currentLeader());
if (leader != null) {
logger().debug("{} - Forwarding {} to leader {}", context.clusterManager().localNode(), request, leader);
leader.client().connect().whenComplete((r, e) -> {
if (e != null) {
future.completeExceptionally(e);
} else {
leader.client().submit(request).whenComplete((result, error) -> {
if (error != null) {
future.completeExceptionally(error);
} else {
future.complete(result);
}