Skip to content

Commit

Permalink
fix bugs in scedule inserting and array mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
varjoranta committed Feb 12, 2015
1 parent ae5cbe5 commit ee33d35
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public RepairSegment getNextFreeRepairSegmentOnRange(@Bind("runId") long runId,
@Mapper(RepairScheduleMapper.class)
public RepairSchedule getRepairSchedule(@Bind("id") long repairScheduleId);

@SqlQuery(SQL_INSERT_REPAIR_SCHEDULE)
@SqlUpdate(SQL_INSERT_REPAIR_SCHEDULE)
@GetGeneratedKeys
public long insertRepairSchedule(@BindBean RepairSchedule newRepairSchedule);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import com.spotify.reaper.core.RepairSchedule;

import org.apache.cassandra.repair.RepairParallelism;
import org.apache.commons.lang.ArrayUtils;
import org.skife.jdbi.v2.StatementContext;
import org.skife.jdbi.v2.tweak.ResultSetMapper;

Expand All @@ -29,7 +28,7 @@ public class RepairScheduleMapper implements ResultSetMapper<RepairSchedule> {

@Override
public RepairSchedule map(int index, ResultSet r, StatementContext ctx) throws SQLException {
Integer[] runHistory = ArrayUtils.toObject((int[]) r.getArray("run_history").getArray());
Integer[] runHistory = (Integer[]) r.getArray("run_history").getArray();
Long[] runHistoryLong;
if (null != runHistory && runHistory.length > 0) {
runHistoryLong = new Long[runHistory.length];
Expand All @@ -53,4 +52,5 @@ public RepairSchedule map(int index, ResultSet r, StatementContext ctx) throws S
.pauseTime(RepairRunMapper.getDateTimeOrNull(r, "pause_time"))
.build(r.getLong("id"));
}

}

0 comments on commit ee33d35

Please sign in to comment.