StorageService: change repair to the updated API

The API now uses explicit parameters to pass the parameters to repair.
This patch changes how the parameters are passed to the API to be
compatible with the changed API.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
Reviewed-by: Nadav Har'El <nyh@scylladb.com>
This commit is contained in:
Amnon Heiman 2015-12-29 17:09:22 +02:00 committed by Pekka Enberg
parent 69c6913668
commit 6c2bb34ca3

View File

@ -660,16 +660,10 @@ public class StorageService extends NotificationBroadcasterSupport
public int repairAsync(String keyspace, Map<String, String> options) {
log(" repairAsync(String keyspace, Map<String, String> options)");
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
String opts = "";
for (String op : options.keySet()) {
// Scylla splits options on "," (between options) and ":" (between
// name and value): See scylla/api/storage_service.cc.
if (!opts.equals("")) {
opts = opts + ",";
}
opts = opts + op + ":" + options.get(op);
APIClient.set_query_param(queryParams, op, options.get(op));
}
APIClient.set_query_param(queryParams, "options", opts);
int cmd = c.postInt("/storage_service/repair_async/" + keyspace, queryParams);
waitAndNotifyRepair(cmd, keyspace, getRepairMessage(cmd, keyspace, 1, RepairParallelism.SEQUENTIAL, true));
return cmd;