Skip to content

Commit 175dcfe

Browse files
committed
Change groupId from int to uint32. (#5605)
This change removes the need to convert between int and uint32. Group IDs are always uint32.
1 parent a96978d commit 175dcfe

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

ee/backup/file_handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ func (h *fileHandler) Load(uri *url.URL, backupId string, fn loadFn) LoadResult
171171
// of the last backup.
172172
predSet := manifests[len(manifests)-1].getPredsInGroup(gid)
173173

174-
groupMaxUid, err := fn(fp, int(gid), predSet)
174+
groupMaxUid, err := fn(fp, gid, predSet)
175175
if err != nil {
176176
return LoadResult{0, 0, err}
177177
}

ee/backup/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ type predicateSet map[string]struct{}
171171
// loadFn is a function that will receive the current file being read.
172172
// A reader, the backup groupId, and a map whose keys are the predicates to restore
173173
// are passed as arguments.
174-
type loadFn func(reader io.Reader, groupId int, preds predicateSet) (uint64, error)
174+
type loadFn func(reader io.Reader, groupId uint32, preds predicateSet) (uint64, error)
175175

176176
// Load will scan location l for backup files in the given backup series and load them
177177
// sequentially. Returns the maximum Since value on success, otherwise an error.

ee/backup/restore.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func RunRestore(pdir, location, backupId, keyfile string) LoadResult {
4444
// Scan location for backup files and load them. Each file represents a node group,
4545
// and we create a new p dir for each.
4646
return Load(location, backupId,
47-
func(r io.Reader, groupId int, preds predicateSet) (uint64, error) {
47+
func(r io.Reader, groupId uint32, preds predicateSet) (uint64, error) {
4848

4949
dir := filepath.Join(pdir, fmt.Sprintf("p%d", groupId))
5050
r, err := enc.GetReader(keyfile, r)

ee/backup/s3_handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ func (h *s3Handler) Load(uri *url.URL, backupId string, fn loadFn) LoadResult {
318318
// of the last backup.
319319
predSet := manifests[len(manifests)-1].getPredsInGroup(gid)
320320

321-
groupMaxUid, err := fn(reader, int(gid), predSet)
321+
groupMaxUid, err := fn(reader, gid, predSet)
322322
if err != nil {
323323
return LoadResult{0, 0, err}
324324
}

0 commit comments

Comments
 (0)