Skip to content

Commit

Permalink
Rename SegmentCountPerNode -> TotalSegments
Browse files Browse the repository at this point in the history
  • Loading branch information
adutra committed Jun 14, 2021
1 parent 6f27ca2 commit eb34b5c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
38 changes: 19 additions & 19 deletions reaper/repair_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@ import (
)

type RepairRun struct {
Id uuid.UUID `json:"id"`
Cluster string `json:"cluster_name"`
Owner string `json:"owner"`
Keyspace string `json:"keyspace_name"`
Tables []string `json:"column_families"`
Cause string `json:"cause"`
State RepairRunState `json:"state"`
Intensity Intensity `json:"intensity"`
IncrementalRepair bool `json:"incremental_repair"`
SegmentCountPerNode int `json:"total_segments"`
RepairParallelism RepairParallelism `json:"repair_parallelism"`
SegmentsRepaired int `json:"segments_repaired"`
LastEvent string `json:"last_event"`
Duration string `json:"duration"`
Nodes []string `json:"nodes"`
Datacenters []string `json:"datacenters"`
IgnoredTables []string `json:"blacklisted_tables"`
RepairThreadCount int `json:"repair_thread_count"`
RepairUnitId uuid.UUID `json:"repair_unit_id"`
Id uuid.UUID `json:"id"`
Cluster string `json:"cluster_name"`
Owner string `json:"owner"`
Keyspace string `json:"keyspace_name"`
Tables []string `json:"column_families"`
Cause string `json:"cause"`
State RepairRunState `json:"state"`
Intensity Intensity `json:"intensity"`
IncrementalRepair bool `json:"incremental_repair"`
TotalSegments int `json:"total_segments"`
RepairParallelism RepairParallelism `json:"repair_parallelism"`
SegmentsRepaired int `json:"segments_repaired"`
LastEvent string `json:"last_event"`
Duration string `json:"duration"`
Nodes []string `json:"nodes"`
Datacenters []string `json:"datacenters"`
IgnoredTables []string `json:"blacklisted_tables"`
RepairThreadCount int `json:"repair_thread_count"`
RepairUnitId uuid.UUID `json:"repair_unit_id"`
}

func (r RepairRun) String() string {
Expand Down
10 changes: 5 additions & 5 deletions reaper/repair_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,10 @@ func createRepairRun(t *testing.T, client Client, cluster string) *RepairRun {
"Alice",
&RepairRunCreateOptions{
Tables: []string{"table1", "table2"},
SegmentCountPerNode: 1,
SegmentCountPerNode: 5,
RepairParallelism: RepairParallelismParallel,
Intensity: 0.1,
IncrementalRepair: true,
IncrementalRepair: false,
RepairThreadCount: 4,
Cause: "testing repair runs",
},
Expand All @@ -323,9 +323,9 @@ func checkRepairRun(t *testing.T, cluster string, actual *RepairRun) *RepairRun
assert.ElementsMatch(t, []string{"table1", "table2"}, actual.Tables)
assert.Equal(t, RepairRunStateNotStarted, actual.State)
assert.InDelta(t, 0.1, actual.Intensity, 0.001)
assert.Equal(t, true, actual.IncrementalRepair)
// FIXME segment count per node is always 2
// assert.Equal(t, 1, actual.SegmentCountPerNode)
assert.False(t, actual.IncrementalRepair)
// Can't really guess the total
assert.GreaterOrEqual(t, actual.TotalSegments, 10)
assert.Equal(t, RepairParallelismParallel, actual.RepairParallelism)
assert.Equal(t, 0, actual.SegmentsRepaired)
assert.Equal(t, "no events", actual.LastEvent)
Expand Down

0 comments on commit eb34b5c

Please sign in to comment.