StorageService: rename the dc parameter in rebuild

The API uses the source_dc as a query parameter, the jmx should use the
same.

In addition, the rebuild method can get null as a datacenter value and
in that case it should not pass a parameter.

Fixes scylladb/scylla#668.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
This commit is contained in:
Amnon Heiman 2015-12-17 18:15:50 +02:00 committed by Pekka Enberg
parent 7543882d6c
commit 75479531e0

View File

@ -1032,9 +1032,13 @@ public class StorageService extends NotificationBroadcasterSupport
*/
public void rebuild(String sourceDc) {
log(" rebuild(String sourceDc)");
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
APIClient.set_query_param(queryParams, "value", sourceDc);
c.post("/storage_service/rebuild", queryParams);
if (sourceDc != null) {
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
APIClient.set_query_param(queryParams, "source_dc", sourceDc);
c.post("/storage_service/rebuild", queryParams);
} else {
c.post("/storage_service/rebuild");
}
}
/** Starts a bulk load and blocks until it completes. */