Skip to content

Commit

Permalink
Fix rebase problems.
Browse files Browse the repository at this point in the history
  • Loading branch information
Miles-Garnsey committed Aug 23, 2023
1 parent ea1c395 commit 3c9aa74
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -744,10 +744,10 @@ public String repair(
@RpcParam(name = "tables") List<String> tables,
@RpcParam(name = "full") Boolean full,
@RpcParam(name = "notifications") boolean notifications,
@RpcParam(name = "repairParallelism") RepairParallelism repairParallelism,
@RpcParam(name = "datacenters") Collection<String> datacenters,
@RpcParam(name = "associatedTokens") List<RingRange> associatedTokens,
@RpcParam(name = "repairThreadCount") int repairThreadCount)
@RpcParam(name = "repairParallelism") Optional<RepairParallelism> repairParallelism,
@RpcParam(name = "datacenters") Optional<Collection<String>> datacenters,
@RpcParam(name = "associatedTokens") Optional<List<RingRange>> associatedTokens,
@RpcParam(name = "repairThreadCount") Optional<Integer> repairThreadCount)
throws IOException {
// At least one keyspace is required
assert(keyspace != null);
Expand Down Expand Up @@ -776,16 +776,16 @@ public String repair(
.collect(Collectors.toList()),
",")
)
));
);
}
datacenters.map( dcs ->
options.put(RepairOption.DATACENTERS_KEY, StringUtils.join(dcs, ","))
);

// Since Cassandra provides us with a async, we don't need to use our executor interface for
// this.
final int repairJobId =
ShimLoader.instance.get().getStorageService().repairAsync(keyspace, options);
final int repairJobId =
ShimLoader.instance.get().getStorageService().repairAsync(keyspace, options);

if (!notifications) {
return Integer.valueOf(repairJobId).toString();
Expand Down Expand Up @@ -850,10 +850,6 @@ public String repair(
return job.getJobId();
}

throw new RuntimeException("At least one keyspace must be defined");

}

@Rpc(name = "move")
public String move(
@RpcParam(name = "newToken") String newToken, @RpcParam(name = "async") boolean async)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.datastax.mgmtapi.rpc.models;

import java.math.BigInteger;
import java.util.Comparator;

public final class RingRange {

public static final Comparator<RingRange> START_COMPARATOR
= (RingRange o1, RingRange o2) -> o1.start.compareTo(o2.start);

public final BigInteger start;
public final BigInteger end;

public RingRange(BigInteger start, BigInteger end) {
this.start = start;
this.end = end;
}

public RingRange(String... range) {
start = new BigInteger(range[0]);
end = new BigInteger(range[1]);
}

public BigInteger getStart() {
return start;
}

public BigInteger getEnd() {
return end;
}
}

0 comments on commit 3c9aa74

Please sign in to comment.