X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0a98952530fb465fa31566fa5e0192bea9fc16e4..f95ac4c11b99daea342be0fba98e66c92d70e54c:/services/keep-balance/change_set.go diff --git a/services/keep-balance/change_set.go b/services/keep-balance/change_set.go index 417ea7ff8b..85d03d409b 100644 --- a/services/keep-balance/change_set.go +++ b/services/keep-balance/change_set.go @@ -1,3 +1,7 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + package main import ( @@ -5,32 +9,37 @@ import ( "fmt" "sync" - "git.curoverse.com/arvados.git/sdk/go/arvados" + "git.arvados.org/arvados.git/sdk/go/arvados" ) // Pull is a request to retrieve a block from a remote server, and // store it locally. type Pull struct { arvados.SizedDigest - Source *KeepService + From *KeepService + To *KeepMount } // MarshalJSON formats a pull request the way keepstore wants to see // it. func (p Pull) MarshalJSON() ([]byte, error) { type KeepstorePullRequest struct { - Locator string `json:"locator"` - Servers []string `json:"servers"` + Locator string `json:"locator"` + Servers []string `json:"servers"` + MountUUID string `json:"mount_uuid"` } return json.Marshal(KeepstorePullRequest{ - Locator: string(p.SizedDigest[:32]), - Servers: []string{p.Source.URLBase()}}) + Locator: string(p.SizedDigest[:32]), + Servers: []string{p.From.URLBase()}, + MountUUID: p.To.KeepMount.UUID, + }) } // Trash is a request to delete a block. type Trash struct { arvados.SizedDigest Mtime int64 + From *KeepMount } // MarshalJSON formats a trash request the way keepstore wants to see @@ -39,10 +48,13 @@ func (t Trash) MarshalJSON() ([]byte, error) { type KeepstoreTrashRequest struct { Locator string `json:"locator"` BlockMtime int64 `json:"block_mtime"` + MountUUID string `json:"mount_uuid"` } return json.Marshal(KeepstoreTrashRequest{ Locator: string(t.SizedDigest[:32]), - BlockMtime: t.Mtime}) + BlockMtime: t.Mtime, + MountUUID: t.From.KeepMount.UUID, + }) } // ChangeSet is a set of change requests that will be sent to a