From 36c9b3d55b4ffbfd3fe57daae297549ff189c27e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Hegerfors?= Date: Mon, 26 Jun 2017 16:37:27 +0200 Subject: [PATCH] Fix repair parallelism in cluster overview output, for schedules/runs created in old versions --- .../reaper/storage/postgresql/RepairRunStatusMapper.java | 8 ++------ .../storage/postgresql/RepairScheduleStatusMapper.java | 9 +-------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/spotify/reaper/storage/postgresql/RepairRunStatusMapper.java b/src/main/java/com/spotify/reaper/storage/postgresql/RepairRunStatusMapper.java index 1a460b57..75e9cd31 100644 --- a/src/main/java/com/spotify/reaper/storage/postgresql/RepairRunStatusMapper.java +++ b/src/main/java/com/spotify/reaper/storage/postgresql/RepairRunStatusMapper.java @@ -37,12 +37,8 @@ public RepairRunStatus map(int index, ResultSet r, StatementContext ctx) throws DateTime pauseTime = RepairRunMapper.getDateTimeOrNull(r, "pause_time"); Double intensity = r.getDouble("intensity"); Boolean incrementalRepair = r.getBoolean("incremental_repair"); - String repairParallelismStr = r.getString("repair_parallelism"); - if (repairParallelismStr != null) - { - repairParallelismStr = repairParallelismStr.toUpperCase(); - } - RepairParallelism repairParallelism = RepairParallelism.fromName(repairParallelismStr); + RepairParallelism repairParallelism = + RepairParallelism.fromName(r.getString("repair_parallelism").toLowerCase().replace("datacenter_aware", "dc_parallel")); return new RepairRunStatus(fromSequenceId(runId), clusterName, keyspaceName, columnFamilies, segmentsRepaired, totalSegments, state, startTime, endTime, cause, owner, lastEvent, diff --git a/src/main/java/com/spotify/reaper/storage/postgresql/RepairScheduleStatusMapper.java b/src/main/java/com/spotify/reaper/storage/postgresql/RepairScheduleStatusMapper.java index 9bf28712..753214b1 100644 --- a/src/main/java/com/spotify/reaper/storage/postgresql/RepairScheduleStatusMapper.java +++ b/src/main/java/com/spotify/reaper/storage/postgresql/RepairScheduleStatusMapper.java @@ -34,13 +34,6 @@ public class RepairScheduleStatusMapper implements ResultSetMapper